Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/mappings/mappingHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,11 +308,13 @@ export async function handleLegacyBridgeSwap(msg: CosmosMessage<LegacyBridgeSwap
logger.info(`[handleLegacyBridgeSwap] (tx ${msg.tx.hash}): indexing LegacyBridgeSwap ${id}`)
logger.debug(`[handleLegacyBridgeSwap] (msg.msg): ${JSON.stringify(msg.msg, null, 2)}`)

const {
msg: {swap: {destination}},
funds: [{amount, denom}],
contract,
} = msg.msg.decodedMsg;
const contract = msg.msg.decodedMsg.contract;
const swapMsg = msg.msg.decodedMsg.msg;
const destination = swapMsg?.swap?.destination;

const funds = msg.msg.decodedMsg.funds || [];
const amount = funds[0]?.amount;
const denom = funds[0]?.denom;

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