diff --git a/crates/optimism/payload/Cargo.toml b/crates/optimism/payload/Cargo.toml index b73dcfc5926f..8873da14605e 100644 --- a/crates/optimism/payload/Cargo.toml +++ b/crates/optimism/payload/Cargo.toml @@ -60,4 +60,4 @@ optimism = [ "reth-execution-types/optimism", "reth-optimism-consensus/optimism" ] -scroll = [] +scroll = [] \ No newline at end of file diff --git a/crates/scroll/execution/Cargo.toml b/crates/scroll/execution/Cargo.toml index 7900e82e258c..6abb7d1cd7f6 100644 --- a/crates/scroll/execution/Cargo.toml +++ b/crates/scroll/execution/Cargo.toml @@ -29,3 +29,7 @@ scroll = [ "reth-scroll-revm/scroll", "reth-scroll-storage/scroll", ] +test-utils = [ + "reth-scroll-revm/test-utils", + "reth-revm/test-utils" +] \ No newline at end of file diff --git a/crates/scroll/execution/src/context.rs b/crates/scroll/execution/src/context.rs index c3109922698f..6ddd47dc531f 100644 --- a/crates/scroll/execution/src/context.rs +++ b/crates/scroll/execution/src/context.rs @@ -1,5 +1,6 @@ -use reth_revm::{database::StateProviderDatabase, db::CacheDB, Database, State}; -use std::sync::LazyLock; +#[cfg(feature = "test-utils")] +use reth_revm::{database::StateProviderDatabase, db::CacheDB}; +use reth_revm::{Database, State}; /// Finalize the execution of the type and return the output pub trait FinalizeExecution { @@ -34,7 +35,6 @@ pub trait WithContext { type ExecutionContext = (); #[cfg(feature = "scroll")] type ExecutionContext = reth_scroll_primitives::ScrollPostExecutionContext; -static DEFAULT_CONTEXT: LazyLock = LazyLock::new(Default::default); #[cfg(feature = "scroll")] impl WithContext for reth_scroll_storage::ScrollStateProviderDatabase { @@ -45,7 +45,12 @@ impl WithContext for reth_scroll_storage::ScrollStateProviderDatabase { } } -impl WithContext for CacheDB { +#[cfg(feature = "test-utils")] +static DEFAULT_CONTEXT: std::sync::LazyLock = + std::sync::LazyLock::new(Default::default); + +#[cfg(feature = "test-utils")] +impl WithContext for StateProviderDatabase { type Context = ExecutionContext; fn context(&self) -> &Self::Context { @@ -53,7 +58,8 @@ impl WithContext for CacheDB { } } -impl WithContext for StateProviderDatabase { +#[cfg(feature = "test-utils")] +impl WithContext for CacheDB { type Context = ExecutionContext; fn context(&self) -> &Self::Context {