Skip to content

Commit 8ebe8d7

Browse files
authored
fix: constants gen (#16533)
`yarn remake-constants` was broken due to the recent noir change for the type of shifts. Also cleans up a bit of formatting to match what is currently expected from the generated file
2 parents 1f2589f + b397202 commit 8ebe8d7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

yarn-project/constants/src/constants.gen.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
// GENERATED FILE - DO NOT EDIT, RUN yarn remake-constants
32
export const MAX_FIELD_VALUE = 21888242871839275222246405745257275088548364400416034343698204186575808495616n;
43
export const MAX_U64_VALUE = 18446744073709551615n;
@@ -561,4 +560,4 @@ export enum GeneratorIndex {
561560
PARTIAL_NOTE_VALIDITY_COMMITMENT = 58,
562561
EVENT_COMMITMENT = 59,
563562
PUBLIC_BYTECODE = 60,
564-
}
563+
}

yarn-project/constants/src/scripts/constants.in.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ function processConstantsSolidity(constants: { [key: string]: string }, prefix =
433433
*/
434434
function generateTypescriptConstants({ constants, generatorIndexEnum }: ParsedContent, targetPath: string) {
435435
const result = [
436-
'/* eslint-disable */\n// GENERATED FILE - DO NOT EDIT, RUN yarn remake-constants',
436+
'// GENERATED FILE - DO NOT EDIT, RUN yarn remake-constants',
437437
processConstantsTS(constants),
438438
processEnumTS('GeneratorIndex', generatorIndexEnum),
439439
].join('\n');
@@ -580,6 +580,7 @@ function evaluateExpressions(expressions: [string, string][]): { [key: string]:
580580
// Remove 'as u8' and 'as u32' castings
581581
.replaceAll(' as u8', '')
582582
.replaceAll(' as u32', '')
583+
.replaceAll(' as u64', '')
583584
// Remove the 'AztecAddress::from_field(...)' pattern
584585
.replace(/AztecAddress::from_field\((0x[a-fA-F0-9]+|[0-9]+)\)/g, '$1')
585586
// We make some space around the parentheses, so that constant numbers are still split.

0 commit comments

Comments
 (0)