From 18e9dfcec497aea9715671e5df65086ca2ca3bb4 Mon Sep 17 00:00:00 2001 From: kayibal Date: Wed, 13 Mar 2024 21:07:46 +0000 Subject: [PATCH] Remove TransactionWrapper from SDK & Balancer. This type is not needed anymore. --- crates/tycho-substreams/src/lib.rs | 2 -- crates/tycho-substreams/src/utils.rs | 24 --------------------- substreams/ethereum-balancer/src/modules.rs | 11 ---------- 3 files changed, 37 deletions(-) delete mode 100644 crates/tycho-substreams/src/utils.rs diff --git a/crates/tycho-substreams/src/lib.rs b/crates/tycho-substreams/src/lib.rs index d5b0d0f..78c7e2e 100644 --- a/crates/tycho-substreams/src/lib.rs +++ b/crates/tycho-substreams/src/lib.rs @@ -2,5 +2,3 @@ pub mod balances; pub mod contract; mod mock_store; pub mod pb; -// TODO: consider removing this module, after integrating with balancer -pub mod utils; diff --git a/crates/tycho-substreams/src/utils.rs b/crates/tycho-substreams/src/utils.rs deleted file mode 100644 index e4729db..0000000 --- a/crates/tycho-substreams/src/utils.rs +++ /dev/null @@ -1,24 +0,0 @@ -use crate::pb::tycho::evm::v1::Transaction; - -/// This struct purely exists to spoof the `PartialEq` trait for `Transaction` so we can use it in -/// a later groupby operation. -#[derive(Debug)] -pub struct TransactionWrapper(Transaction); - -impl TransactionWrapper { - pub fn new(tx: Transaction) -> Self { - Self(tx) - } -} - -impl PartialEq for TransactionWrapper { - fn eq(&self, other: &Self) -> bool { - self.0.hash == other.0.hash - } -} - -impl From for Transaction { - fn from(value: TransactionWrapper) -> Self { - value.0 - } -} diff --git a/substreams/ethereum-balancer/src/modules.rs b/substreams/ethereum-balancer/src/modules.rs index 9923167..a3658ad 100644 --- a/substreams/ethereum-balancer/src/modules.rs +++ b/substreams/ethereum-balancer/src/modules.rs @@ -18,17 +18,6 @@ use tycho_substreams::pb::tycho::evm::v1::{ const VAULT_ADDRESS: &[u8] = &hex!("BA12222222228d8Ba445958a75a0704d566BF2C8"); -/// This struct purely exists to spoof the `PartialEq` trait for `Transaction` so we can use it in -/// a later groupby operation. -#[derive(Debug)] -struct TransactionWrapper(tycho::Transaction); - -impl PartialEq for TransactionWrapper { - fn eq(&self, other: &Self) -> bool { - self.0.hash == other.0.hash - } -} - #[substreams::handlers::map] pub fn map_pools_created(block: eth::v2::Block) -> Result { // Gather contract changes by indexing `PoolCreated` events and analysing the `Create` call