MemoryStackState

Struct MemoryStackState 

Source
pub struct MemoryStackState<'backend, 'config, B> { /* private fields */ }

Implementations§

Source§

impl<'backend, 'config, B: Backend> MemoryStackState<'backend, 'config, B>

Source

pub const fn new( metadata: StackSubstateMetadata<'config>, backend: &'backend B, ) -> Self

Source

pub fn account_mut(&mut self, address: H160) -> &mut MemoryStackAccount

Returns a mutable reference to an account given its address

Source

pub fn deconstruct( self, ) -> (impl IntoIterator<Item = Apply<impl IntoIterator<Item = (H256, H256)>>>, impl IntoIterator<Item = Log>)

Source

pub fn withdraw(&mut self, address: H160, value: U256) -> Result<(), ExitError>

§Errors

Return ExitError

Source

pub fn deposit(&mut self, address: H160, value: U256)

Trait Implementations§

Source§

impl<B: Backend> Backend for MemoryStackState<'_, '_, B>

Source§

fn gas_price(&self) -> U256

Gas price. Unused for London.
Source§

fn origin(&self) -> H160

Origin.
Source§

fn block_hash(&self, number: U256) -> H256

Environmental block hash.
Source§

fn block_number(&self) -> U256

Environmental block number.
Source§

fn block_coinbase(&self) -> H160

Environmental coinbase.
Source§

fn block_timestamp(&self) -> U256

Environmental block timestamp.
Source§

fn block_difficulty(&self) -> U256

Environmental block difficulty.
Source§

fn block_randomness(&self) -> Option<H256>

Get environmental block randomness.
Source§

fn block_gas_limit(&self) -> U256

Environmental block gas limit.
Source§

fn block_base_fee_per_gas(&self) -> U256

Environmental block base fee.
Source§

fn chain_id(&self) -> U256

Environmental chain ID.
Source§

fn exists(&self, address: H160) -> bool

Whether account at address exists.
Source§

fn basic(&self, address: H160) -> Basic

Get basic account information.
Source§

fn code(&self, address: H160) -> Vec<u8>

Get account code.
Source§

fn storage(&self, address: H160, key: H256) -> H256

Get storage value of address at index.
Source§

fn is_empty_storage(&self, address: H160) -> bool

Check if the storage of the address is empty.
Source§

fn original_storage(&self, address: H160, key: H256) -> Option<H256>

Get original storage value of address at index, if available.
Source§

fn blob_gas_price(&self) -> Option<u128>

CANCUN hard fork [EIP-4844]: Shard Blob Transactions [EIP-7516]: BLOBBASEFEE instruction
Source§

fn get_blob_hash(&self, index: usize) -> Option<U256>

Get blob_hash from blob_versioned_hashes by index [EIP-4844]: BLOBHASH - https://eips.ethereum.org/EIPS/eip-4844#opcode-to-get-versioned-hashes
Source§

impl<'backend, 'config, B: Clone> Clone for MemoryStackState<'backend, 'config, B>

Source§

fn clone(&self) -> MemoryStackState<'backend, 'config, B>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'backend, 'config, B: Debug> Debug for MemoryStackState<'backend, 'config, B>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'config, B: Backend> StackState<'config> for MemoryStackState<'_, 'config, B>

Source§

fn is_authority_cold(&mut self, address: H160) -> Option<bool>

EIP-7702 - check is authority cold.

Source§

fn get_authority_target(&mut self, authority: H160) -> Option<H160>

Get authority target (EIP-7702) - delegated address. First we’re trying to get authority target from the cache recursively with parent state, if it’s not found we get code for the authority address and check if it’s delegation designator. If it’s true, we add result to cache and return delegated target address.

Source§

fn metadata(&self) -> &StackSubstateMetadata<'config>

Source§

fn metadata_mut(&mut self) -> &mut StackSubstateMetadata<'config>

Source§

fn enter(&mut self, gas_limit: u64, is_static: bool)

Source§

fn exit_commit(&mut self) -> Result<(), ExitError>

Errors Read more
Source§

fn exit_revert(&mut self) -> Result<(), ExitError>

Errors Read more
Source§

fn exit_discard(&mut self) -> Result<(), ExitError>

Errors Read more
Source§

fn is_empty(&self, address: H160) -> bool

Source§

fn deleted(&self, address: H160) -> bool

Source§

fn is_cold(&self, address: H160) -> bool

Source§

fn is_storage_cold(&self, address: H160, key: H256) -> bool

Source§

fn inc_nonce(&mut self, address: H160) -> Result<(), ExitError>

Errors Read more
Source§

fn set_storage(&mut self, address: H160, key: H256, value: H256)

Source§

fn reset_storage(&mut self, address: H160)

Source§

fn log(&mut self, address: H160, topics: Vec<H256>, data: Vec<u8>)

Source§

fn set_deleted(&mut self, address: H160)

Source§

fn set_created(&mut self, address: H160)

Source§

fn is_created(&self, address: H160) -> bool

Source§

fn set_code(&mut self, address: H160, code: Vec<u8>)

Source§

fn transfer(&mut self, transfer: Transfer) -> Result<(), ExitError>

Errors Read more
Source§

fn reset_balance(&mut self, address: H160)

Source§

fn touch(&mut self, address: H160)

Source§

fn tload(&mut self, address: H160, index: H256) -> Result<U256, ExitError>

Get tstorage value of address at index. EIP-1153: Transient storage Read more
Source§

fn tstore( &mut self, address: H160, index: H256, value: U256, ) -> Result<(), ExitError>

Set tstorage value of address at index. EIP-1153: Transient storage Read more
Source§

fn record_external_operation( &mut self, _op: ExternalOperation, ) -> Result<(), ExitError>

Errors Read more
Source§

fn record_external_dynamic_opcode_cost( &mut self, _opcode: Opcode, _gas_cost: GasCost, _target: StorageTarget, ) -> Result<(), ExitError>

Errors Read more
Source§

fn record_external_cost( &mut self, _ref_time: Option<u64>, _proof_size: Option<u64>, _storage_growth: Option<u64>, ) -> Result<(), ExitError>

Errors Read more
Source§

fn refund_external_cost( &mut self, _ref_time: Option<u64>, _proof_size: Option<u64>, )

Auto Trait Implementations§

§

impl<'backend, 'config, B> Freeze for MemoryStackState<'backend, 'config, B>

§

impl<'backend, 'config, B> RefUnwindSafe for MemoryStackState<'backend, 'config, B>
where B: RefUnwindSafe,

§

impl<'backend, 'config, B> Send for MemoryStackState<'backend, 'config, B>
where B: Sync,

§

impl<'backend, 'config, B> Sync for MemoryStackState<'backend, 'config, B>
where B: Sync,

§

impl<'backend, 'config, B> Unpin for MemoryStackState<'backend, 'config, B>

§

impl<'backend, 'config, B> UnwindSafe for MemoryStackState<'backend, 'config, B>
where B: RefUnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V