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!);