@@ -32,7 +32,7 @@ use tycho_simulation::{
3232 tycho_client:: feed:: { synchronizer:: StateSyncMessage , BlockHeader , FeedMessage } ,
3333 tycho_common:: {
3434 dto:: { Chain , ProtocolComponent , ResponseProtocolState } ,
35- models:: token:: Token ,
35+ models:: { token:: Token , Chain as ChainModel } ,
3636 Bytes ,
3737 } ,
3838} ;
@@ -63,16 +63,6 @@ static CLONE_TO_BASE_PROTOCOL: LazyLock<HashMap<&str, &str>> = LazyLock::new(||
6363 ] )
6464} ) ;
6565
66- /// Returns the approximate block time in seconds for different chains
67- fn get_chain_block_time ( chain : Chain ) -> u64 {
68- match chain {
69- Chain :: Ethereum => 12 , // ~12 seconds
70- Chain :: Base => 2 , // ~2 seconds
71- Chain :: Unichain => 1 , // ~1 second
72- _ => 12 , // Default fallback to Ethereum timing
73- }
74- }
75-
7666pub enum TestType {
7767 Full ( TestTypeFull ) ,
7868 Range ( TestTypeRange ) ,
@@ -277,7 +267,7 @@ impl TestRunner {
277267 async fn run_live_testing ( & self , config : & IntegrationTestsConfig ) -> miette:: Result < ( ) > {
278268 info ! ( "Starting live testing for protocol {}" , & config. protocol_system) ;
279269
280- let chain = tycho_simulation :: tycho_common :: models :: Chain :: from ( self . chain ) ;
270+ let chain = ChainModel :: from ( self . chain ) ;
281271 // Load tokens for the stream
282272 let all_tokens = tycho_simulation:: utils:: load_all_tokens (
283273 "http://localhost:4242" ,
@@ -396,11 +386,7 @@ impl TestRunner {
396386 execution_data. len( )
397387 ) ;
398388
399- // Step 2: Sleep for block time (chain-specific)
400- tokio:: time:: sleep ( std:: time:: Duration :: from_secs ( self . get_chain_block_time ( ) ) )
401- . await ;
402-
403- // Step 3: Get the actual block from RPC
389+ // Step 2: Get the actual block from RPC
404390 let block = match self
405391 . rpc_provider
406392 . get_block ( BlockNumberOrTag :: Number ( update. block_number_or_timestamp ) )
@@ -422,7 +408,7 @@ impl TestRunner {
422408 execution_data. len( )
423409 ) ;
424410
425- // Step 4 : Execute the batch against the real block
411+ // Step 3 : Execute the batch against the real block
426412 match self
427413 . run_execution (
428414 execution_data,
@@ -1047,8 +1033,7 @@ impl TestRunner {
10471033 ( protocol_system) : EXECUTOR_ADDRESS
10481034 }
10491035 } ) ;
1050- let chain_model =
1051- tycho_simulation:: tycho_common:: models:: Chain :: from ( self . chain ) ;
1036+ let chain_model = ChainModel :: from ( self . chain ) ;
10521037 let ( solution, calldata) = encode_swap (
10531038 component,
10541039 None ,
@@ -1137,7 +1122,7 @@ impl TestRunner {
11371122 return Ok ( ( ) ) ;
11381123 }
11391124
1140- let chain_model = tycho_simulation :: tycho_common :: models :: Chain :: from ( self . chain ) ;
1125+ let chain_model = ChainModel :: from ( self . chain ) ;
11411126 let rpc_tools = RPCTools :: new ( self . rpc_provider . url . as_ref ( ) , & chain_model) . await ?;
11421127
11431128 // Prepare router overwrites data
@@ -1172,7 +1157,6 @@ impl TestRunner {
11721157 & rpc_tools,
11731158 batch. clone ( ) ,
11741159 block,
1175- 0 ,
11761160 router_overwrites_data. clone ( ) ,
11771161 )
11781162 . await ;
@@ -1333,11 +1317,6 @@ impl TestRunner {
13331317 Ok ( None )
13341318 }
13351319 }
1336-
1337- /// Gets the block time for the current chain
1338- fn get_chain_block_time ( & self ) -> u64 {
1339- get_chain_block_time ( self . chain )
1340- }
13411320}
13421321
13431322#[ cfg( test) ]
0 commit comments