Record Class EvmSnapshot
java.lang.Object
java.lang.Record
net.finmath.smartcontracts.representablestate.cache.EvmSnapshot
- Record Components:
chainId- EIP-155 chain identifier reported by the RPC provider.blockNumber- Non-negative numeric block number.blockHash- Canonical 32-byte block hash at the time the snapshot was resolved.
public record EvmSnapshot(BigInteger chainId, BigInteger blockNumber, String blockHash)
extends Record
Identifies one block on one fork of an EVM chain.
The block hash is part of the identity so a cache entry produced before a chain reorganization cannot be reused for a different block at the same height.
-
Constructor Summary
ConstructorsConstructorDescriptionEvmSnapshot(BigInteger chainId, BigInteger blockNumber, String blockHash) Creates an instance of aEvmSnapshotrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theblockHashrecord component.Returns the value of theblockNumberrecord component.chainId()Returns the value of thechainIdrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
EvmSnapshot
Creates an instance of aEvmSnapshotrecord class.- Parameters:
chainId- the value for thechainIdrecord componentblockNumber- the value for theblockNumberrecord componentblockHash- the value for theblockHashrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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). -
chainId
Returns the value of thechainIdrecord component.- Returns:
- the value of the
chainIdrecord component
-
blockNumber
Returns the value of theblockNumberrecord component.- Returns:
- the value of the
blockNumberrecord component
-
blockHash
Returns the value of theblockHashrecord component.- Returns:
- the value of the
blockHashrecord component
-