Batch diff creation for subgraph entities updated in mapping code (#172)

* Batch diff creation for subgraph entities updated in mapping code

* Propagate changes to graph-test-watcher and codegen
This commit is contained in:
prathamesh0
2022-09-07 13:05:21 +05:30
committed by GitHub
parent 288e153287
commit f3091dee3d
15 changed files with 119 additions and 27 deletions
+3 -3
View File
@@ -141,10 +141,10 @@ export const instantiate = async (
[dbData.id]: JSON.parse(JSON.stringify(dbData, jsonBigIntStringReplacer))
};
// Create an auto-diff.
assert(indexer.createDiffStaged);
// Update the in-memory subgraph state.
assert(indexer.updateSubgraphState);
assert(context.contractAddress);
await indexer.createDiffStaged(context.contractAddress, context.block.blockHash, diffData);
indexer.updateSubgraphState(context.contractAddress, diffData);
},
'log.log': (level: number, msg: number) => {