refactor(substreams): refactor uniswapv3 to use tycho-substreams

This commit is contained in:
zizou
2024-10-11 14:18:22 +02:00
parent d7cc19c4ff
commit 050ae59a83
23 changed files with 46 additions and 928 deletions

View File

@@ -6,12 +6,11 @@ use substreams_helper::hex::Hexable;
use crate::{
events::{get_log_changed_attributes, get_log_changed_balances},
pb::{
tycho::evm::v1::{BalanceChange, Block, BlockChanges, EntityChanges, TransactionChanges},
uniswap::v3::Pool,
},
pb::uniswap::v3::Pool,
};
use tycho_substreams::prelude::*;
#[substreams::handlers::map]
pub fn map_pool_events(
block: eth::Block,
@@ -110,7 +109,7 @@ pub fn map_pool_events(
// Make a list of all HashMap values:
let tx_entity_changes: Vec<TransactionChanges> = tx_changes_map.into_values().collect();
let tycho_block: Block = block.into();
let tycho_block: Block = (&block).into();
let block_entity_changes =
BlockChanges { block: Some(tycho_block), changes: tx_entity_changes };