Skip to content

Commit

Permalink
fix: πŸ› Correctly handle InstructionAutomaticallyAffirmed event
Browse files Browse the repository at this point in the history
  • Loading branch information
prashantasdeveloper committed Nov 27, 2024
1 parent ec2bb88 commit df3019d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/mappings/entities/settlements/mapSettlement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ export const handleInstructionCreated = async (event: SubstrateEvent): Promise<v
promises.push(automaticAffirmation.save());
promises.push(automaticAffirmationEvent.save());
};
automaticAffirmationPromises.push(automaticAffirmationPromise);
automaticAffirmationPromises.push(automaticAffirmationPromise());
}
});

Expand Down Expand Up @@ -425,8 +425,12 @@ export const handleAutomaticAffirmation = async (event: SubstrateEvent): Promise
* The below logic handles the case after 6.3.1 when ordering was correct and we can safely assume instruction exists here
*/
if (specVersion >= 6003001 || specName === 'polymesh_private_dev') {
const promises = await mapAutomaticAffirmation(params, blockId, eventIdx);
await Promise.all(promises);
const [instructionEvent, instructionAffirmation] = await mapAutomaticAffirmation(
params,
blockId,
eventIdx
);
await Promise.all([instructionEvent.save(), instructionAffirmation.save()]);
}
};

Expand Down

0 comments on commit df3019d

Please sign in to comment.