diff --git a/protocol-testing/src/config.rs b/protocol-testing/src/config.rs index f5338b9..1fe6464 100644 --- a/protocol-testing/src/config.rs +++ b/protocol-testing/src/config.rs @@ -143,5 +143,6 @@ pub struct IntegrationTestsConfig { pub skip_balance_check: bool, pub protocol_type_names: Vec, pub protocol_system: String, + pub module_name: String, pub tests: Vec, } diff --git a/protocol-testing/src/test_runner.rs b/protocol-testing/src/test_runner.rs index 6963e84..c5c0c83 100644 --- a/protocol-testing/src/test_runner.rs +++ b/protocol-testing/src/test_runner.rs @@ -225,6 +225,7 @@ impl TestRunner { test.stop_block, &config.protocol_type_names, &config.protocol_system, + &config.module_name, ) .wrap_err("Failed to run Tycho")?; diff --git a/protocol-testing/src/tycho_runner.rs b/protocol-testing/src/tycho_runner.rs index ef46473..0c80755 100644 --- a/protocol-testing/src/tycho_runner.rs +++ b/protocol-testing/src/tycho_runner.rs @@ -30,6 +30,7 @@ impl TychoRunner { end_block: u64, protocol_type_names: &[String], protocol_system: &str, + module_name: &str, ) -> miette::Result<()> { info!("Running Tycho indexer from block {start_block} to {end_block}..."); @@ -39,14 +40,6 @@ impl TychoRunner { let all_accounts = self.initialized_accounts.clone(); - // Determine the correct module name based on protocol system - let module_name = match protocol_system { - "uniswap_v2" => "map_pool_events", - "pancakeswap_v2" => "map_pool_events", - "sushiswap_v2" => "map_pool_events", - _ => "map_protocol_changes", - }; - cmd.args([ "--database-url", self.db_url.as_str(), diff --git a/substreams/ethereum-balancer-v2/integration_test.tycho.yaml b/substreams/ethereum-balancer-v2/integration_test.tycho.yaml index d981a84..56dcc6a 100644 --- a/substreams/ethereum-balancer-v2/integration_test.tycho.yaml +++ b/substreams/ethereum-balancer-v2/integration_test.tycho.yaml @@ -1,5 +1,6 @@ substreams_yaml_path: ./substreams.yaml protocol_system: "vm:balancer_v2" +module_name: "map_protocol_changes" protocol_type_names: - "balancer_v2_pool" adapter_contract: "BalancerV2SwapAdapter" diff --git a/substreams/ethereum-balancer-v3/integration_test.tycho.yaml b/substreams/ethereum-balancer-v3/integration_test.tycho.yaml index b4c4135..7b214a7 100644 --- a/substreams/ethereum-balancer-v3/integration_test.tycho.yaml +++ b/substreams/ethereum-balancer-v3/integration_test.tycho.yaml @@ -1,5 +1,6 @@ substreams_yaml_path: ./substreams.yaml protocol_system: "vm:balancer_v3" +module_name: "map_protocol_changes" protocol_type_names: - "balancer_v3_pool" adapter_contract: "BalancerV3SwapAdapter" diff --git a/substreams/ethereum-curve/integration_test.tycho.yaml b/substreams/ethereum-curve/integration_test.tycho.yaml index ae169ce..8c3be9a 100644 --- a/substreams/ethereum-curve/integration_test.tycho.yaml +++ b/substreams/ethereum-curve/integration_test.tycho.yaml @@ -1,5 +1,6 @@ substreams_yaml_path: ./substreams.yaml protocol_system: "vm:curve" +module_name: "map_protocol_changes" protocol_type_names: - "curve_pool" adapter_contract: "CurveAdapter" diff --git a/substreams/ethereum-ekubo-v2/integration_test.tycho.yaml b/substreams/ethereum-ekubo-v2/integration_test.tycho.yaml index c25523e..8cc0f40 100644 --- a/substreams/ethereum-ekubo-v2/integration_test.tycho.yaml +++ b/substreams/ethereum-ekubo-v2/integration_test.tycho.yaml @@ -1,5 +1,6 @@ substreams_yaml_path: ./substreams.yaml protocol_system: "ekubo_v2" +module_name: "map_protocol_changes" adapter_contract: "EkuboSwapAdapter" adapter_build_signature: "constructor(address)" adapter_build_args: "0x16e186ecdc94083fff53ef2a41d46b92a54f61e2" diff --git a/substreams/ethereum-maverick-v2/integration_test.tycho.yaml b/substreams/ethereum-maverick-v2/integration_test.tycho.yaml index 5be9aad..0405289 100644 --- a/substreams/ethereum-maverick-v2/integration_test.tycho.yaml +++ b/substreams/ethereum-maverick-v2/integration_test.tycho.yaml @@ -1,5 +1,6 @@ substreams_yaml_path: ./ethereum-maverick-v2.yaml protocol_system: "vm:maverick_v2" +module_name: "map_protocol_changes" adapter_contract: "MaverickV2SwapAdapter" adapter_build_signature: "constructor(address,address)" adapter_build_args: "0x0A7e848Aca42d879EF06507Fca0E7b33A0a63c1e,0xb40AfdB85a07f37aE217E7D6462e609900dD8D7A" diff --git a/substreams/ethereum-uniswap-v2/integration_test.tycho.yaml b/substreams/ethereum-uniswap-v2/integration_test.tycho.yaml index bcbac88..4679919 100644 --- a/substreams/ethereum-uniswap-v2/integration_test.tycho.yaml +++ b/substreams/ethereum-uniswap-v2/integration_test.tycho.yaml @@ -2,6 +2,7 @@ substreams_yaml_path: ./ethereum-uniswap-v2.yaml protocol_system: "uniswap_v2" protocol_type_names: - "uniswap_v2_pool" +module_name: "map_pool_events" skip_balance_check: true initialized_accounts: tests: diff --git a/substreams/ethereum-uniswap-v2/integration_test_pancakeswap_v2.tycho.yaml b/substreams/ethereum-uniswap-v2/integration_test_pancakeswap_v2.tycho.yaml index 1631e27..056bd2d 100644 --- a/substreams/ethereum-uniswap-v2/integration_test_pancakeswap_v2.tycho.yaml +++ b/substreams/ethereum-uniswap-v2/integration_test_pancakeswap_v2.tycho.yaml @@ -2,6 +2,7 @@ substreams_yaml_path: ./ethereum-pancakeswap-v2.yaml protocol_system: "pancakeswap_v2" protocol_type_names: - "pancakeswap_v2_pool" +module_name: "map_pool_events" skip_balance_check: true initialized_accounts: tests: