From 6078bb0c6f9daf289b13c4fc0da406b3918b6a76 Mon Sep 17 00:00:00 2001 From: LHerskind Date: Wed, 24 Apr 2024 10:41:55 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20browser=20stuff=20=F0=9F=92=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yarn-project/aztec.js/src/api/abi.ts | 2 +- yarn-project/end-to-end/src/shared/browser.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/yarn-project/aztec.js/src/api/abi.ts b/yarn-project/aztec.js/src/api/abi.ts index 7e94b7eb30f..03a5b41d4f2 100644 --- a/yarn-project/aztec.js/src/api/abi.ts +++ b/yarn-project/aztec.js/src/api/abi.ts @@ -1,3 +1,3 @@ export { ContractArtifact, FunctionArtifact, FunctionSelector } from '@aztec/foundation/abi'; -export { loadContractArtifact } from '@aztec/types/abi'; +export { loadContractArtifact, contractArtifactToBuffer, contractArtifactFromBuffer } from '@aztec/types/abi'; export { NoirCompiledContract } from '@aztec/types/noir'; diff --git a/yarn-project/end-to-end/src/shared/browser.ts b/yarn-project/end-to-end/src/shared/browser.ts index 42f316b9c7e..9a94d89db75 100644 --- a/yarn-project/end-to-end/src/shared/browser.ts +++ b/yarn-project/end-to-end/src/shared/browser.ts @@ -227,11 +227,11 @@ export const browserTestSuite = ( INITIAL_TEST_SIGNING_KEYS, INITIAL_TEST_ACCOUNT_SALTS, Buffer, + contractArtifactFromBuffer, } = window.AztecJs; // We serialize the artifact since buffers (used for bytecode) do not cross well from one realm to another - const TokenContractArtifact = JSON.parse( - Buffer.from(serializedTokenContractArtifact, 'base64').toString('utf-8'), - (key, value) => (key === 'bytecode' && typeof value === 'string' ? Buffer.from(value, 'base64') : value), + const TokenContractArtifact = contractArtifactFromBuffer( + Buffer.from(serializedTokenContractArtifact, 'base64'), ); const pxe = createPXEClient(rpcUrl!);