From b469d9a5a57ba788dfb97b21ac5cce02d6c8da66 Mon Sep 17 00:00:00 2001 From: Adam Gall Date: Fri, 3 May 2024 16:52:11 -0400 Subject: [PATCH] Function params don't need to be optional --- src/utils/crypto.ts | 4 ++-- test/encodeFunction.test.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/crypto.ts b/src/utils/crypto.ts index 77290a8c42..80ce8b4099 100644 --- a/src/utils/crypto.ts +++ b/src/utils/crypto.ts @@ -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())) diff --git a/test/encodeFunction.test.ts b/test/encodeFunction.test.ts index 95985029f1..5fba435a52 100644 --- a/test/encodeFunction.test.ts +++ b/test/encodeFunction.test.ts @@ -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]', () => {