Skip to content

Commit 43fdbb1

Browse files
authored
chore: field encoding should use fromString instead of fromHexString (#11585)
Related #10331
1 parent dddab22 commit 43fdbb1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

yarn-project/foundation/src/abi/encoder.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ describe('abi/encoder', () => {
180180
};
181181
const args = ['garbage'];
182182

183-
expect(() => encodeArguments(testFunctionAbi, args)).toThrow('Invalid hex-encoded string: "garbage"');
183+
expect(() => encodeArguments(testFunctionAbi, args)).toThrow('Tried to create a Fr from an invalid string');
184184
});
185185

186186
it('throws when passing string argument as integer', () => {

yarn-project/foundation/src/abi/encoder.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class ArgumentEncoder {
5050
} else if (typeof arg === 'bigint') {
5151
this.flattened.push(new Fr(arg));
5252
} else if (typeof arg === 'string') {
53-
this.flattened.push(Fr.fromHexString(arg));
53+
this.flattened.push(Fr.fromString(arg));
5454
} else if (typeof arg === 'boolean') {
5555
this.flattened.push(new Fr(arg ? 1n : 0n));
5656
} else if (typeof arg === 'object') {

0 commit comments

Comments
 (0)