From 6383c6840076dc5ba1915a46e1bda70d609f96fd Mon Sep 17 00:00:00 2001 From: benesjan Date: Mon, 29 Jan 2024 12:25:03 +0000 Subject: [PATCH] e2e pxe test fix --- yarn-project/circuits.js/src/structs/header.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/yarn-project/circuits.js/src/structs/header.ts b/yarn-project/circuits.js/src/structs/header.ts index e5910a3d10ec..9f78ac3a1a02 100644 --- a/yarn-project/circuits.js/src/structs/header.ts +++ b/yarn-project/circuits.js/src/structs/header.ts @@ -95,6 +95,14 @@ export class Header { ); } + /** + * Serializes this instance into a string. + * @returns Encoded string. + */ + public toString(): string { + return this.toBuffer().toString('hex'); + } + static fromString(str: string): Header { const buffer = Buffer.from(str.replace(/^0x/i, ''), 'hex'); return Header.fromBuffer(buffer);