Ethereum webj3,如何正确调用RevertReasonExtractor.extractRevertReason?
使用以太坊,如何获取失败事务的还原原因 我是否需要“启用还原原因调用”?怎么做 我应该将什么值传递到Ethereum webj3,如何正确调用RevertReasonExtractor.extractRevertReason?,ethereum,web3-java,Ethereum,Web3 Java,使用以太坊,如何获取失败事务的还原原因 我是否需要“启用还原原因调用”?怎么做 我应该将什么值传递到数据和已调用的参数中 public call(RemoteFunctionCall call) { try { call.send(); } catch (TransactionException e) { System.out.println("revert reason: " + e.getTransactionReceipt.get.getRe
数据
和已调用的
参数中
public call(RemoteFunctionCall call) {
try {
call.send();
} catch (TransactionException e) {
System.out.println("revert reason: " + e.getTransactionReceipt.get.getRevertReason()); // returns null
String data = ??? // << what value goes here?
Boolean revertReasonCallEnabled = // << what value goes here?
System.out.println("revert reason extracted: " + RevertReasonExtractor.extractRevertReason(receipt, data, web3j, revertReasonCallEnabled))
}
}
但是,对于我的特定远程调用,这将返回null
我尝试过使用revertReasonCallEnabled=true
和revertReasonCallEnabled=false
,但是extractRevertReason
总是返回N/A
String data = e.getTransactionReceipt.get.getRevertReason()