File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
src/main/java/org/tron/walletserver Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -2178,15 +2178,13 @@ public boolean triggerContract(
21782178 Transaction transaction = transactionExtention
21792179 .getTransaction ();
21802180 // for constant
2181- if (transaction .getRetCount () != 0
2182- && transactionExtention .getConstantResult (0 ) != null
2183- && transactionExtention .getResult () != null ) {
2184- byte [] result = transactionExtention .getConstantResult (0 ).toByteArray ();
2185- System .out .println ("message:" + transaction .getRet (0 ).getRet ());
2186- System .out .println (
2187- ":" + ByteArray .toStr (transactionExtention .getResult ().getMessage ().toByteArray ()));
2188- System .out .println ("Result:" + Hex .toHexString (result ));
2189- System .out .println ("EnergyUsed:" + transactionExtention .getEnergyUsed ());
2181+ if (transaction .getRetCount () != 0 ) {
2182+ TransactionExtention .Builder builder =
2183+ transactionExtention .toBuilder ().clearTransaction ().clearTxid ();
2184+ if (transaction .getRet (0 ).getRet () == Result .code .FAILED ) {
2185+ builder .setResult (builder .getResult ().toBuilder ().setResult (false ));
2186+ }
2187+ System .out .println ("Execution result = " + Utils .formatMessageString (builder .build ()));
21902188 return true ;
21912189 }
21922190
You can’t perform that action at this time.
0 commit comments