Struct pallet_evm::runner::stack::SubstrateStackState
source · pub struct SubstrateStackState<'vicinity, 'config, T> { /* private fields */ }
Expand description
Substrate backend for EVM.
Implementations§
source§impl<'vicinity, 'config, T: Config> SubstrateStackState<'vicinity, 'config, T>
impl<'vicinity, 'config, T: Config> SubstrateStackState<'vicinity, 'config, T>
sourcepub fn new(
vicinity: &'vicinity Vicinity,
metadata: StackSubstateMetadata<'config>,
weight_info: Option<WeightInfo>
) -> Self
pub fn new( vicinity: &'vicinity Vicinity, metadata: StackSubstateMetadata<'config>, weight_info: Option<WeightInfo> ) -> Self
Create a new backend with given vicinity.
pub fn weight_info(&self) -> Option<WeightInfo>
pub fn recorded(&self) -> &Recorded
pub fn info_mut(&mut self) -> (&mut Option<WeightInfo>, &mut Recorded)
Trait Implementations§
source§impl<'vicinity, 'config, T: Config> Backend for SubstrateStackState<'vicinity, 'config, T>
impl<'vicinity, 'config, T: Config> Backend for SubstrateStackState<'vicinity, 'config, T>
source§fn block_hash(&self, number: U256) -> H256
fn block_hash(&self, number: U256) -> H256
Environmental block hash.
source§fn block_number(&self) -> U256
fn block_number(&self) -> U256
Environmental block number.
source§fn block_coinbase(&self) -> H160
fn block_coinbase(&self) -> H160
Environmental coinbase.
source§fn block_timestamp(&self) -> U256
fn block_timestamp(&self) -> U256
Environmental block timestamp.
source§fn block_difficulty(&self) -> U256
fn block_difficulty(&self) -> U256
Environmental block difficulty.
source§fn block_randomness(&self) -> Option<H256>
fn block_randomness(&self) -> Option<H256>
Get environmental block randomness.
source§fn block_gas_limit(&self) -> U256
fn block_gas_limit(&self) -> U256
Environmental block gas limit.
source§fn block_base_fee_per_gas(&self) -> U256
fn block_base_fee_per_gas(&self) -> U256
Environmental block base fee.
source§fn original_storage(&self, address: H160, index: H256) -> Option<H256>
fn original_storage(&self, address: H160, index: H256) -> Option<H256>
Get original storage value of address at index, if available.
source§impl<'vicinity, 'config, T: Config> StackState<'config> for SubstrateStackState<'vicinity, 'config, T>
impl<'vicinity, 'config, T: Config> StackState<'config> for SubstrateStackState<'vicinity, 'config, T>
fn metadata(&self) -> &StackSubstateMetadata<'config>
fn metadata_mut(&mut self) -> &mut StackSubstateMetadata<'config>
fn enter(&mut self, gas_limit: u64, is_static: bool)
fn exit_commit(&mut self) -> Result<(), ExitError>
fn exit_revert(&mut self) -> Result<(), ExitError>
fn exit_discard(&mut self) -> Result<(), ExitError>
fn is_empty(&self, address: H160) -> bool
fn deleted(&self, address: H160) -> bool
fn inc_nonce(&mut self, address: H160) -> Result<(), ExitError>
fn set_storage(&mut self, address: H160, index: H256, value: H256)
fn reset_storage(&mut self, address: H160)
fn log(&mut self, address: H160, topics: Vec<H256>, data: Vec<u8>)
fn set_deleted(&mut self, address: H160)
fn set_code(&mut self, address: H160, code: Vec<u8>)
fn transfer(&mut self, transfer: Transfer) -> Result<(), ExitError>
fn reset_balance(&mut self, _address: H160)
fn touch(&mut self, _address: H160)
fn is_cold(&self, address: H160) -> bool
fn is_storage_cold(&self, address: H160, key: H256) -> bool
source§fn code_size(&self, address: H160) -> U256
fn code_size(&self, address: H160) -> U256
Fetch the code size of an address.
Provide a default implementation by fetching the code, but
can be customized to use a more performant approach that don’t need to
fetch the code.
source§fn code_hash(&self, address: H160) -> H256
fn code_hash(&self, address: H160) -> H256
Fetch the code hash of an address.
Provide a default implementation by fetching the code, but
can be customized to use a more performant approach that don’t need to
fetch the code.
fn record_external_operation( &mut self, op: ExternalOperation ) -> Result<(), ExitError>
fn record_external_dynamic_opcode_cost( &mut self, opcode: Opcode, _gas_cost: GasCost, target: StorageTarget ) -> Result<(), ExitError>
fn record_external_cost( &mut self, ref_time: Option<u64>, proof_size: Option<u64>, _storage_growth: Option<u64> ) -> Result<(), ExitError>
fn refund_external_cost( &mut self, ref_time: Option<u64>, proof_size: Option<u64> )
Auto Trait Implementations§
impl<'vicinity, 'config, T> RefUnwindSafe for SubstrateStackState<'vicinity, 'config, T>where
T: RefUnwindSafe,
impl<'vicinity, 'config, T> Send for SubstrateStackState<'vicinity, 'config, T>where
T: Send,
impl<'vicinity, 'config, T> Sync for SubstrateStackState<'vicinity, 'config, T>where
T: Sync,
impl<'vicinity, 'config, T> Unpin for SubstrateStackState<'vicinity, 'config, T>where
T: Unpin,
impl<'vicinity, 'config, T> UnwindSafe for SubstrateStackState<'vicinity, 'config, T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
§fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
§fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IsType<T> for T
impl<T> IsType<T> for T
§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
Consume self to return an equivalent value of
T
. Read more§impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
type Error = <U as TryFromKey<T>>::Error
fn try_into_key(self) -> Result<U, <U as TryFromKey<T>>::Error>
§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to
unchecked_from
.§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of
T
.