From f0ff82ba4ceedfeedd2d57228fd3fec6dbf58cb6 Mon Sep 17 00:00:00 2001 From: JQQQ Date: Mon, 8 Apr 2024 08:47:12 +1200 Subject: [PATCH] poap remove promise.all to ensure poi --- Ethereum/ethereum-poap/src/mappings/mappingHandlers.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Ethereum/ethereum-poap/src/mappings/mappingHandlers.ts b/Ethereum/ethereum-poap/src/mappings/mappingHandlers.ts index 433a29aa..59296134 100644 --- a/Ethereum/ethereum-poap/src/mappings/mappingHandlers.ts +++ b/Ethereum/ethereum-poap/src/mappings/mappingHandlers.ts @@ -23,7 +23,8 @@ export async function handleEventToken(ev: EventTokenLog): Promise { if (token) { token.eventId = event.id; token.mintOrder = event.tokenMints; - await Promise.all([event.save(), token.save()]); + await event.save(); + await token.save(); } else { await event.save(); } @@ -78,8 +79,11 @@ export async function handleTransfer(ev: TransferLog): Promise { blockheight: BigInt(ev.blockNumber), }); - // Save all entities in bulk - await Promise.all([token.save(), from.save(), to.save(), transfer.save()]); + // NOT use promise.all, in order to ensure generate POI in right order + await token.save(); + await from.save(); + await to.save(); + await transfer.save(); let event: Event | undefined = undefined; if (token.eventId) {