Skip to content

Commit

Permalink
fix: gracefully handle functionName (#697)
Browse files Browse the repository at this point in the history
  • Loading branch information
arcoraven authored Oct 3, 2024
1 parent 5ca4d29 commit a5b31d4
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/worker/tasks/processTransactionReceiptsWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,21 @@ const getFormattedTransactionReceipts = async ({
continue;
}

const functionName = await getFunctionName({
contract: config.contract,
data: transaction.input,
});
let functionName: string | undefined;
try {
functionName = await getFunctionName({
contract: config.contract,
data: transaction.input,
});
} catch {
// Unable to parse function. Continue.
}

if (
config.functions.length > 0 &&
!config.functions.includes(functionName)
(!functionName || !config.functions.includes(functionName))
) {
// This transaction is not for a subscribed function name.
// Function not found, or this transaction is not for a subscribed function.
continue;
}

Expand Down

0 comments on commit a5b31d4

Please sign in to comment.