Skip to content

Commit 8d21e88

Browse files
authored
only decode the event when transaction status is normal (#197)
1 parent e172281 commit 8d21e88

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

sdk-transaction/src/main/java/org/fisco/bcos/sdk/transaction/codec/decode/TransactionDecoderService.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,14 @@ public TransactionResponse decodeReceiptWithoutValues(
8787
String abi, TransactionReceipt transactionReceipt)
8888
throws TransactionException, IOException, ABICodecException {
8989
TransactionResponse response = decodeReceiptStatus(transactionReceipt);
90-
String events = JsonUtils.toJson(decodeEvents(abi, transactionReceipt.getLogs()));
9190
response.setTransactionReceipt(transactionReceipt);
92-
response.setEvents(events);
9391
response.setContractAddress(transactionReceipt.getContractAddress());
92+
// the exception transaction
93+
if (!transactionReceipt.getStatus().equals("0x0")) {
94+
return response;
95+
}
96+
String events = JsonUtils.toJson(decodeEvents(abi, transactionReceipt.getLogs()));
97+
response.setEvents(events);
9498
return response;
9599
}
96100

0 commit comments

Comments
 (0)