diff --git a/substreams/ethereum-curve/src/modules.rs b/substreams/ethereum-curve/src/modules.rs index c5139d1..d1289a0 100644 --- a/substreams/ethereum-curve/src/modules.rs +++ b/substreams/ethereum-curve/src/modules.rs @@ -164,18 +164,16 @@ pub fn map_relative_balances( let event = abi::pool::events::AddLiquidity::match_and_decode(log)?; Some((log, event)) }) - .filter(|(log, _)| { - pools_store - .get_last(format!("pool:{0}", hex::encode(&log.address()))) - .is_none() - }) - .flat_map(|(log, event)| { + .filter_map(|(log, event)| { let tokens = tokens_store - .get_last(format!("pool:{}", hex::encode(log.address()))) - .unwrap() + .get_last(format!("pool:{0}", hex::encode(log.address())))? .split(":") .map(|token| token.to_owned()) // Clone the tokens .collect::>(); + + Some((tokens, log, event)) + }) + .flat_map(|(tokens, log, event)| { event .token_amounts .iter() diff --git a/substreams/ethereum-curve/src/pool_factories.rs b/substreams/ethereum-curve/src/pool_factories.rs index 32088f1..02a92ad 100644 --- a/substreams/ethereum-curve/src/pool_factories.rs +++ b/substreams/ethereum-curve/src/pool_factories.rs @@ -20,6 +20,7 @@ const META_POOL_FACTORY: [u8; 20] = hex!("B9fC157394Af804a3578134A6585C0dc9cc990 /// This trait defines some helpers for serializing and deserializing `Vec` which is needed /// to be able to encode some of the `Attribute`s. This should also be handled by any downstream /// application. +#[allow(dead_code)] trait SerializableVecBigInt { fn serialize_bytes(&self) -> Vec; fn deserialize_bytes(bytes: &[u8]) -> Vec; diff --git a/substreams/ethereum-curve/substreams.yaml b/substreams/ethereum-curve/substreams.yaml index 13aefc3..39c40a5 100644 --- a/substreams/ethereum-curve/substreams.yaml +++ b/substreams/ethereum-curve/substreams.yaml @@ -23,7 +23,7 @@ modules: inputs: - source: sf.ethereum.type.v2.Block output: - type: proto:tycho.evm.v1.GroupedTransactionProtocolComponents + type: proto:tycho.evm.v1.BlockTransactionProtocolComponents - name: store_components kind: store