Skip to content

Commit a5b31d4

Browse files
authored
fix: gracefully handle functionName (#697)
1 parent 5ca4d29 commit a5b31d4

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/worker/tasks/processTransactionReceiptsWorker.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,21 @@ const getFormattedTransactionReceipts = async ({
153153
continue;
154154
}
155155

156-
const functionName = await getFunctionName({
157-
contract: config.contract,
158-
data: transaction.input,
159-
});
156+
let functionName: string | undefined;
157+
try {
158+
functionName = await getFunctionName({
159+
contract: config.contract,
160+
data: transaction.input,
161+
});
162+
} catch {
163+
// Unable to parse function. Continue.
164+
}
165+
160166
if (
161167
config.functions.length > 0 &&
162-
!config.functions.includes(functionName)
168+
(!functionName || !config.functions.includes(functionName))
163169
) {
164-
// This transaction is not for a subscribed function name.
170+
// Function not found, or this transaction is not for a subscribed function.
165171
continue;
166172
}
167173

0 commit comments

Comments
 (0)