Interface TrieLog
public interface TrieLog
An interface for interacting with TrieLog objects, which represent changes to accounts, code, and
storage in a blockchain state trie.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceAn interface representing a tuple of prior and updated values for a specific type T in a log. -
Method Summary
Modifier and TypeMethodDescriptionvoidfreeze()Freezes the TrieLog to prevent further modifications.Optional<? extends org.hyperledger.besu.datatypes.AccountValue> getAccount(org.hyperledger.besu.datatypes.Address address) Gets the account value for a specific address, if available.<U extends TrieLog.LogTuple<org.hyperledger.besu.datatypes.AccountValue>>
Map<org.hyperledger.besu.datatypes.Address, U> Gets a map of addresses to their account value changes.org.hyperledger.besu.datatypes.HashGets the block hash associated with this TrieLog.Gets the block number associated with this TrieLog, if available.Optional<org.apache.tuweni.bytes.Bytes> getCode(org.hyperledger.besu.datatypes.Address address) Gets the code for a specific address, if available.<U extends TrieLog.LogTuple<org.apache.tuweni.bytes.Bytes>>
Map<org.hyperledger.besu.datatypes.Address, U> Gets a map of addresses to their code changes.Optional<? extends org.hyperledger.besu.datatypes.AccountValue> getPriorAccount(org.hyperledger.besu.datatypes.Address address) Gets the prior account value for a specific address, if available.Optional<org.apache.tuweni.bytes.Bytes> getPriorCode(org.hyperledger.besu.datatypes.Address address) Gets the prior code for a specific address, if available.Optional<org.apache.tuweni.units.bigints.UInt256> getPriorStorageByStorageSlotKey(org.hyperledger.besu.datatypes.Address address, org.hyperledger.besu.datatypes.StorageSlotKey storageSlotKey) Gets the prior storage value for a specific address and storage slot key, if available.Optional<org.apache.tuweni.units.bigints.UInt256> getStorageByStorageSlotKey(org.hyperledger.besu.datatypes.Address address, org.hyperledger.besu.datatypes.StorageSlotKey storageSlotKey) Gets the storage value for a specific address and storage slot key, if available.<U extends TrieLog.LogTuple<org.apache.tuweni.units.bigints.UInt256>>
Map<org.hyperledger.besu.datatypes.Address, Map<org.hyperledger.besu.datatypes.StorageSlotKey, U>> Gets a map of addresses to their storage changes.<U extends TrieLog.LogTuple<org.apache.tuweni.units.bigints.UInt256>>
Map<org.hyperledger.besu.datatypes.StorageSlotKey, U> getStorageChanges(org.hyperledger.besu.datatypes.Address address) Gets the storage changes for a specific address.
-
Method Details
-
getBlockHash
org.hyperledger.besu.datatypes.Hash getBlockHash()Gets the block hash associated with this TrieLog.- Returns:
- the block hash
-
getBlockNumber
-
freeze
void freeze()Freezes the TrieLog to prevent further modifications. -
getAccountChanges
<U extends TrieLog.LogTuple<org.hyperledger.besu.datatypes.AccountValue>> Map<org.hyperledger.besu.datatypes.Address, U> getAccountChanges()Gets a map of addresses to their account value changes.- Type Parameters:
U- the type of LogTuple representing the account value changes- Returns:
- a map of addresses to their account value changes
-
getCodeChanges
<U extends TrieLog.LogTuple<org.apache.tuweni.bytes.Bytes>> Map<org.hyperledger.besu.datatypes.Address, U> getCodeChanges()Gets a map of addresses to their code changes.- Type Parameters:
U- the type of LogTuple representing the code changes- Returns:
- a map of addresses to their code changes
-
getStorageChanges
<U extends TrieLog.LogTuple<org.apache.tuweni.units.bigints.UInt256>> Map<org.hyperledger.besu.datatypes.Address, Map<org.hyperledger.besu.datatypes.StorageSlotKey, U>> getStorageChanges()Gets a map of addresses to their storage changes.- Type Parameters:
U- the type of LogTuple representing the storage changes- Returns:
- a map of addresses to their storage changes
-
getStorageChanges
<U extends TrieLog.LogTuple<org.apache.tuweni.units.bigints.UInt256>> Map<org.hyperledger.besu.datatypes.StorageSlotKey, U> getStorageChanges(org.hyperledger.besu.datatypes.Address address) Gets the storage changes for a specific address.- Type Parameters:
U- the type of LogTuple representing the storage changes- Parameters:
address- the address to get the storage changes for- Returns:
- a map of storage slot keys to their changes
-
getPriorCode
Optional<org.apache.tuweni.bytes.Bytes> getPriorCode(org.hyperledger.besu.datatypes.Address address) Gets the prior code for a specific address, if available.- Parameters:
address- the address to get the prior code for- Returns:
- an Optional containing the prior code if available, otherwise an empty Optional
-
getCode
Gets the code for a specific address, if available.- Parameters:
address- the address to get the code for- Returns:
- an Optional containing the code if available, otherwise an empty Optional
-
getPriorStorageByStorageSlotKey
Optional<org.apache.tuweni.units.bigints.UInt256> getPriorStorageByStorageSlotKey(org.hyperledger.besu.datatypes.Address address, org.hyperledger.besu.datatypes.StorageSlotKey storageSlotKey) Gets the prior storage value for a specific address and storage slot key, if available.- Parameters:
address- the address to get the prior storage value forstorageSlotKey- the storage slot key to get the prior storage value for- Returns:
- an Optional containing the prior storage value if available, otherwise an empty Optional
-
getStorageByStorageSlotKey
Optional<org.apache.tuweni.units.bigints.UInt256> getStorageByStorageSlotKey(org.hyperledger.besu.datatypes.Address address, org.hyperledger.besu.datatypes.StorageSlotKey storageSlotKey) Gets the storage value for a specific address and storage slot key, if available.- Parameters:
address- the address to get the storage value forstorageSlotKey- the storage slot key to get the storage value for- Returns:
- an Optional containing the storage value if available, otherwise an empty Optional
-
getPriorAccount
Optional<? extends org.hyperledger.besu.datatypes.AccountValue> getPriorAccount(org.hyperledger.besu.datatypes.Address address) Gets the prior account value for a specific address, if available.- Parameters:
address- the address to get the prior account value for- Returns:
- an Optional containing the prior account value if available, otherwise an empty Optional
-
getAccount
Optional<? extends org.hyperledger.besu.datatypes.AccountValue> getAccount(org.hyperledger.besu.datatypes.Address address) Gets the account value for a specific address, if available.- Parameters:
address- the address to get the account value for- Returns:
- an Optional containing the account value if available, otherwise an empty Optional
-