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§
Sourcetype TransactArgs
type TransactArgs
Type of the transaction argument.
Required Methods§
Sourcefn new_transact_call(
runtime: RuntimeState,
gas_limit: U256,
data: &[u8],
access_list: &[(H160, Vec<H256>)],
args: &Self::TransactArgs,
) -> Result<Self, ExitError>
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.
Sourcefn new_transact_create(
runtime: RuntimeState,
gas_limit: U256,
code: &[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>
Create a new state from a create transaction.
Sourcefn substate(
&mut self,
runtime: RuntimeState,
gas_limit: U256,
is_static: bool,
call_has_value: bool,
) -> Result<Self, ExitError>
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.
Sourcefn merge(&mut self, substate: Self, strategy: MergeStrategy)
fn merge(&mut self, substate: Self, strategy: MergeStrategy)
Merge a substate to the current state using the given merge strategy.
Sourcefn effective_gas(&self, with_refund: bool) -> U256
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.