Skip to content

Commit

Permalink
fix: missing n for bigint, oh the pain
Browse files Browse the repository at this point in the history
  • Loading branch information
LHerskind committed Apr 24, 2024
1 parent 89e5341 commit 31df5fc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions yarn-project/builder/src/contract-interface-gen/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}",
}`,
)
Expand Down Expand Up @@ -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');
Expand Down
7 changes: 6 additions & 1 deletion yarn-project/types/src/abi/contract_artifact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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;
Expand Down

0 comments on commit 31df5fc

Please sign in to comment.