refactor: Move module_name to integration test yaml
It's not good to keep this in the test_runner because then we have multiple points that we need to edit the test config, which can be hard to find. We need this because the module name for uniswap_v2 is so far different from the rest of the protocols.
This commit is contained in:
@@ -143,5 +143,6 @@ pub struct IntegrationTestsConfig {
|
||||
pub skip_balance_check: bool,
|
||||
pub protocol_type_names: Vec<String>,
|
||||
pub protocol_system: String,
|
||||
pub module_name: String,
|
||||
pub tests: Vec<IntegrationTest>,
|
||||
}
|
||||
|
||||
@@ -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")?;
|
||||
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user