Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: field encoding should use fromString instead of fromHexString #11585

Merged
merged 2 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion noir-projects/aztec-nr/aztec/src/macros/mod.nr
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ comptime fn generate_contract_interface(m: Module) -> Quoted {

quote {
pub struct $module_name {
target_contract: dep::aztec::protocol_types::address::AztecAddress
pub target_contract: dep::aztec::protocol_types::address::AztecAddress
}

impl $module_name {
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/foundation/src/abi/encoder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ describe('abi/encoder', () => {
};
const args = ['garbage'];

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

it('throws when passing string argument as integer', () => {
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/foundation/src/abi/encoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class ArgumentEncoder {
} else if (typeof arg === 'bigint') {
this.flattened.push(new Fr(arg));
} else if (typeof arg === 'string') {
this.flattened.push(Fr.fromHexString(arg));
this.flattened.push(Fr.fromString(arg));
} else if (typeof arg === 'boolean') {
this.flattened.push(new Fr(arg ? 1n : 0n));
} else if (typeof arg === 'object') {
Expand Down