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

This commit is contained in:
zizou
2024-10-11 14:11:19 +02:00
parent 73d48236ba
commit d7cc19c4ff
13 changed files with 25 additions and 381 deletions

View File

@@ -7,14 +7,9 @@ use substreams_ethereum::pb::eth::v2::{self as eth};
use substreams_helper::{event_handler::EventHandler, hex::Hexable};
use crate::{
abi::factory::events::PairCreated,
pb::tycho::evm::v1::{
Attribute, Block, BlockChanges, ChangeType, EntityChanges, FinancialType,
ImplementationType, ProtocolComponent, ProtocolType, Transaction, TransactionChanges,
},
};
use crate::abi::factory::events::PairCreated;
use tycho_substreams::prelude::*;
#[derive(Debug, Deserialize)]
struct Params {
factory_address: String,
@@ -32,7 +27,7 @@ pub fn map_pools_created(
get_pools(&block, &mut new_pools, &params);
let tycho_block: Block = block.into();
let tycho_block: Block = (&block).into();
Ok(BlockChanges { block: Some(tycho_block), changes: new_pools })
}