From 7d22db7e78ad0c076c66799a20e735f42ade19ba Mon Sep 17 00:00:00 2001 From: Raman Shekhawat Date: Mon, 20 Jan 2025 02:28:33 +0530 Subject: [PATCH] bugfix: MICRO-58 fix teleport attempted handler (#1511) fix teleport handler --- src/mappings/xcm/events/attempted.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/mappings/xcm/events/attempted.ts b/src/mappings/xcm/events/attempted.ts index 3fc54a760..dd7615cda 100644 --- a/src/mappings/xcm/events/attempted.ts +++ b/src/mappings/xcm/events/attempted.ts @@ -8,6 +8,10 @@ import config from '../../../config' async function getCallData(ctx: CommonContext, call: CallItem) { if (call.name === 'PolkadotXcm.limited_teleport_assets') { + if (calls.polkadotXcm.limitedTeleportAssets.matrixEnjinV1012.is(call)) { + return calls.polkadotXcm.limitedTeleportAssets.matrixEnjinV1012.decode(call) + } + if (calls.polkadotXcm.limitedTeleportAssets.matrixEnjinV603.is(call)) { return calls.polkadotXcm.limitedTeleportAssets.matrixEnjinV603.decode(call) } @@ -20,6 +24,10 @@ async function getCallData(ctx: CommonContext, call: CallItem) { } if (call.name === 'PolkadotXcm.teleport_assets') { + if (calls.polkadotXcm.teleportAssets.matrixEnjinV1012.is(call)) { + return calls.polkadotXcm.teleportAssets.matrixEnjinV1012.decode(call) + } + if (calls.polkadotXcm.teleportAssets.matrixEnjinV603.is(call)) { return calls.polkadotXcm.teleportAssets.matrixEnjinV603.decode(call) } @@ -31,6 +39,10 @@ async function getCallData(ctx: CommonContext, call: CallItem) { } if (call.name === 'PolkadotXcm.limited_reserve_transfer_assets') { + if (calls.polkadotXcm.limitedReserveTransferAssets.matrixEnjinV1012.is(call)) { + return calls.polkadotXcm.limitedReserveTransferAssets.matrixEnjinV603.decode(call) + } + if (calls.polkadotXcm.limitedReserveTransferAssets.matrixEnjinV603.is(call)) { return calls.polkadotXcm.limitedReserveTransferAssets.matrixEnjinV603.decode(call) } @@ -46,6 +58,10 @@ async function getCallData(ctx: CommonContext, call: CallItem) { let callData: any = null + if (data.matrixEnjinV1012.is(call)) { + callData = data.matrixEnjinV1012.decode(call) + } + if (data.matrixEnjinV1005.is(call)) { callData = data.matrixEnjinV1005.decode(call) } @@ -113,7 +129,7 @@ async function getCallData(ctx: CommonContext, call: CallItem) { return callData!.call.value } - return undefined + throw new Error('Unsupported call') } throw new UnsupportedCallError(call.name)