Trait CheatcodeInspectorStrategyRunner
pub trait CheatcodeInspectorStrategyRunner:
Debug
+ Send
+ Sync
+ CheatcodeInspectorStrategyExt {
// Required methods
fn record_broadcastable_create_transactions(
&self,
_ctx: &mut (dyn CheatcodeInspectorStrategyContext + 'static),
config: Arc<CheatsConfig>,
input: &dyn CommonCreateInput,
ecx: &mut Context<BlockEnv, TxEnv, CfgEnv, &mut dyn DatabaseExt<Error = DatabaseError>>,
broadcast: &Broadcast,
broadcastable_transactions: &mut VecDeque<BroadcastableTransaction>,
);
fn record_broadcastable_call_transactions(
&self,
_ctx: &mut (dyn CheatcodeInspectorStrategyContext + 'static),
_config: Arc<CheatsConfig>,
input: &CallInputs,
ecx: &mut Context<BlockEnv, TxEnv, CfgEnv, &mut dyn DatabaseExt<Error = DatabaseError>>,
broadcast: &Broadcast,
broadcastable_transactions: &mut VecDeque<BroadcastableTransaction>,
active_delegations: Vec<SignedAuthorization>,
active_blob_sidecar: Option<BlobTransactionSidecar>,
);
// Provided methods
fn apply_full(
&self,
cheatcode: &(dyn DynCheatcode + 'static),
ccx: &mut CheatsCtxt<'_, '_, '_, '_>,
executor: &mut dyn CheatcodesExecutor,
) -> Result<Vec<u8>, Error> { ... }
fn base_contract_deployed(
&self,
_ctx: &mut (dyn CheatcodeInspectorStrategyContext + 'static),
) { ... }
fn pre_initialize_interp(
&self,
_ctx: &mut (dyn CheatcodeInspectorStrategyContext + 'static),
_interpreter: &mut Interpreter,
_ecx: &mut Context<BlockEnv, TxEnv, CfgEnv, &mut dyn DatabaseExt<Error = DatabaseError>>,
) { ... }
fn post_initialize_interp(
&self,
_ctx: &mut (dyn CheatcodeInspectorStrategyContext + 'static),
_interpreter: &mut Interpreter,
_ecx: &mut Context<BlockEnv, TxEnv, CfgEnv, &mut dyn DatabaseExt<Error = DatabaseError>>,
) { ... }
fn pre_step_end(
&self,
_ctx: &mut (dyn CheatcodeInspectorStrategyContext + 'static),
_interpreter: &mut Interpreter,
_ecx: &mut Context<BlockEnv, TxEnv, CfgEnv, &mut dyn DatabaseExt<Error = DatabaseError>>,
) -> bool { ... }
}Expand description
Stateless strategy runner for CheatcodeInspectorStrategy.
Required Methods§
fn record_broadcastable_create_transactions(
&self,
_ctx: &mut (dyn CheatcodeInspectorStrategyContext + 'static),
config: Arc<CheatsConfig>,
input: &dyn CommonCreateInput,
ecx: &mut Context<BlockEnv, TxEnv, CfgEnv, &mut dyn DatabaseExt<Error = DatabaseError>>,
broadcast: &Broadcast,
broadcastable_transactions: &mut VecDeque<BroadcastableTransaction>,
)
fn record_broadcastable_create_transactions( &self, _ctx: &mut (dyn CheatcodeInspectorStrategyContext + 'static), config: Arc<CheatsConfig>, input: &dyn CommonCreateInput, ecx: &mut Context<BlockEnv, TxEnv, CfgEnv, &mut dyn DatabaseExt<Error = DatabaseError>>, broadcast: &Broadcast, broadcastable_transactions: &mut VecDeque<BroadcastableTransaction>, )
Record broadcastable transaction during CREATE.
fn record_broadcastable_call_transactions(
&self,
_ctx: &mut (dyn CheatcodeInspectorStrategyContext + 'static),
_config: Arc<CheatsConfig>,
input: &CallInputs,
ecx: &mut Context<BlockEnv, TxEnv, CfgEnv, &mut dyn DatabaseExt<Error = DatabaseError>>,
broadcast: &Broadcast,
broadcastable_transactions: &mut VecDeque<BroadcastableTransaction>,
active_delegations: Vec<SignedAuthorization>,
active_blob_sidecar: Option<BlobTransactionSidecar>,
)
fn record_broadcastable_call_transactions( &self, _ctx: &mut (dyn CheatcodeInspectorStrategyContext + 'static), _config: Arc<CheatsConfig>, input: &CallInputs, ecx: &mut Context<BlockEnv, TxEnv, CfgEnv, &mut dyn DatabaseExt<Error = DatabaseError>>, broadcast: &Broadcast, broadcastable_transactions: &mut VecDeque<BroadcastableTransaction>, active_delegations: Vec<SignedAuthorization>, active_blob_sidecar: Option<BlobTransactionSidecar>, )
Record broadcastable transaction during CALL.
Provided Methods§
fn apply_full(
&self,
cheatcode: &(dyn DynCheatcode + 'static),
ccx: &mut CheatsCtxt<'_, '_, '_, '_>,
executor: &mut dyn CheatcodesExecutor,
) -> Result<Vec<u8>, Error>
fn apply_full( &self, cheatcode: &(dyn DynCheatcode + 'static), ccx: &mut CheatsCtxt<'_, '_, '_, '_>, executor: &mut dyn CheatcodesExecutor, ) -> Result<Vec<u8>, Error>
Apply cheatcodes.
fn base_contract_deployed(
&self,
_ctx: &mut (dyn CheatcodeInspectorStrategyContext + 'static),
)
fn base_contract_deployed( &self, _ctx: &mut (dyn CheatcodeInspectorStrategyContext + 'static), )
Called when the main test or script contract is deployed.
fn pre_initialize_interp(
&self,
_ctx: &mut (dyn CheatcodeInspectorStrategyContext + 'static),
_interpreter: &mut Interpreter,
_ecx: &mut Context<BlockEnv, TxEnv, CfgEnv, &mut dyn DatabaseExt<Error = DatabaseError>>,
)
fn pre_initialize_interp( &self, _ctx: &mut (dyn CheatcodeInspectorStrategyContext + 'static), _interpreter: &mut Interpreter, _ecx: &mut Context<BlockEnv, TxEnv, CfgEnv, &mut dyn DatabaseExt<Error = DatabaseError>>, )
Hook for pre initialize_interp.
fn post_initialize_interp(
&self,
_ctx: &mut (dyn CheatcodeInspectorStrategyContext + 'static),
_interpreter: &mut Interpreter,
_ecx: &mut Context<BlockEnv, TxEnv, CfgEnv, &mut dyn DatabaseExt<Error = DatabaseError>>,
)
fn post_initialize_interp( &self, _ctx: &mut (dyn CheatcodeInspectorStrategyContext + 'static), _interpreter: &mut Interpreter, _ecx: &mut Context<BlockEnv, TxEnv, CfgEnv, &mut dyn DatabaseExt<Error = DatabaseError>>, )
Hook for post initialize_interp.
fn pre_step_end(
&self,
_ctx: &mut (dyn CheatcodeInspectorStrategyContext + 'static),
_interpreter: &mut Interpreter,
_ecx: &mut Context<BlockEnv, TxEnv, CfgEnv, &mut dyn DatabaseExt<Error = DatabaseError>>,
) -> bool
fn pre_step_end( &self, _ctx: &mut (dyn CheatcodeInspectorStrategyContext + 'static), _interpreter: &mut Interpreter, _ecx: &mut Context<BlockEnv, TxEnv, CfgEnv, &mut dyn DatabaseExt<Error = DatabaseError>>, ) -> bool
Hook for pre step_end.
Used to override opcode behaviors. Returns true if handled.