Skip to content

Commit

Permalink
Don't silently fail when function encoding doesn't work
Browse files Browse the repository at this point in the history
  • Loading branch information
adamgall committed May 3, 2024
1 parent 8252f2e commit 3ccc908
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions src/utils/crypto.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { encodeFunctionData, parseAbiParameters } from 'viem';
import { logError } from '../helpers/errorLogging';
import { ActivityTransactionType } from '../types';

function splitIgnoreBrackets(str: string): string[] {
Expand Down Expand Up @@ -72,16 +71,11 @@ export const encodeFunction = (
}
});

try {
return encodeFunctionData({
functionName: _functionName,
args: parametersFixedWithBool,
abi: parseAbiParameters(_functionSignature || ''),
});
} catch (e) {
logError(e);
return;
}
return encodeFunctionData({
functionName: _functionName,
args: parametersFixedWithBool,
abi: parseAbiParameters(_functionSignature || ''),
});
};

export function isMultiSigTx(transaction: ActivityTransactionType): boolean {
Expand Down

0 comments on commit 3ccc908

Please sign in to comment.