From 18d896922750562c5db9d480531ca8a6353cf8f4 Mon Sep 17 00:00:00 2001 From: Zizou <111426680+zizou0x@users.noreply.github.com> Date: Wed, 19 Mar 2025 11:50:01 +0100 Subject: [PATCH] refactor: better attribute name for Pancakeswapv3 module (#179) Also fixes an issue with inconsistent version tag between cargo and substreams files Co-authored-by: zizou <111426680+flopell@users.noreply.github.com> --- substreams/Cargo.lock | 2 +- substreams/ethereum-pancakeswap-v3/Cargo.toml | 2 +- .../ethereum-pancakeswap-v3/ethereum-pancakeswap-v3.yaml | 2 +- .../src/modules/5_map_protocol_changes.rs | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/substreams/Cargo.lock b/substreams/Cargo.lock index 799c22d..4fb9449 100644 --- a/substreams/Cargo.lock +++ b/substreams/Cargo.lock @@ -262,7 +262,7 @@ dependencies = [ [[package]] name = "ethereum-pancakeswap-v3" -version = "0.1.0" +version = "0.1.2" dependencies = [ "anyhow", "ethabi 18.0.0", diff --git a/substreams/ethereum-pancakeswap-v3/Cargo.toml b/substreams/ethereum-pancakeswap-v3/Cargo.toml index d79a5f3..edf0a5a 100644 --- a/substreams/ethereum-pancakeswap-v3/Cargo.toml +++ b/substreams/ethereum-pancakeswap-v3/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ethereum-pancakeswap-v3" -version = "0.1.0" +version = "0.1.2" edition = "2021" [lib] diff --git a/substreams/ethereum-pancakeswap-v3/ethereum-pancakeswap-v3.yaml b/substreams/ethereum-pancakeswap-v3/ethereum-pancakeswap-v3.yaml index e8a8beb..7a20987 100644 --- a/substreams/ethereum-pancakeswap-v3/ethereum-pancakeswap-v3.yaml +++ b/substreams/ethereum-pancakeswap-v3/ethereum-pancakeswap-v3.yaml @@ -1,7 +1,7 @@ specVersion: v0.1.0 package: name: "ethereum_pancakeswap_v3" - version: v0.1.1 + version: v0.1.2 protobuf: files: diff --git a/substreams/ethereum-pancakeswap-v3/src/modules/5_map_protocol_changes.rs b/substreams/ethereum-pancakeswap-v3/src/modules/5_map_protocol_changes.rs index 8b09a3e..0e3eebf 100644 --- a/substreams/ethereum-pancakeswap-v3/src/modules/5_map_protocol_changes.rs +++ b/substreams/ethereum-pancakeswap-v3/src/modules/5_map_protocol_changes.rs @@ -204,7 +204,7 @@ fn event_to_attributes_updates(event: PoolEvent) -> Vec<(Transaction, PoolAddres .into(), hex::decode(&event.pool_address).unwrap(), Attribute { - name: "protocol_fees/zeroForOne".to_string(), + name: "protocol_fees/zero2one".to_string(), value: BigInt::from(zero_to_one).to_signed_bytes_be(), change: ChangeType::Update.into(), }, @@ -213,7 +213,7 @@ fn event_to_attributes_updates(event: PoolEvent) -> Vec<(Transaction, PoolAddres event.transaction.unwrap().into(), hex::decode(event.pool_address).unwrap(), Attribute { - name: "protocol_fees/oneForZero".to_string(), + name: "protocol_fees/one2zero".to_string(), value: BigInt::from(one_to_zero).to_signed_bytes_be(), change: ChangeType::Update.into(), }, @@ -255,7 +255,7 @@ fn event_to_attributes_updates(event: PoolEvent) -> Vec<(Transaction, PoolAddres .into(), hex::decode(&event.pool_address).unwrap(), Attribute { - name: "protocol_fees/zeroForOne".to_string(), + name: "protocol_fees/zero2one".to_string(), value: BigInt::from(sfp.fee_protocol_0_new).to_signed_bytes_be(), change: ChangeType::Update.into(), }, @@ -264,7 +264,7 @@ fn event_to_attributes_updates(event: PoolEvent) -> Vec<(Transaction, PoolAddres event.transaction.unwrap().into(), hex::decode(event.pool_address).unwrap(), Attribute { - name: "protocol_fees/oneForZero".to_string(), + name: "protocol_fees/one2zero".to_string(), value: BigInt::from(sfp.fee_protocol_1_new).to_signed_bytes_be(), change: ChangeType::Update.into(), },