Skip to content
Merged
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
10 changes: 9 additions & 1 deletion barretenberg/ts/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,15 @@ export async function prove(
export async function gateCount(bytecodePath: string) {
const api = await Barretenberg.new(1);
try {
process.stdout.write(`${await getGates(bytecodePath, api)}`);
const numberOfGates = await getGates(bytecodePath, api);

// Create an 8-byte buffer and write the number into it.
// Writing number directly to stdout will result in a variable sized
// input depending on the size.
const buffer = Buffer.alloc(8);
buffer.writeBigInt64LE(BigInt(numberOfGates));

process.stdout.write(buffer);
} finally {
await api.destroy();
}
Expand Down