From 13dfd9ebb4bef808716a265bf8ece4b7b9c8f89d Mon Sep 17 00:00:00 2001 From: prathamesh Date: Wed, 6 Oct 2021 12:58:06 +0530 Subject: [PATCH] Change IPLD block structure --- .../src/templates/hooks-template.handlebars | 24 +++++++++++++++---- .../src/templates/indexer-template.handlebars | 18 ++++++++++++++ 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/packages/codegen/src/templates/hooks-template.handlebars b/packages/codegen/src/templates/hooks-template.handlebars index 2eb4af08..82e51195 100644 --- a/packages/codegen/src/templates/hooks-template.handlebars +++ b/packages/codegen/src/templates/hooks-template.handlebars @@ -26,9 +26,25 @@ export async function handleBlock (indexer: Indexer, jobData: any): Promise { + assert(blockHash); + + const { + allEthHeaderCids: { + nodes: [ + { + cid + } + ] + } + } = await this._postgraphileClient.getBlockWithTransactions({ blockHash }); + + assert(cid); + + return cid; + } + async triggerIndexingOnEvent (event: Event): Promise { const resultEvent = this.getResultEvent(event);