Skip to content

Commit

Permalink
Catch error when event doesn't have a matching messsage
Browse files Browse the repository at this point in the history
  • Loading branch information
stwiname committed Aug 1, 2023
1 parent 3e2c432 commit 171ea78
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/node/src/utils/cosmos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,15 @@ export function wrapEvent(
continue;
}
for (const log of logs) {
const msg = wrapCosmosMsg(block, tx, log.msg_index, api);
let msg: CosmosMessage;
try {
msg = wrapCosmosMsg(block, tx, log.msg_index, api);
} catch (e) {
// Example where this can happen https://sei.explorers.guru/transaction/8D4CA68E917E15652E10CB960DE604AEEB1B183D6E94A85E9CD98403F15550B7
logger.warn(
`Unable to find message for event. tx=${tx.hash} messageIdx=${log.msg_index}`,
);
}
for (let i = 0; i < log.events.length; i++) {
const event: CosmosEvent = {
idx: idxOffset++,
Expand Down

0 comments on commit 171ea78

Please sign in to comment.