Minor fixes
This commit is contained in:
@@ -4,7 +4,7 @@ The Ethereum Explorer consists of several Substreams modules showcasing the most
|
|||||||
|
|
||||||
## Before You Begin
|
## Before You Begin
|
||||||
|
|
||||||
Make sure you have the [Substreams CLI installed](https://substreams.streamingfast.io/getting-started/installing-the-cli), and you know the [basic structure of a Substreams module](https://substreams.streamingfast.io/getting-started/quickstart).
|
Make sure you have the [Substreams CLI installed](https://substreams.streamingfast.io/getting-started/installing-the-cli), and you know the [basic structure of a Substreams module](https://substreams.streamingfast.io/getting-started/quickstart). You must also provide an [authentication token](https://substreams.streamingfast.io/reference-and-specs/authentication).
|
||||||
|
|
||||||
## Modules
|
## Modules
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,13 @@ use crate::pb::eth::event::v1::Events;
|
|||||||
|
|
||||||
substreams_ethereum::init!();
|
substreams_ethereum::init!();
|
||||||
|
|
||||||
|
#[substreams::handlers::map]
|
||||||
|
fn map_block_meta(blk: Block) -> Result<BlockMeta, substreams::errors::Error> {
|
||||||
|
let block_meta = block_meta::map_block_meta(&blk);
|
||||||
|
|
||||||
|
Ok(block_meta)
|
||||||
|
}
|
||||||
|
|
||||||
#[substreams::handlers::map]
|
#[substreams::handlers::map]
|
||||||
pub fn map_filter_transaction(transaction_hash: String, blk: Block) -> Result<TransactionOption, substreams::errors::Error> {
|
pub fn map_filter_transaction(transaction_hash: String, blk: Block) -> Result<TransactionOption, substreams::errors::Error> {
|
||||||
let filtered_transaction = filter_transaction::filter_by_transaction_hash(transaction_hash, &blk);
|
let filtered_transaction = filter_transaction::filter_by_transaction_hash(transaction_hash, &blk);
|
||||||
@@ -31,10 +38,3 @@ fn map_contract_events(contract_address: String, blk: Block) -> Result<Events, s
|
|||||||
Ok(events)
|
Ok(events)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[substreams::handlers::map]
|
|
||||||
fn map_block_meta(blk: Block) -> Result<BlockMeta, substreams::errors::Error> {
|
|
||||||
let block_meta = block_meta::map_block_meta(&blk);
|
|
||||||
|
|
||||||
Ok(block_meta)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@@ -13,12 +13,8 @@ pub fn map_contract_events(contract_address: String, blk: &Block) -> Events {
|
|||||||
let to = Hex(&tr.to).to_string();
|
let to = Hex(&tr.to).to_string();
|
||||||
|
|
||||||
if to == contract_address {
|
if to == contract_address {
|
||||||
//substreams::log::info!(hash);
|
|
||||||
|
|
||||||
let transaction_events = &mut get_transaction_events(&tr);
|
let transaction_events = &mut get_transaction_events(&tr);
|
||||||
events.append(transaction_events);
|
events.append(transaction_events);
|
||||||
|
|
||||||
substreams::log::info!("//////////////////");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user