Trait InvokerState

Source
pub trait InvokerState: GasState + Sized {
    type TransactArgs;

    // Required methods
    fn new_transact_call(
        runtime: RuntimeState,
        gas_limit: U256,
        data: &[u8],
        access_list: &[(H160, Vec<H256>)],
        args: &Self::TransactArgs,
    ) -> Result<Self, ExitError>;
    fn new_transact_create(
        runtime: RuntimeState,
        gas_limit: U256,
        code: &[u8],
        access_list: &[(H160, Vec<H256>)],
        args: &Self::TransactArgs,
    ) -> Result<Self, ExitError>;
    fn substate(
        &mut self,
        runtime: RuntimeState,
        gas_limit: U256,
        is_static: bool,
        call_has_value: bool,
    ) -> Result<Self, ExitError>;
    fn merge(&mut self, substate: Self, strategy: MergeStrategy);
    fn record_codedeposit(&mut self, len: usize) -> Result<(), ExitError>;
    fn is_static(&self) -> bool;
    fn effective_gas(&self, with_refund: bool) -> U256;
}
Expand description

Trait to be implemented by any state wishing to use crate::standard::Invoker.

Required Associated Types§

Source

type TransactArgs

Type of the transaction argument.

Required Methods§

Source

fn new_transact_call( runtime: RuntimeState, gas_limit: U256, data: &[u8], access_list: &[(H160, Vec<H256>)], args: &Self::TransactArgs, ) -> Result<Self, ExitError>

Create a new state from a call transaction.

Source

fn new_transact_create( runtime: RuntimeState, gas_limit: U256, code: &[u8], access_list: &[(H160, Vec<H256>)], args: &Self::TransactArgs, ) -> Result<Self, ExitError>

Create a new state from a create transaction.

Source

fn substate( &mut self, runtime: RuntimeState, gas_limit: U256, is_static: bool, call_has_value: bool, ) -> Result<Self, ExitError>

Create a substate from the current state.

Source

fn merge(&mut self, substate: Self, strategy: MergeStrategy)

Merge a substate to the current state using the given merge strategy.

Source

fn record_codedeposit(&mut self, len: usize) -> Result<(), ExitError>

Record a code deposit.

Source

fn is_static(&self) -> bool

Whether the current state is in the static frame.

Source

fn effective_gas(&self, with_refund: bool) -> U256

Effective gas. The final used gas as reported by the transaction.

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.

Implementors§

Source§

impl<'config> InvokerState for State<'config>