From eea8b271126f775c154d189695cf224562214109 Mon Sep 17 00:00:00 2001 From: Zizou <111426680+zizou0x@users.noreply.github.com> Date: Thu, 31 Oct 2024 20:12:37 +0700 Subject: [PATCH] fix(balancer): miscellaneous improvements before resync (#104) * fix(balancer): ignore self balance change Euler pool emit a balance change for the pool itself. We don't want to have it because it's an unknown token from Tycho's perspective. example: https://etherscan.io/tx/0x4a9ea683052afefdae3d189862868c3a7dc8f431d1d9828b6bfd9451a8816426#eventlog#338 * refactor(balancer): rename balancer module to balancer-v2 * ci: make clippy happy --------- Co-authored-by: zizou <111426680+flopell@users.noreply.github.com> --- substreams/Cargo.lock | 4 ++-- substreams/Cargo.toml | 4 ++-- .../Cargo.toml | 6 +++--- .../Readme.md | 0 .../abi/README.md | 0 .../abi/composable_stable_pool_factory.json | 0 .../abi/erc_linear_pool_factory.json | 0 .../abi/euler_linear_pool_factory.json | 0 .../abi/gearbox_linear_pool_factory.json | 0 .../abi/get_abis.py | 0 .../abi/managed_pool_factory.json | 0 .../abi/silo_linear_pool_factory.json | 0 .../abi/vault.json | 0 .../abi/weighted_pool_factory_v1.json | 0 .../abi/weighted_pool_factory_v2.json | 0 .../abi/weighted_pool_factory_v3.json | 0 .../abi/weighted_pool_factory_v4.json | 0 .../abi/weighted_pool_tokens_factory.json | 0 .../abi/yearn_linear_pool_factory.json | 0 .../buf.gen.yaml | 0 .../build.rs | 0 .../integration_test.tycho.yaml | 2 +- .../src/abi/composable_stable_pool_factory.rs | 0 .../src/abi/erc_linear_pool_factory.rs | 0 .../src/abi/euler_linear_pool_factory.rs | 0 .../src/abi/gearbox_linear_pool_factory.rs | 0 .../src/abi/managed_pool_factory.rs | 0 .../src/abi/mod.rs | 0 .../src/abi/silo_linear_pool_factory.rs | 0 .../src/abi/vault.rs | 0 .../src/abi/weighted_pool_factory.rs | 0 .../src/abi/weighted_pool_factory_v1.rs | 0 .../src/abi/weighted_pool_factory_v2.rs | 0 .../src/abi/weighted_pool_factory_v3.rs | 0 .../src/abi/weighted_pool_factory_v4.rs | 0 .../src/abi/weighted_pool_tokens_factory.rs | 0 .../src/abi/yearn_linear_pool_factory.rs | 0 .../src/lib.rs | 0 .../src/modules.rs | 7 ++++++- .../src/pool_factories.rs | 20 +++++++++---------- .../substreams.yaml | 6 +++--- substreams/rustfmt.toml | 2 +- testing/README.md | 4 ++-- testing/src/runner/runner.py | 2 +- 44 files changed, 31 insertions(+), 26 deletions(-) rename substreams/{ethereum-balancer => ethereum-balancer-v2}/Cargo.toml (88%) rename substreams/{ethereum-balancer => ethereum-balancer-v2}/Readme.md (100%) rename substreams/{ethereum-balancer => ethereum-balancer-v2}/abi/README.md (100%) rename substreams/{ethereum-balancer => ethereum-balancer-v2}/abi/composable_stable_pool_factory.json (100%) rename substreams/{ethereum-balancer => ethereum-balancer-v2}/abi/erc_linear_pool_factory.json (100%) rename substreams/{ethereum-balancer => ethereum-balancer-v2}/abi/euler_linear_pool_factory.json (100%) rename substreams/{ethereum-balancer => ethereum-balancer-v2}/abi/gearbox_linear_pool_factory.json (100%) rename substreams/{ethereum-balancer => ethereum-balancer-v2}/abi/get_abis.py (100%) rename substreams/{ethereum-balancer => ethereum-balancer-v2}/abi/managed_pool_factory.json (100%) rename substreams/{ethereum-balancer => ethereum-balancer-v2}/abi/silo_linear_pool_factory.json (100%) rename substreams/{ethereum-balancer => ethereum-balancer-v2}/abi/vault.json (100%) rename substreams/{ethereum-balancer => ethereum-balancer-v2}/abi/weighted_pool_factory_v1.json (100%) rename substreams/{ethereum-balancer => ethereum-balancer-v2}/abi/weighted_pool_factory_v2.json (100%) rename substreams/{ethereum-balancer => ethereum-balancer-v2}/abi/weighted_pool_factory_v3.json (100%) rename substreams/{ethereum-balancer => ethereum-balancer-v2}/abi/weighted_pool_factory_v4.json (100%) rename substreams/{ethereum-balancer => ethereum-balancer-v2}/abi/weighted_pool_tokens_factory.json (100%) rename substreams/{ethereum-balancer => ethereum-balancer-v2}/abi/yearn_linear_pool_factory.json (100%) rename substreams/{ethereum-balancer => ethereum-balancer-v2}/buf.gen.yaml (100%) rename substreams/{ethereum-balancer => ethereum-balancer-v2}/build.rs (100%) rename substreams/{ethereum-balancer => ethereum-balancer-v2}/integration_test.tycho.yaml (99%) rename substreams/{ethereum-balancer => ethereum-balancer-v2}/src/abi/composable_stable_pool_factory.rs (100%) rename substreams/{ethereum-balancer => ethereum-balancer-v2}/src/abi/erc_linear_pool_factory.rs (100%) rename substreams/{ethereum-balancer => ethereum-balancer-v2}/src/abi/euler_linear_pool_factory.rs (100%) rename substreams/{ethereum-balancer => ethereum-balancer-v2}/src/abi/gearbox_linear_pool_factory.rs (100%) rename substreams/{ethereum-balancer => ethereum-balancer-v2}/src/abi/managed_pool_factory.rs (100%) rename substreams/{ethereum-balancer => ethereum-balancer-v2}/src/abi/mod.rs (100%) rename substreams/{ethereum-balancer => ethereum-balancer-v2}/src/abi/silo_linear_pool_factory.rs (100%) rename substreams/{ethereum-balancer => ethereum-balancer-v2}/src/abi/vault.rs (100%) rename substreams/{ethereum-balancer => ethereum-balancer-v2}/src/abi/weighted_pool_factory.rs (100%) rename substreams/{ethereum-balancer => ethereum-balancer-v2}/src/abi/weighted_pool_factory_v1.rs (100%) rename substreams/{ethereum-balancer => ethereum-balancer-v2}/src/abi/weighted_pool_factory_v2.rs (100%) rename substreams/{ethereum-balancer => ethereum-balancer-v2}/src/abi/weighted_pool_factory_v3.rs (100%) rename substreams/{ethereum-balancer => ethereum-balancer-v2}/src/abi/weighted_pool_factory_v4.rs (100%) rename substreams/{ethereum-balancer => ethereum-balancer-v2}/src/abi/weighted_pool_tokens_factory.rs (100%) rename substreams/{ethereum-balancer => ethereum-balancer-v2}/src/abi/yearn_linear_pool_factory.rs (100%) rename substreams/{ethereum-balancer => ethereum-balancer-v2}/src/lib.rs (100%) rename substreams/{ethereum-balancer => ethereum-balancer-v2}/src/modules.rs (97%) rename substreams/{ethereum-balancer => ethereum-balancer-v2}/src/pool_factories.rs (96%) rename substreams/{ethereum-balancer => ethereum-balancer-v2}/substreams.yaml (95%) diff --git a/substreams/Cargo.lock b/substreams/Cargo.lock index 54f5161..83b3fc8 100644 --- a/substreams/Cargo.lock +++ b/substreams/Cargo.lock @@ -221,8 +221,8 @@ dependencies = [ ] [[package]] -name = "ethereum-balancer" -version = "0.2.2" +name = "ethereum-balancer-v2" +version = "0.2.3" dependencies = [ "anyhow", "bytes", diff --git a/substreams/Cargo.toml b/substreams/Cargo.toml index d1e2cf9..4387a24 100644 --- a/substreams/Cargo.toml +++ b/substreams/Cargo.toml @@ -1,6 +1,6 @@ [workspace] members = [ - "ethereum-balancer", + "ethereum-balancer-v2", "ethereum-curve", "crates/tycho-substreams", "crates/substreams-helper", @@ -8,7 +8,7 @@ members = [ "ethereum-uniswap-v2", "ethereum-uniswap-v3", "ethereum-sfrax", - "ethereum-sfraxeth" + "ethereum-sfraxeth", ] resolver = "2" diff --git a/substreams/ethereum-balancer/Cargo.toml b/substreams/ethereum-balancer-v2/Cargo.toml similarity index 88% rename from substreams/ethereum-balancer/Cargo.toml rename to substreams/ethereum-balancer-v2/Cargo.toml index 0669c73..28c4c1f 100644 --- a/substreams/ethereum-balancer/Cargo.toml +++ b/substreams/ethereum-balancer-v2/Cargo.toml @@ -1,10 +1,10 @@ [package] -name = "ethereum-balancer" -version = "0.2.2" +name = "ethereum-balancer-v2" +version = "0.2.3" edition = "2021" [lib] -name = "ethereum_balancer" +name = "ethereum_balancer_v2" crate-type = ["cdylib"] [dependencies] diff --git a/substreams/ethereum-balancer/Readme.md b/substreams/ethereum-balancer-v2/Readme.md similarity index 100% rename from substreams/ethereum-balancer/Readme.md rename to substreams/ethereum-balancer-v2/Readme.md diff --git a/substreams/ethereum-balancer/abi/README.md b/substreams/ethereum-balancer-v2/abi/README.md similarity index 100% rename from substreams/ethereum-balancer/abi/README.md rename to substreams/ethereum-balancer-v2/abi/README.md diff --git a/substreams/ethereum-balancer/abi/composable_stable_pool_factory.json b/substreams/ethereum-balancer-v2/abi/composable_stable_pool_factory.json similarity index 100% rename from substreams/ethereum-balancer/abi/composable_stable_pool_factory.json rename to substreams/ethereum-balancer-v2/abi/composable_stable_pool_factory.json diff --git a/substreams/ethereum-balancer/abi/erc_linear_pool_factory.json b/substreams/ethereum-balancer-v2/abi/erc_linear_pool_factory.json similarity index 100% rename from substreams/ethereum-balancer/abi/erc_linear_pool_factory.json rename to substreams/ethereum-balancer-v2/abi/erc_linear_pool_factory.json diff --git a/substreams/ethereum-balancer/abi/euler_linear_pool_factory.json b/substreams/ethereum-balancer-v2/abi/euler_linear_pool_factory.json similarity index 100% rename from substreams/ethereum-balancer/abi/euler_linear_pool_factory.json rename to substreams/ethereum-balancer-v2/abi/euler_linear_pool_factory.json diff --git a/substreams/ethereum-balancer/abi/gearbox_linear_pool_factory.json b/substreams/ethereum-balancer-v2/abi/gearbox_linear_pool_factory.json similarity index 100% rename from substreams/ethereum-balancer/abi/gearbox_linear_pool_factory.json rename to substreams/ethereum-balancer-v2/abi/gearbox_linear_pool_factory.json diff --git a/substreams/ethereum-balancer/abi/get_abis.py b/substreams/ethereum-balancer-v2/abi/get_abis.py similarity index 100% rename from substreams/ethereum-balancer/abi/get_abis.py rename to substreams/ethereum-balancer-v2/abi/get_abis.py diff --git a/substreams/ethereum-balancer/abi/managed_pool_factory.json b/substreams/ethereum-balancer-v2/abi/managed_pool_factory.json similarity index 100% rename from substreams/ethereum-balancer/abi/managed_pool_factory.json rename to substreams/ethereum-balancer-v2/abi/managed_pool_factory.json diff --git a/substreams/ethereum-balancer/abi/silo_linear_pool_factory.json b/substreams/ethereum-balancer-v2/abi/silo_linear_pool_factory.json similarity index 100% rename from substreams/ethereum-balancer/abi/silo_linear_pool_factory.json rename to substreams/ethereum-balancer-v2/abi/silo_linear_pool_factory.json diff --git a/substreams/ethereum-balancer/abi/vault.json b/substreams/ethereum-balancer-v2/abi/vault.json similarity index 100% rename from substreams/ethereum-balancer/abi/vault.json rename to substreams/ethereum-balancer-v2/abi/vault.json diff --git a/substreams/ethereum-balancer/abi/weighted_pool_factory_v1.json b/substreams/ethereum-balancer-v2/abi/weighted_pool_factory_v1.json similarity index 100% rename from substreams/ethereum-balancer/abi/weighted_pool_factory_v1.json rename to substreams/ethereum-balancer-v2/abi/weighted_pool_factory_v1.json diff --git a/substreams/ethereum-balancer/abi/weighted_pool_factory_v2.json b/substreams/ethereum-balancer-v2/abi/weighted_pool_factory_v2.json similarity index 100% rename from substreams/ethereum-balancer/abi/weighted_pool_factory_v2.json rename to substreams/ethereum-balancer-v2/abi/weighted_pool_factory_v2.json diff --git a/substreams/ethereum-balancer/abi/weighted_pool_factory_v3.json b/substreams/ethereum-balancer-v2/abi/weighted_pool_factory_v3.json similarity index 100% rename from substreams/ethereum-balancer/abi/weighted_pool_factory_v3.json rename to substreams/ethereum-balancer-v2/abi/weighted_pool_factory_v3.json diff --git a/substreams/ethereum-balancer/abi/weighted_pool_factory_v4.json b/substreams/ethereum-balancer-v2/abi/weighted_pool_factory_v4.json similarity index 100% rename from substreams/ethereum-balancer/abi/weighted_pool_factory_v4.json rename to substreams/ethereum-balancer-v2/abi/weighted_pool_factory_v4.json diff --git a/substreams/ethereum-balancer/abi/weighted_pool_tokens_factory.json b/substreams/ethereum-balancer-v2/abi/weighted_pool_tokens_factory.json similarity index 100% rename from substreams/ethereum-balancer/abi/weighted_pool_tokens_factory.json rename to substreams/ethereum-balancer-v2/abi/weighted_pool_tokens_factory.json diff --git a/substreams/ethereum-balancer/abi/yearn_linear_pool_factory.json b/substreams/ethereum-balancer-v2/abi/yearn_linear_pool_factory.json similarity index 100% rename from substreams/ethereum-balancer/abi/yearn_linear_pool_factory.json rename to substreams/ethereum-balancer-v2/abi/yearn_linear_pool_factory.json diff --git a/substreams/ethereum-balancer/buf.gen.yaml b/substreams/ethereum-balancer-v2/buf.gen.yaml similarity index 100% rename from substreams/ethereum-balancer/buf.gen.yaml rename to substreams/ethereum-balancer-v2/buf.gen.yaml diff --git a/substreams/ethereum-balancer/build.rs b/substreams/ethereum-balancer-v2/build.rs similarity index 100% rename from substreams/ethereum-balancer/build.rs rename to substreams/ethereum-balancer-v2/build.rs diff --git a/substreams/ethereum-balancer/integration_test.tycho.yaml b/substreams/ethereum-balancer-v2/integration_test.tycho.yaml similarity index 99% rename from substreams/ethereum-balancer/integration_test.tycho.yaml rename to substreams/ethereum-balancer-v2/integration_test.tycho.yaml index 87b178c..1aced7c 100644 --- a/substreams/ethereum-balancer/integration_test.tycho.yaml +++ b/substreams/ethereum-balancer-v2/integration_test.tycho.yaml @@ -1,6 +1,6 @@ substreams_yaml_path: ./substreams.yaml protocol_type_names: - - "balancer_pool" + - "balancer_v2_pool" adapter_contract: "BalancerV2SwapAdapter" adapter_build_signature: "constructor(address)" adapter_build_args: "0xBA12222222228d8Ba445958a75a0704d566BF2C8" diff --git a/substreams/ethereum-balancer/src/abi/composable_stable_pool_factory.rs b/substreams/ethereum-balancer-v2/src/abi/composable_stable_pool_factory.rs similarity index 100% rename from substreams/ethereum-balancer/src/abi/composable_stable_pool_factory.rs rename to substreams/ethereum-balancer-v2/src/abi/composable_stable_pool_factory.rs diff --git a/substreams/ethereum-balancer/src/abi/erc_linear_pool_factory.rs b/substreams/ethereum-balancer-v2/src/abi/erc_linear_pool_factory.rs similarity index 100% rename from substreams/ethereum-balancer/src/abi/erc_linear_pool_factory.rs rename to substreams/ethereum-balancer-v2/src/abi/erc_linear_pool_factory.rs diff --git a/substreams/ethereum-balancer/src/abi/euler_linear_pool_factory.rs b/substreams/ethereum-balancer-v2/src/abi/euler_linear_pool_factory.rs similarity index 100% rename from substreams/ethereum-balancer/src/abi/euler_linear_pool_factory.rs rename to substreams/ethereum-balancer-v2/src/abi/euler_linear_pool_factory.rs diff --git a/substreams/ethereum-balancer/src/abi/gearbox_linear_pool_factory.rs b/substreams/ethereum-balancer-v2/src/abi/gearbox_linear_pool_factory.rs similarity index 100% rename from substreams/ethereum-balancer/src/abi/gearbox_linear_pool_factory.rs rename to substreams/ethereum-balancer-v2/src/abi/gearbox_linear_pool_factory.rs diff --git a/substreams/ethereum-balancer/src/abi/managed_pool_factory.rs b/substreams/ethereum-balancer-v2/src/abi/managed_pool_factory.rs similarity index 100% rename from substreams/ethereum-balancer/src/abi/managed_pool_factory.rs rename to substreams/ethereum-balancer-v2/src/abi/managed_pool_factory.rs diff --git a/substreams/ethereum-balancer/src/abi/mod.rs b/substreams/ethereum-balancer-v2/src/abi/mod.rs similarity index 100% rename from substreams/ethereum-balancer/src/abi/mod.rs rename to substreams/ethereum-balancer-v2/src/abi/mod.rs diff --git a/substreams/ethereum-balancer/src/abi/silo_linear_pool_factory.rs b/substreams/ethereum-balancer-v2/src/abi/silo_linear_pool_factory.rs similarity index 100% rename from substreams/ethereum-balancer/src/abi/silo_linear_pool_factory.rs rename to substreams/ethereum-balancer-v2/src/abi/silo_linear_pool_factory.rs diff --git a/substreams/ethereum-balancer/src/abi/vault.rs b/substreams/ethereum-balancer-v2/src/abi/vault.rs similarity index 100% rename from substreams/ethereum-balancer/src/abi/vault.rs rename to substreams/ethereum-balancer-v2/src/abi/vault.rs diff --git a/substreams/ethereum-balancer/src/abi/weighted_pool_factory.rs b/substreams/ethereum-balancer-v2/src/abi/weighted_pool_factory.rs similarity index 100% rename from substreams/ethereum-balancer/src/abi/weighted_pool_factory.rs rename to substreams/ethereum-balancer-v2/src/abi/weighted_pool_factory.rs diff --git a/substreams/ethereum-balancer/src/abi/weighted_pool_factory_v1.rs b/substreams/ethereum-balancer-v2/src/abi/weighted_pool_factory_v1.rs similarity index 100% rename from substreams/ethereum-balancer/src/abi/weighted_pool_factory_v1.rs rename to substreams/ethereum-balancer-v2/src/abi/weighted_pool_factory_v1.rs diff --git a/substreams/ethereum-balancer/src/abi/weighted_pool_factory_v2.rs b/substreams/ethereum-balancer-v2/src/abi/weighted_pool_factory_v2.rs similarity index 100% rename from substreams/ethereum-balancer/src/abi/weighted_pool_factory_v2.rs rename to substreams/ethereum-balancer-v2/src/abi/weighted_pool_factory_v2.rs diff --git a/substreams/ethereum-balancer/src/abi/weighted_pool_factory_v3.rs b/substreams/ethereum-balancer-v2/src/abi/weighted_pool_factory_v3.rs similarity index 100% rename from substreams/ethereum-balancer/src/abi/weighted_pool_factory_v3.rs rename to substreams/ethereum-balancer-v2/src/abi/weighted_pool_factory_v3.rs diff --git a/substreams/ethereum-balancer/src/abi/weighted_pool_factory_v4.rs b/substreams/ethereum-balancer-v2/src/abi/weighted_pool_factory_v4.rs similarity index 100% rename from substreams/ethereum-balancer/src/abi/weighted_pool_factory_v4.rs rename to substreams/ethereum-balancer-v2/src/abi/weighted_pool_factory_v4.rs diff --git a/substreams/ethereum-balancer/src/abi/weighted_pool_tokens_factory.rs b/substreams/ethereum-balancer-v2/src/abi/weighted_pool_tokens_factory.rs similarity index 100% rename from substreams/ethereum-balancer/src/abi/weighted_pool_tokens_factory.rs rename to substreams/ethereum-balancer-v2/src/abi/weighted_pool_tokens_factory.rs diff --git a/substreams/ethereum-balancer/src/abi/yearn_linear_pool_factory.rs b/substreams/ethereum-balancer-v2/src/abi/yearn_linear_pool_factory.rs similarity index 100% rename from substreams/ethereum-balancer/src/abi/yearn_linear_pool_factory.rs rename to substreams/ethereum-balancer-v2/src/abi/yearn_linear_pool_factory.rs diff --git a/substreams/ethereum-balancer/src/lib.rs b/substreams/ethereum-balancer-v2/src/lib.rs similarity index 100% rename from substreams/ethereum-balancer/src/lib.rs rename to substreams/ethereum-balancer-v2/src/lib.rs diff --git a/substreams/ethereum-balancer/src/modules.rs b/substreams/ethereum-balancer-v2/src/modules.rs similarity index 97% rename from substreams/ethereum-balancer/src/modules.rs rename to substreams/ethereum-balancer-v2/src/modules.rs index d0feaa3..78a3d17 100644 --- a/substreams/ethereum-balancer/src/modules.rs +++ b/substreams/ethereum-balancer-v2/src/modules.rs @@ -79,7 +79,12 @@ pub fn map_relative_balances( .get_last(format!("pool:{}", &component_id[..42])) .is_some() { - for (token, delta) in ev.tokens.iter().zip(ev.deltas.iter()) { + for (token, delta) in ev + .tokens + .iter() + .zip(ev.deltas.iter()) + .filter(|(token, _)| **token != hex::decode(&component_id[2..42]).unwrap()) + { deltas.push(BalanceDelta { ord: vault_log.ordinal(), tx: Some(vault_log.receipt.transaction.into()), diff --git a/substreams/ethereum-balancer/src/pool_factories.rs b/substreams/ethereum-balancer-v2/src/pool_factories.rs similarity index 96% rename from substreams/ethereum-balancer/src/pool_factories.rs rename to substreams/ethereum-balancer-v2/src/pool_factories.rs index 402ee71..9afd4b6 100644 --- a/substreams/ethereum-balancer/src/pool_factories.rs +++ b/substreams/ethereum-balancer-v2/src/pool_factories.rs @@ -77,7 +77,7 @@ pub fn address_map( ), ("manual_updates", &[1u8]), ]) - .as_swap_type("balancer_pool", ImplementationType::Vm), + .as_swap_type("balancer_v2_pool", ImplementationType::Vm), ) } hex!("cC508a455F5b0073973107Db6a878DdBDab957bC") => { @@ -109,7 +109,7 @@ pub fn address_map( ), ("manual_updates", &[1u8]), ]) - .as_swap_type("balancer_pool", ImplementationType::Vm), + .as_swap_type("balancer_v2_pool", ImplementationType::Vm), ) } hex!("5Dd94Da3644DDD055fcf6B3E1aa310Bb7801EB8b") => { @@ -141,7 +141,7 @@ pub fn address_map( ), ("manual_updates", &[1u8]), ]) - .as_swap_type("balancer_pool", ImplementationType::Vm), + .as_swap_type("balancer_v2_pool", ImplementationType::Vm), ) } hex!("897888115Ada5773E02aA29F775430BFB5F34c51") => { @@ -173,7 +173,7 @@ pub fn address_map( ), ("manual_updates", &[1u8]), ]) - .as_swap_type("balancer_pool", ImplementationType::Vm), + .as_swap_type("balancer_v2_pool", ImplementationType::Vm), ) } hex!("DB8d758BCb971e482B2C45f7F8a7740283A1bd3A") => { @@ -203,7 +203,7 @@ pub fn address_map( ("rate_providers", &json_serialize_address_list(&create_call.rate_providers)), ("manual_updates", &[1u8]), ]) - .as_swap_type("balancer_pool", ImplementationType::Vm), + .as_swap_type("balancer_v2_pool", ImplementationType::Vm), ) } hex!("813EE7a840CE909E7Fea2117A44a90b8063bd4fd") => { @@ -240,7 +240,7 @@ pub fn address_map( .to_signed_bytes_be(), ), ]) - .as_swap_type("balancer_pool", ImplementationType::Vm), + .as_swap_type("balancer_v2_pool", ImplementationType::Vm), ) } hex!("5F43FBa61f63Fa6bFF101a0A0458cEA917f6B347") => { @@ -277,7 +277,7 @@ pub fn address_map( .to_signed_bytes_be(), ), ]) - .as_swap_type("balancer_pool", ImplementationType::Vm), + .as_swap_type("balancer_v2_pool", ImplementationType::Vm), ) } // ❌ Reading the deployed factory for Gearbox showcases that it's currently disabled @@ -362,7 +362,7 @@ pub fn address_map( .to_signed_bytes_be(), ), ]) - .as_swap_type("balancer_pool", ImplementationType::Vm), + .as_swap_type("balancer_v2_pool", ImplementationType::Vm), ) } hex!("5F5222Ffa40F2AEd6380D022184D6ea67C776eE0") => { @@ -399,7 +399,7 @@ pub fn address_map( .to_signed_bytes_be(), ), ]) - .as_swap_type("balancer_pool", ImplementationType::Vm), + .as_swap_type("balancer_v2_pool", ImplementationType::Vm), ) } // The `WeightedPool2TokenFactory` is a deprecated contract, but we've included @@ -429,7 +429,7 @@ pub fn address_map( ), ("manual_updates", &[1u8]), ]) - .as_swap_type("balancer_pool", ImplementationType::Vm), + .as_swap_type("balancer_v2_pool", ImplementationType::Vm), ) } _ => None, diff --git a/substreams/ethereum-balancer/substreams.yaml b/substreams/ethereum-balancer-v2/substreams.yaml similarity index 95% rename from substreams/ethereum-balancer/substreams.yaml rename to substreams/ethereum-balancer-v2/substreams.yaml index 4e17b5e..223313a 100644 --- a/substreams/ethereum-balancer/substreams.yaml +++ b/substreams/ethereum-balancer-v2/substreams.yaml @@ -1,7 +1,7 @@ specVersion: v0.1.0 package: - name: "ethereum_balancer" - version: v0.2.2 + name: "ethereum_balancer_v2" + version: v0.2.3 protobuf: files: @@ -14,7 +14,7 @@ protobuf: binaries: default: type: wasm/rust-v1 - file: ../target/wasm32-unknown-unknown/release/ethereum_balancer.wasm + file: ../target/wasm32-unknown-unknown/release/ethereum_balancer_v2.wasm modules: - name: map_components diff --git a/substreams/rustfmt.toml b/substreams/rustfmt.toml index b831d7d..f427b9e 100644 --- a/substreams/rustfmt.toml +++ b/substreams/rustfmt.toml @@ -10,7 +10,7 @@ use_field_init_shorthand = true chain_width = 40 ignore = [ "crates/tycho-substreams/src/pb", - "ethereum-balancer/src/abi", + "ethereum-balancer-v2/src/abi", "ethereum-sfraxeth/src/abi", "ethereum-curve/src/abi", "ethereum-uniswap-v2/src/abi", diff --git a/testing/README.md b/testing/README.md index 49dd028..c9663ee 100644 --- a/testing/README.md +++ b/testing/README.md @@ -97,14 +97,14 @@ python ./testing/src/runner/cli.py --package "your-package-name" #### Example -If you want to run tests for `ethereum-balancer`, use: +If you want to run tests for `ethereum-balancer-v2`, use: ```bash conda activate propeller-protocol-lib-testing export RPC_URL="https://ethereum-mainnet.core.chainstack.com/123123123123" export SUBSTREAMS_API_TOKEN=eyJhbGci... docker compose up -d db -python ./testing/src/runner/cli.py --package "ethereum-balancer" +python ./testing/src/runner/cli.py --package "ethereum-balancer-v2" ``` #### Testing CLI args diff --git a/testing/src/runner/runner.py b/testing/src/runner/runner.py index adadf22..6ac9a6c 100644 --- a/testing/src/runner/runner.py +++ b/testing/src/runner/runner.py @@ -305,7 +305,7 @@ class TestRunner: data = yaml.safe_load(file) modify_func(data) - spkg_name = f"{yaml_file_path.rsplit('/', 1)[0]}/{data['package']['name'].replace('_', '-', 1)}-{data['package']['version']}.spkg" + spkg_name = f"{yaml_file_path.rsplit('/', 1)[0]}/{data['package']['name'].replace('_', '-')}-{data['package']['version']}.spkg" with open(yaml_file_path, "w") as file: yaml.dump(data, file, default_flow_style=False)