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(),
|
||||
|
||||
Reference in New Issue
Block a user