From 31df5fcd8d420c1de9c56e42c85cf901a6f1183b Mon Sep 17 00:00:00 2001 From: LHerskind Date: Tue, 23 Apr 2024 21:57:22 +0000 Subject: [PATCH] fix: missing n for bigint, oh the pain --- .../builder/src/contract-interface-gen/typescript.ts | 4 ++-- yarn-project/types/src/abi/contract_artifact.ts | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/yarn-project/builder/src/contract-interface-gen/typescript.ts b/yarn-project/builder/src/contract-interface-gen/typescript.ts index 5edb7f32117..a8fb0ef4a1b 100644 --- a/yarn-project/builder/src/contract-interface-gen/typescript.ts +++ b/yarn-project/builder/src/contract-interface-gen/typescript.ts @@ -196,7 +196,7 @@ function generateStorageLayoutGetter(input: ContractArtifact) { .map( ([name, { slot, typ }]) => `${name}: { - slot: new Fr(${slot.toBigInt()}), + slot: new Fr(${slot.toBigInt()}n), typ: "${typ}", }`, ) @@ -226,7 +226,7 @@ function generateNotesGetter(input: ContractArtifact) { .map( ([name, { id }]) => `${name}: { - id: new Fr(${id.toBigInt()}), + id: new Fr(${id.toBigInt()}n), }`, ) .join(',\n'); diff --git a/yarn-project/types/src/abi/contract_artifact.ts b/yarn-project/types/src/abi/contract_artifact.ts index 12b203d3cab..0998899167e 100644 --- a/yarn-project/types/src/abi/contract_artifact.ts +++ b/yarn-project/types/src/abi/contract_artifact.ts @@ -210,7 +210,7 @@ function hasKernelFunctionInputs(params: ABIParameter[]): boolean { /** * Generates a storage layout for the contract artifact. - * @param contract + * @param input - The compiled noir contract to get storage layout for * @returns A storage layout for the contract. */ function getStorageLayout(input: NoirCompiledContract) { @@ -233,6 +233,11 @@ function getStorageLayout(input: NoirCompiledContract) { }, {}); } +/** + * Generates records of the notes with note type ids of the artifact. + * @param input - The compiled noir contract to get note types for + * @return A record of the note types and their ids + */ function getNoteTypes(input: NoirCompiledContract) { type t = { kind: string;