33//! for testing block simulation.
44
55use super :: {
6- db:: TestDb ,
6+ db:: { TestDb , TestStateSource } ,
77 env:: { TestHostEnv , TestRollupEnv , TestSimEnvBuilder } ,
88} ;
99use signet_sim:: { BlockBuild , BuiltBlock , SimCache } ;
@@ -12,7 +12,8 @@ use tokio::time::Instant;
1212use trevm:: revm:: inspector:: NoOpInspector ;
1313
1414/// Test block builder type using in-memory databases.
15- pub type TestBlockBuild = BlockBuild < TestDb , TestDb , NoOpInspector , NoOpInspector > ;
15+ pub type TestBlockBuild =
16+ BlockBuild < TestDb , TestDb , TestStateSource , TestStateSource , NoOpInspector , NoOpInspector > ;
1617
1718/// Builder for creating test `BlockBuild` instances.
1819/// Configures all the parameters needed for block simulation
@@ -110,12 +111,15 @@ impl TestBlockBuildBuilder {
110111 /// This creates a `BlockBuild` ready for simulation.
111112 /// Call `.build().await` on the result to execute the simulation and get a `BuiltBlock`.
112113 pub fn build ( self ) -> TestBlockBuild {
113- let ( rollup_env, host_env) = match ( self . rollup_env , self . host_env ) {
114- ( Some ( rollup) , Some ( host) ) => ( rollup, host) ,
115- _ => {
116- let builder = self . sim_env_builder . unwrap_or_default ( ) ;
117- builder. build ( )
114+ let sim_env_builder = self . sim_env_builder . unwrap_or_default ( ) ;
115+
116+ let ( rollup_env, host_env, ru_source, host_source) = match ( self . rollup_env , self . host_env )
117+ {
118+ ( Some ( rollup) , Some ( host) ) => {
119+ let ( ru_source, host_source) = sim_env_builder. build_state_sources ( ) ;
120+ ( rollup, host, ru_source, host_source)
118121 }
122+ _ => sim_env_builder. build_with_sources ( ) ,
119123 } ;
120124
121125 let finish_by = Instant :: now ( ) + self . deadline_duration ;
@@ -128,6 +132,8 @@ impl TestBlockBuildBuilder {
128132 self . sim_cache ,
129133 self . max_gas ,
130134 self . max_host_gas ,
135+ ru_source,
136+ host_source,
131137 )
132138 }
133139}
0 commit comments