feat(template): More detailed template.

Add a more detailed protocol implementation in the template. This should allow more ppl to get started quicker. Additionally more people will follow a predetermined structure
This commit is contained in:
kayibal
2025-01-28 18:17:36 -03:00
committed by Alan Höng
parent 4eea400af5
commit d0e73a20ea
12 changed files with 1897 additions and 37 deletions

View File

@@ -58,7 +58,7 @@ pub fn store_components(map: BlockTransactionProtocolComponents, store: StoreSet
}
/// Since the `PoolBalanceChanged` and `Swap` events administer only deltas, we need to leverage a
/// map and a store to be able to tally up final balances for tokens in a pool.
/// map and a store to be able to tally up final balances for tokens in a pool.
#[substreams::handlers::map]
pub fn map_relative_balances(
block: eth::v2::Block,
@@ -253,7 +253,7 @@ pub fn map_protocol_changes(
let id = components_store
.get_last(format!("pool:0x{}", hex::encode(address)))
.unwrap(); // Shouldn't happen because we filter by known components in
// `extract_contract_changes_builder`
// `extract_contract_changes_builder`
change.mark_component_as_updated(&id);
}
})