Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions src/main/java/org/tron/demo/ShieldedTRC20Demo.java
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ private static String triggerMint(byte[] contractAddress,
"mint(uint256,bytes32[9],bytes32[2],bytes32[21])",
input,
true,
0L, 10000000L,
0L, 50000000L,
"0", 0,
callerAddress, privateKey);
}
Expand All @@ -212,7 +212,7 @@ private static String triggerTransfer(
"transfer(bytes32[10][],bytes32[2][],bytes32[9][],bytes32[2],bytes32[21][])",
input,
true,
0L, 1000000000L,
0L, 50000000L,
"0",
0,
callerAddress, privateKey);
Expand All @@ -227,7 +227,7 @@ private static String triggerBurn(byte[] contractAddress,
+ "bytes32[21][])",
input,
true,
0L, 1000000000L,
0L, 50000000L,
"0",
0,
callerAddress, privateKey);
Expand Down Expand Up @@ -399,8 +399,6 @@ private static GrpcAPI.PrivateShieldedTRC20Parameters mintParams(String privKey,
BigInteger fromAmount = BigInteger.valueOf(value).multiply(scalingFactorBi);
SpendingKey sk = new SpendingKey(ByteArray.fromHexString(spendingKey));
ExpandedSpendingKey expsk = sk.expandedSpendingKey();
byte[] ask = expsk.getAsk();
byte[] nsk = expsk.getNsk();
byte[] ovk = expsk.getOvk();

// ReceiveNote
Expand All @@ -418,8 +416,6 @@ private static GrpcAPI.PrivateShieldedTRC20Parameters mintParams(String privKey,

GrpcAPI.PrivateShieldedTRC20Parameters.Builder paramBuilder = GrpcAPI
.PrivateShieldedTRC20Parameters.newBuilder();
paramBuilder.setAsk(ByteString.copyFrom(ask));
paramBuilder.setNsk(ByteString.copyFrom(nsk));
paramBuilder.setOvk(ByteString.copyFrom(ovk));
paramBuilder.setFromAmount(fromAmount.toString());
paramBuilder.addShieldedReceives(revNoteBuilder.build());
Expand Down Expand Up @@ -452,9 +448,9 @@ private static Optional<TransactionInfo> waitToGetTransactionInfo(String txid)
while (infoById.get().getLogList().size() < 2) {
logger.info("Can not get transaction info, please wait....");
Thread.sleep(5000);
return WalletApi.getTransactionInfoById(txid);
infoById = WalletApi.getTransactionInfoById(txid);
}
return null;
return infoById;
}

private static SpendNoteTRC20 getSpendNote(TransactionInfo txInfo,
Expand Down