diff --git a/Polkadot/Polkadot-starter/src/mappings/mappingHandlers.ts b/Polkadot/Polkadot-starter/src/mappings/mappingHandlers.ts index 3cd4d9ce..1820ae90 100644 --- a/Polkadot/Polkadot-starter/src/mappings/mappingHandlers.ts +++ b/Polkadot/Polkadot-starter/src/mappings/mappingHandlers.ts @@ -1,3 +1,4 @@ +import assert from 'assert'; import { SubstrateExtrinsic, SubstrateEvent, @@ -25,10 +26,13 @@ export async function handleEvent(event: SubstrateEvent): Promise { // logger.info(JSON.stringify(event)); const { event: { - data: [from, to, amount], + data: [to, amount], }, } = event; + const from = event.extrinsic?.extrinsic.signer; + assert(from, "Signer is missing"); + const blockNumber: number = event.block.block.header.number.toNumber(); const fromAccount = await checkAndGetAccount(from.toString(), blockNumber);