MemoryStackSubstate

Struct MemoryStackSubstate 

Source
pub struct MemoryStackSubstate<'config> { /* private fields */ }

Implementations§

Source§

impl<'config> MemoryStackSubstate<'config>

Source

pub const fn new(metadata: StackSubstateMetadata<'config>) -> Self

Source

pub fn logs(&self) -> &[Log]

Source

pub const fn logs_mut(&mut self) -> &mut Vec<Log>

Source

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

Source

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

Source

pub fn deconstruct<B: Backend>( self, backend: &B, ) -> (impl IntoIterator<Item = Apply<impl IntoIterator<Item = (H256, H256)>>>, impl IntoIterator<Item = Log>)

Deconstruct the memory stack substate, return state to be applied. Panic if the substate is not in the top-level substate.

§Panics

Panic if parent presents

Source

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

Source

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

Exit commit represent successful execution of the substate.

It includes:

  • swallow commit
    • gas recording
    • warmed accesses merging
  • logs merging
  • for account existed from substate with reset flag, remove storages by keys
  • merge substate data: accounts, storages, tstorages, deletes, creates
§Errors

Return ExitError that is thrown by gasometer gas calculation errors.

§Panics

Cannot commit on root substate i.e. it forces to panic.

Source

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

Exit revert. Represents revert execution of the substate.

§Errors

Return ExitError

§Panics

Cannot discard on root substate

Source

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

Exit discard. Represents discard execution of the substate.

§Errors

Return ExitError. At the momoet it’s not throwing any real error.

§Panics

Cannot discard on root substate

Source

pub fn known_account(&self, address: H160) -> Option<&MemoryStackAccount>

Source

pub fn known_basic(&self, address: H160) -> Option<Basic>

Source

pub fn known_code(&self, address: H160) -> Option<Vec<u8>>

Source

pub fn known_empty(&self, address: H160) -> Option<bool>

Source

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

Source

pub fn known_original_storage(&self, address: H160) -> Option<H256>

Source

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

Source

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

Source

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

Source

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

§Errors

Return ExitError

Source

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

Source

pub fn reset_storage<B: Backend>(&mut self, address: H160, backend: &B)

Source

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

Source

pub fn set_deleted(&mut self, address: H160)

Source

pub fn set_created(&mut self, address: H160)

Source

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

Source

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

Source

pub fn transfer<B: Backend>( &mut self, transfer: &Transfer, backend: &B, ) -> Result<(), ExitError>

§Errors

Return ExitError

Source

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

Only needed for jsontests.

§Errors

Return ExitError

Source

pub fn deposit<B: Backend>(&mut self, address: H160, value: U256, backend: &B)

Source

pub fn reset_balance<B: Backend>(&mut self, address: H160, backend: &B)

Source

pub fn touch<B: Backend>(&mut self, address: H160, backend: &B)

Source

pub fn get_tstorage(&self, address: H160, key: H256) -> U256

Source

pub fn known_tstorage(&self, address: H160, key: H256) -> Option<U256>

Source

pub fn set_tstorage(&mut self, address: H160, key: H256, value: U256)

Trait Implementations§

Source§

impl<'config> Clone for MemoryStackSubstate<'config>

Source§

fn clone(&self) -> MemoryStackSubstate<'config>

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<'config> Debug for MemoryStackSubstate<'config>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'config> Freeze for MemoryStackSubstate<'config>

§

impl<'config> RefUnwindSafe for MemoryStackSubstate<'config>

§

impl<'config> Send for MemoryStackSubstate<'config>

§

impl<'config> Sync for MemoryStackSubstate<'config>

§

impl<'config> Unpin for MemoryStackSubstate<'config>

§

impl<'config> UnwindSafe for MemoryStackSubstate<'config>

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