pub trait JournaledState {
type Database: Database;
type FinalOutput;
Show 18 methods
// Required methods
fn warm_account_and_storage(
&mut self,
address: Address,
storage_keys: impl IntoIterator<Item = U256>,
) -> Result<(), <Self::Database as Database>::Error>;
fn warm_account(&mut self, address: Address);
fn set_spec_id(&mut self, spec_id: SpecId);
fn touch_account(&mut self, address: Address);
fn transfer(
&mut self,
from: &Address,
to: &Address,
balance: U256,
) -> Result<Option<TransferError>, <Self::Database as Database>::Error>;
fn inc_account_nonce(
&mut self,
address: Address,
) -> Result<Option<u64>, <Self::Database as Database>::Error>;
fn load_account(
&mut self,
address: Address,
) -> Result<StateLoad<&mut Account>, <Self::Database as Database>::Error>;
fn load_account_code(
&mut self,
address: Address,
) -> Result<StateLoad<&mut Account>, <Self::Database as Database>::Error>;
fn load_account_delegated(
&mut self,
address: Address,
) -> Result<AccountLoad, <Self::Database as Database>::Error>;
fn set_code_with_hash(
&mut self,
address: Address,
code: Bytecode,
hash: B256,
);
fn clear(&mut self);
fn checkpoint(&mut self) -> JournalCheckpoint;
fn checkpoint_commit(&mut self);
fn checkpoint_revert(&mut self, checkpoint: JournalCheckpoint);
fn create_account_checkpoint(
&mut self,
caller: Address,
address: Address,
balance: U256,
spec_id: SpecId,
) -> Result<JournalCheckpoint, TransferError>;
fn depth(&self) -> usize;
fn finalize(
&mut self,
) -> Result<Self::FinalOutput, <Self::Database as Database>::Error>;
// Provided method
fn set_code(&mut self, address: Address, code: Bytecode) { ... }
}
Required Associated Types§
type Database: Database
type FinalOutput
Required Methods§
fn warm_account_and_storage( &mut self, address: Address, storage_keys: impl IntoIterator<Item = U256>, ) -> Result<(), <Self::Database as Database>::Error>
fn warm_account(&mut self, address: Address)
fn set_spec_id(&mut self, spec_id: SpecId)
fn touch_account(&mut self, address: Address)
Sourcefn transfer(
&mut self,
from: &Address,
to: &Address,
balance: U256,
) -> Result<Option<TransferError>, <Self::Database as Database>::Error>
fn transfer( &mut self, from: &Address, to: &Address, balance: U256, ) -> Result<Option<TransferError>, <Self::Database as Database>::Error>
TODO instruction result is not known
fn inc_account_nonce( &mut self, address: Address, ) -> Result<Option<u64>, <Self::Database as Database>::Error>
fn load_account( &mut self, address: Address, ) -> Result<StateLoad<&mut Account>, <Self::Database as Database>::Error>
fn load_account_code( &mut self, address: Address, ) -> Result<StateLoad<&mut Account>, <Self::Database as Database>::Error>
fn load_account_delegated( &mut self, address: Address, ) -> Result<AccountLoad, <Self::Database as Database>::Error>
Sourcefn set_code_with_hash(&mut self, address: Address, code: Bytecode, hash: B256)
fn set_code_with_hash(&mut self, address: Address, code: Bytecode, hash: B256)
Set bytecode with hash. Assume that account is warm.
Sourcefn clear(&mut self)
fn clear(&mut self)
Called at the end of the transaction to clean all residue data from journal.
fn checkpoint(&mut self) -> JournalCheckpoint
fn checkpoint_commit(&mut self)
fn checkpoint_revert(&mut self, checkpoint: JournalCheckpoint)
fn create_account_checkpoint( &mut self, caller: Address, address: Address, balance: U256, spec_id: SpecId, ) -> Result<JournalCheckpoint, TransferError>
fn depth(&self) -> usize
Sourcefn finalize(
&mut self,
) -> Result<Self::FinalOutput, <Self::Database as Database>::Error>
fn finalize( &mut self, ) -> Result<Self::FinalOutput, <Self::Database as Database>::Error>
Does cleanup and returns modified state.
This resets the JournaledState to its initial state.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.