mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-26 11:35:10 +00:00
Merge branch 'main' into patch-1
This commit is contained in:
commit
e27963eff2
3 changed files with 8 additions and 3 deletions
|
|
@ -18,6 +18,7 @@ public class CommercialPaper extends State {
|
||||||
public final static String ISSUED = "ISSUED";
|
public final static String ISSUED = "ISSUED";
|
||||||
public final static String TRADING = "TRADING";
|
public final static String TRADING = "TRADING";
|
||||||
public final static String REDEEMED = "REDEEMED";
|
public final static String REDEEMED = "REDEEMED";
|
||||||
|
public final static String[] STATES = new String[] {ISSUED, TRADING, REDEEMED};
|
||||||
|
|
||||||
@Property()
|
@Property()
|
||||||
private String state="";
|
private String state="";
|
||||||
|
|
@ -161,8 +162,9 @@ public class CommercialPaper extends State {
|
||||||
String maturityDateTime = json.getString("maturityDateTime");
|
String maturityDateTime = json.getString("maturityDateTime");
|
||||||
String owner = json.getString("owner");
|
String owner = json.getString("owner");
|
||||||
int faceValue = json.getInt("faceValue");
|
int faceValue = json.getInt("faceValue");
|
||||||
String state = json.getString("state");
|
int currentState = json.getInt("currentState");
|
||||||
return createInstance(issuer, paperNumber, issueDateTime, maturityDateTime, faceValue,owner,state);
|
String state = STATES[currentState-1];
|
||||||
|
return createInstance(issuer, paperNumber, issueDateTime, maturityDateTime, faceValue, owner, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static byte[] serialize(CommercialPaper paper) {
|
public static byte[] serialize(CommercialPaper paper) {
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ public class CommercialPaper extends State {
|
||||||
public final static String ISSUED = "ISSUED";
|
public final static String ISSUED = "ISSUED";
|
||||||
public final static String TRADING = "TRADING";
|
public final static String TRADING = "TRADING";
|
||||||
public final static String REDEEMED = "REDEEMED";
|
public final static String REDEEMED = "REDEEMED";
|
||||||
|
public final static String[] STATES = new String[] {ISSUED, TRADING, REDEEMED};
|
||||||
|
|
||||||
@Property()
|
@Property()
|
||||||
private String state="";
|
private String state="";
|
||||||
|
|
@ -162,7 +163,8 @@ public class CommercialPaper extends State {
|
||||||
String maturityDateTime = json.getString("maturityDateTime");
|
String maturityDateTime = json.getString("maturityDateTime");
|
||||||
String owner = json.getString("owner");
|
String owner = json.getString("owner");
|
||||||
int faceValue = json.getInt("faceValue");
|
int faceValue = json.getInt("faceValue");
|
||||||
String state = json.getString("state");
|
int currentState = json.getInt("currentState");
|
||||||
|
String state = STATES[currentState-1];
|
||||||
return createInstance(issuer, paperNumber, issueDateTime, maturityDateTime, faceValue, owner, state);
|
return createInstance(issuer, paperNumber, issueDateTime, maturityDateTime, faceValue, owner, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,7 @@ if [ "$CC_SRC_LANGUAGE" = "go" ]; then
|
||||||
elif [ "$CC_SRC_LANGUAGE" = "java" ]; then
|
elif [ "$CC_SRC_LANGUAGE" = "java" ]; then
|
||||||
CC_RUNTIME_LANGUAGE=java
|
CC_RUNTIME_LANGUAGE=java
|
||||||
|
|
||||||
|
rm -rf $CC_SRC_PATH/build/install/
|
||||||
infoln "Compiling Java code..."
|
infoln "Compiling Java code..."
|
||||||
pushd $CC_SRC_PATH
|
pushd $CC_SRC_PATH
|
||||||
./gradlew installDist
|
./gradlew installDist
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue