Record Class TransactionSimulationResult
java.lang.Object
java.lang.Record
org.hyperledger.besu.plugin.data.TransactionSimulationResult
- Record Components:
transaction- the simulated transactionresult- the processing result of the simulation
public record TransactionSimulationResult(org.hyperledger.besu.datatypes.Transaction transaction, org.hyperledger.besu.plugin.data.TransactionProcessingResult result)
extends Record
The result of simulating a transaction: the transaction that was run and the outcome of
processing it.
-
Constructor Summary
ConstructorsConstructorDescriptionTransactionSimulationResult(org.hyperledger.besu.datatypes.Transaction transaction, org.hyperledger.besu.plugin.data.TransactionProcessingResult result) Creates an instance of aTransactionSimulationResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.longEstimated gas used by the transactionReturn the optional invalid reasonOptional<org.apache.tuweni.bytes.Bytes> Return the optional revert reasonfinal inthashCode()Returns a hash code value for this object.booleanWas the transaction invalid?booleanWas the simulation successful?org.hyperledger.besu.plugin.data.TransactionProcessingResultresult()Returns the value of theresultrecord component.final StringtoString()Returns a string representation of this record class.org.hyperledger.besu.datatypes.TransactionReturns the value of thetransactionrecord component.
-
Constructor Details
-
TransactionSimulationResult
public TransactionSimulationResult(org.hyperledger.besu.datatypes.Transaction transaction, org.hyperledger.besu.plugin.data.TransactionProcessingResult result) Creates an instance of aTransactionSimulationResultrecord class.- Parameters:
transaction- the value for thetransactionrecord componentresult- the value for theresultrecord component
-
-
Method Details
-
isSuccessful
public boolean isSuccessful()Was the simulation successful?- Returns:
- true if the transaction was processed successfully
-
isInvalid
public boolean isInvalid()Was the transaction invalid?- Returns:
- true if the transaction failed validation and was not executed
-
getRevertReason
Return the optional revert reason- Returns:
- the optional revert reason
-
getInvalidReason
-
getGasEstimate
public long getGasEstimate()Estimated gas used by the transaction- Returns:
- estimated gas used
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
transaction
public org.hyperledger.besu.datatypes.Transaction transaction()Returns the value of thetransactionrecord component.- Returns:
- the value of the
transactionrecord component
-
result
-