Skip to content

Commit

Permalink
Function params don't need to be optional
Browse files Browse the repository at this point in the history
  • Loading branch information
adamgall committed May 3, 2024
1 parent d253c68 commit b469d9a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/utils/crypto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ function splitIgnoreBrackets(str: string): string[] {
*/
export const encodeFunction = (
_functionName: string,
_functionSignature?: string,
_parameters?: string,
_functionSignature: string,
_parameters: string,
) => {
const parameters = !!_parameters
? splitIgnoreBrackets(_parameters).map(p => (p = p.trim()))
Expand Down
2 changes: 1 addition & 1 deletion test/encodeFunction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ test.skip('Function encoding with no parameters', () => {
},
];
const encoded = encodeFunctionData({ functionName: 'foo', abi: abiItems, args: [] });
expect(encodeFunction('foo')).toEqual(encoded);
expect(encodeFunction('foo', '', '')).toEqual(encoded);
});

test.skip('Function encoding with [boolean=true]', () => {
Expand Down

0 comments on commit b469d9a

Please sign in to comment.