Update subgraph watcher demo readme (#480)

* Update subgraph watcher demo readme

* Pass extra block data required in subgraph block handler (#486)

* Use codegen config directory name instead of file path

* Get block data from extra event data

* Add extra event data in processBlockAfterEvents

---------

Co-authored-by: neeraj <neeraj.rtly@gmail.com>

* Update example subgraph mapping code for graph-cli upgrade

* Return 0 value for block size in ipld-eth-client

---------

Co-authored-by: neeraj <neeraj.rtly@gmail.com>
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
This commit is contained in:
2023-11-24 11:13:40 +05:30
committed by GitHub
co-authored by neeraj prathamesh
parent 937aed139f
commit 6decf61d4c
8 changed files with 38 additions and 38 deletions
+5 -6
View File
@@ -238,7 +238,7 @@ export class GraphWatcher {
}
}
async handleBlock (blockHash: string, blockNumber: number) {
async handleBlock (blockHash: string, blockNumber: number, extraData: ExtraEventData) {
// Clear transactions map on handling new block.
this._transactionsMap.clear();
@@ -258,11 +258,10 @@ export class GraphWatcher {
continue;
}
// TODO: Use extraData full block
// // Check if block data is already fetched in handleEvent method for the same block.
// if (!this._context.block || this._context.block.blockHash !== blockHash) {
// this._context.block = await getFullBlock(this._ethClient, this._ethProvider, blockHash, blockNumber);
// }
// Check if block data is already fetched in handleEvent method for the same block.
if (!this._context.block || this._context.block.blockHash !== blockHash) {
this._context.block = await getFullBlock(extraData.ethFullBlock);
}
const blockData = this._context.block;
assert(blockData);