Class RevertReasonExtractor

java.lang.Object
org.web3j.utils.RevertReasonExtractor

public class RevertReasonExtractor extends Object
Revert reason extraction and retrieval functions.
  • Field Details

  • 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 receipt
      data - the reverted transaction data
      web3j - Web3j instance
      revertReasonCallEnabled - flag of reason retrieval via additional call
      weiValue - 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 receipt
      data - the reverted transaction data
      web3j - Web3j instance
      revertReasonCallEnabled - 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 receipt
      data - the reverted transaction data
      web3j - Web3j instance
      weiValue - 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 receipt
      data - the reverted transaction data
      web3j - Web3j instance
      Returns:
      the reverted transaction error reason if exists or null otherwise
      Throws:
      IOException - if the call to the node fails