Skip to content

Commit 2349359

Browse files
Merge remote-tracking branch 'origin/feat/native-transfer-fees-tracking' into feat/native-transfer-fees-tracking
2 parents b66c03c + 0b1e1b2 commit 2349359

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/mappings/mappingHandlers.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -308,11 +308,13 @@ export async function handleLegacyBridgeSwap(msg: CosmosMessage<LegacyBridgeSwap
308308
logger.info(`[handleLegacyBridgeSwap] (tx ${msg.tx.hash}): indexing LegacyBridgeSwap ${id}`)
309309
logger.debug(`[handleLegacyBridgeSwap] (msg.msg): ${JSON.stringify(msg.msg, null, 2)}`)
310310

311-
const {
312-
msg: {swap: {destination}},
313-
funds: [{amount, denom}],
314-
contract,
315-
} = msg.msg.decodedMsg;
311+
const contract = msg.msg.decodedMsg.contract;
312+
const swapMsg = msg.msg.decodedMsg.msg;
313+
const destination = swapMsg?.swap?.destination;
314+
315+
const funds = msg.msg.decodedMsg.funds || [];
316+
const amount = funds[0]?.amount;
317+
const denom = funds[0]?.denom;
316318

317319
// gracefully skip indexing "swap" messages that doesn't fullfill the bridge contract
318320
// otherwise, the node will just crashloop trying to save the message to the db with required null fields.

0 commit comments

Comments
 (0)