Skip to content

Commit 0b390e6

Browse files
committed
Merge branch 'feature/contract' of github.com:ChainSQL/java-chainsql-api into feature/contract
2 parents 8cebaee + 1226fa6 commit 0b390e6

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

chainsql/src/main/java/com/peersafe/chainsql/core/Chainsql.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,18 +408,16 @@ JSONObject prepareSigned() {
408408
}
409409
mTxJson.put("Account",this.connection.address);
410410

411-
if(mTxJson.getInt("OpType") == Constant.opType.get("t_grant") &&
411+
if(mTxJson.has("OpType") && mTxJson.getInt("OpType") == Constant.opType.get("t_grant") &&
412412
!this.connection.address.equals(connection.scope)){
413413
mTxJson.put("Owner", connection.scope);
414414
}
415415

416-
417416
if (this.connection.userCert != null) {
418417
String sCert = Util.toHexString(this.connection.userCert);
419418
mTxJson.put("Certificate", sCert);
420419
}
421420

422-
423421
//for cross chain
424422
if(crossChainArgs != null){
425423
mTxJson.put("TxnLgrSeq", crossChainArgs.txnLedgerSeq);

chainsql/src/main/java/com/peersafe/chainsql/core/Table.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,11 @@ private JSONObject prepareSQLStatement() {
285285

286286
txjson.put("Account", this.connection.address);
287287

288+
if (this.connection.userCert != null) {
289+
String sCert = Util.toHexString(this.connection.userCert);
290+
txjson.put("Certificate", sCert);
291+
}
292+
288293
if(this.autoFillField != null){
289294
txjson.put("AutoFillField", Util.toHexString(this.autoFillField));
290295
}

0 commit comments

Comments
 (0)