MemoryStackState

Struct MemoryStackState 

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

Implementations§

Source§

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

Source

pub fn new(metadata: StackSubstateMetadata, 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>

Source

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

Trait Implementations§

Source§

impl<'backend, B: Backend> Backend for MemoryStackState<'backend, 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_gas_limit(&self) -> U256

Environmental block gas limit.
Source§

fn block_base_fee_per_gas(&self) -> U256

Environmental block base fee.
Source§

fn gas_left(&self) -> U256

Ges left
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 original_storage(&self, address: H160, key: H256) -> Option<H256>

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

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

Source§

fn clone(&self) -> MemoryStackState<'backend, 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, B: Debug> Debug for MemoryStackState<'backend, B>

Source§

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

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

impl<'backend, B: Backend> StackState for MemoryStackState<'backend, B>

Source§

fn metadata(&self) -> &StackSubstateMetadata

Source§

fn metadata_mut(&mut self) -> &mut StackSubstateMetadata

Source§

fn enter(&mut self, is_static: bool)

Source§

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

Source§

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

Source§

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

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)

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_code(&mut self, address: H160, code: Vec<u8>)

Source§

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

Source§

fn reset_balance(&mut self, address: H160)

Source§

fn touch(&mut self, address: H160)

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

impl<'backend, B> UnwindSafe for MemoryStackState<'backend, 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<T> MaybeDebug for T