Skip to main content

ExecutorStrategyRunner

Trait ExecutorStrategyRunner 

Source
pub trait ExecutorStrategyRunner:
    Debug
    + Send
    + Sync
    + ExecutorStrategyExt {
    // Required methods
    fn new_backend_strategy(
        &self,
        ctx: &dyn ExecutorStrategyContext,
    ) -> BackendStrategy;
    fn new_cheatcodes_strategy(
        &self,
        ctx: &dyn ExecutorStrategyContext,
    ) -> CheatcodesStrategy;
    fn set_balance(
        &self,
        executor: &mut Executor,
        address: Address,
        amount: U256,
    ) -> BackendResult<()>;
    fn get_balance(
        &self,
        executor: &mut Executor,
        address: Address,
    ) -> BackendResult<U256>;
    fn set_nonce(
        &self,
        executor: &mut Executor,
        address: Address,
        nonce: u64,
    ) -> BackendResult<()>;
    fn get_nonce(
        &self,
        executor: &mut Executor,
        address: Address,
    ) -> BackendResult<u64>;
    fn call(
        &self,
        ctx: &dyn ExecutorStrategyContext,
        backend: &mut CowBackend<'_>,
        env: &mut Env,
        executor_env: &Env,
        inspector: &mut InspectorStack,
    ) -> Result<ResultAndState>;
    fn transact(
        &self,
        ctx: &mut dyn ExecutorStrategyContext,
        backend: &mut Backend,
        env: &mut Env,
        executor_env: &Env,
        inspector: &mut InspectorStack,
    ) -> Result<ResultAndState>;
}
Expand description

Stateless strategy runner for ExecutorStrategy.

Required Methods§

Source

fn new_backend_strategy( &self, ctx: &dyn ExecutorStrategyContext, ) -> BackendStrategy

Creates a new BackendStrategy.

Source

fn new_cheatcodes_strategy( &self, ctx: &dyn ExecutorStrategyContext, ) -> CheatcodesStrategy

Creates a new [CheatcodesStrategy].

Source

fn set_balance( &self, executor: &mut Executor, address: Address, amount: U256, ) -> BackendResult<()>

Set the balance of an account.

Source

fn get_balance( &self, executor: &mut Executor, address: Address, ) -> BackendResult<U256>

Gets the balance of an account

Source

fn set_nonce( &self, executor: &mut Executor, address: Address, nonce: u64, ) -> BackendResult<()>

Set the nonce of an account.

Source

fn get_nonce( &self, executor: &mut Executor, address: Address, ) -> BackendResult<u64>

Returns the nonce of an account.

Source

fn call( &self, ctx: &dyn ExecutorStrategyContext, backend: &mut CowBackend<'_>, env: &mut Env, executor_env: &Env, inspector: &mut InspectorStack, ) -> Result<ResultAndState>

Execute a transaction and WITHOUT applying state changes.

Source

fn transact( &self, ctx: &mut dyn ExecutorStrategyContext, backend: &mut Backend, env: &mut Env, executor_env: &Env, inspector: &mut InspectorStack, ) -> Result<ResultAndState>

Execute a transaction and apply state changes.

Implementors§