Package org.web3j.utils
Class RevertReasonExtractor
java.lang.Object
org.web3j.utils.RevertReasonExtractor
Revert reason extraction and retrieval functions.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringextractRevertReason(TransactionReceipt transactionReceipt, String data, Web3j web3j, Boolean revertReasonCallEnabled) Deprecated.static StringextractRevertReason(TransactionReceipt transactionReceipt, String data, Web3j web3j, Boolean revertReasonCallEnabled, BigInteger weiValue) Extracts the error reason of a reverted transaction (if one exists and enabled).static StringretrieveRevertReason(TransactionReceipt transactionReceipt, String data, Web3j web3j) Deprecated.static StringretrieveRevertReason(TransactionReceipt transactionReceipt, String data, Web3j web3j, BigInteger weiValue) Retrieves the error reason of a reverted transaction (if one exists).
-
Field Details
-
MISSING_REASON
- See Also:
-
-
Constructor Details
-
RevertReasonExtractor
public RevertReasonExtractor()
-
-
Method Details
-
extractRevertReason
public static String extractRevertReason(TransactionReceipt transactionReceipt, String data, Web3j web3j, Boolean revertReasonCallEnabled, BigInteger weiValue) throws IOException Extracts the error reason of a reverted transaction (if one exists and enabled).- Parameters:
transactionReceipt- the reverted transaction receiptdata- the reverted transaction dataweb3j- Web3j instancerevertReasonCallEnabled- flag of reason retrieval via additional callweiValue- the value sent in the reverted transaction- Returns:
- the reverted transaction error reason if exists or null otherwise
- Throws:
IOException- if the call to the node fails
-
extractRevertReason
@Deprecated public static String extractRevertReason(TransactionReceipt transactionReceipt, String data, Web3j web3j, Boolean revertReasonCallEnabled) throws IOException Deprecated.Extracts the error reason of a reverted transaction (if one exists and enabled).- Parameters:
transactionReceipt- the reverted transaction receiptdata- the reverted transaction dataweb3j- Web3j instancerevertReasonCallEnabled- flag of reason retrieval via additional call- Returns:
- the reverted transaction error reason if exists or null otherwise
- Throws:
IOException- if the call to the node fails
-
retrieveRevertReason
public static String retrieveRevertReason(TransactionReceipt transactionReceipt, String data, Web3j web3j, BigInteger weiValue) throws IOException Retrieves the error reason of a reverted transaction (if one exists).- Parameters:
transactionReceipt- the reverted transaction receiptdata- the reverted transaction dataweb3j- Web3j instanceweiValue- the value sent in the reverted transaction- Returns:
- the reverted transaction error reason if exists or null otherwise
- Throws:
IOException- if the call to the node fails
-
retrieveRevertReason
@Deprecated public static String retrieveRevertReason(TransactionReceipt transactionReceipt, String data, Web3j web3j) throws IOException Deprecated.Retrieves the error reason of a reverted transaction (if one exists).- Parameters:
transactionReceipt- the reverted transaction receiptdata- the reverted transaction dataweb3j- Web3j instance- Returns:
- the reverted transaction error reason if exists or null otherwise
- Throws:
IOException- if the call to the node fails
-