pub trait State {
type Error: StdError;
// Required methods
fn basic(
&mut self,
address: Address,
) -> Result<Option<AccountInfo>, Self::Error>;
fn code_by_hash(&mut self, code_hash: B256) -> Result<Bytecode, Self::Error>;
fn storage(
&mut self,
address: Address,
index: StorageKey,
) -> Result<StorageValue, Self::Error>;
}
Expand description
Trait for mutable access to state data including accounts, code, and storage. This is typically used for database implementations that may modify state or need mutable access for caching purposes.
Required Associated Types§
Required Methods§
Sourcefn basic(
&mut self,
address: Address,
) -> Result<Option<AccountInfo>, Self::Error>
fn basic( &mut self, address: Address, ) -> Result<Option<AccountInfo>, Self::Error>
Gets basic account information.
Sourcefn code_by_hash(&mut self, code_hash: B256) -> Result<Bytecode, Self::Error>
fn code_by_hash(&mut self, code_hash: B256) -> Result<Bytecode, Self::Error>
Gets account code by its hash.
Sourcefn storage(
&mut self,
address: Address,
index: StorageKey,
) -> Result<StorageValue, Self::Error>
fn storage( &mut self, address: Address, index: StorageKey, ) -> Result<StorageValue, Self::Error>
Gets storage value of address at index.