revive_strategy/executor/
context.rs1use foundry_compilers::{
2 ProjectCompileOutput, resolc::dual_compiled_contracts::DualCompiledContracts,
3};
4use foundry_evm::executors::ExecutorStrategyContext;
5
6use crate::{ReviveRuntimeMode, state::TestEnv};
7
8#[derive(Debug, Default, Clone)]
10pub struct ReviveExecutorStrategyContext {
11 pub(crate) runtime_mode: ReviveRuntimeMode,
13 pub(crate) dual_compiled_contracts: DualCompiledContracts,
15 pub(crate) compilation_output: Option<ProjectCompileOutput>,
17 pub(crate) externalties: TestEnv,
18}
19
20impl ReviveExecutorStrategyContext {
21 pub fn new(runtime_mode: ReviveRuntimeMode) -> Self {
22 Self { runtime_mode, ..Default::default() }
23 }
24}
25
26impl ExecutorStrategyContext for ReviveExecutorStrategyContext {
27 fn new_cloned(&self) -> Box<dyn ExecutorStrategyContext> {
28 Box::new(self.clone())
29 }
30
31 fn as_any_ref(&self) -> &dyn std::any::Any {
32 self
33 }
34
35 fn as_any_mut(&mut self) -> &mut dyn std::any::Any {
36 self
37 }
38}