From 6c4e26cfcfbe4b3f3cfd26f549e585ad275373df Mon Sep 17 00:00:00 2001 From: spypsy Date: Tue, 24 Oct 2023 10:38:02 +0100 Subject: [PATCH] test: run all e2e tests against sandbox (#2891) Fixes #2642 Fixes https://github.com/AztecProtocol/aztec-packages/issues/2917 Also: use `aztecprotocol/aztec-sandbox:canary` for canary tests # Checklist: Remove the checklist to signal you've completed it. Enable auto-merge if the PR is ready to merge. - [ ] If the pull request requires a cryptography review (e.g. cryptographic algorithm implementations) I have added the 'crypto' tag. - [ ] I have reviewed my diff in github, line by line and removed unexpected formatting changes, testing logs, or commented-out code. - [ ] Every change is related to the PR description. - [ ] I have [linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) this pull request to relevant issues (if any exist). --- .circleci/config.yml | 33 ++++++----------- yarn-project/aztec-sandbox/README.md | 7 +++- .../aztec-sandbox/docker-compose-fork.yml | 21 ----------- .../canary/scripts/docker-compose-browser.yml | 31 ++-------------- .../scripts/docker-compose-e2e-sandbox.yml | 36 ------------------- .../canary/scripts/docker-compose.yml | 33 ++--------------- yarn-project/canary/scripts/run_tests | 9 ++--- ...browser.yml => docker-compose-browser.yml} | 0 ...dbox.yml => docker-compose-no-sandbox.yml} | 18 +++------- .../end-to-end/scripts/docker-compose.yml | 19 +++++++--- .../end-to-end/src/e2e_card_game.test.ts | 19 ++++++++-- yarn-project/end-to-end/src/e2e_cli.test.ts | 16 ++++++--- .../e2e_multiple_accounts_1_enc_key.test.ts | 19 ++++++++-- .../src/integration_archiver_l1_to_l2.test.ts | 2 +- .../json-rpc/server/json_rpc_server.test.ts | 2 +- .../src/json-rpc/server/json_rpc_server.ts | 2 +- 16 files changed, 92 insertions(+), 175 deletions(-) delete mode 100644 yarn-project/aztec-sandbox/docker-compose-fork.yml delete mode 100644 yarn-project/canary/scripts/docker-compose-e2e-sandbox.yml rename yarn-project/end-to-end/scripts/{docker-compose-e2e-sandbox-browser.yml => docker-compose-browser.yml} (100%) rename yarn-project/end-to-end/scripts/{docker-compose-e2e-sandbox.yml => docker-compose-no-sandbox.yml} (81%) diff --git a/.circleci/config.yml b/.circleci/config.yml index ff3c13631a6..f3fc08f7775 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -639,7 +639,7 @@ jobs: - *setup_env - run: name: "Test" - command: cond_run_script end-to-end ./scripts/run_tests_local e2e_sandbox_example.test.ts ./scripts/docker-compose-e2e-sandbox.yml + command: cond_run_script end-to-end ./scripts/run_tests_local e2e_sandbox_example.test.ts environment: { DEBUG: "aztec:*" } e2e-block-building: @@ -819,7 +819,7 @@ jobs: - *setup_env - run: name: "Test" - command: cond_run_script end-to-end ./scripts/run_tests_local e2e_p2p_network.test.ts + command: cond_run_script end-to-end ./scripts/run_tests_local e2e_p2p_network.test.ts ./scripts/docker-compose-no-sandbox.yml environment: { DEBUG: "aztec:*" } e2e-browser-sandbox: @@ -831,7 +831,7 @@ jobs: - *setup_env - run: name: "Test" - command: cond_run_script end-to-end ./scripts/run_tests_local e2e_aztec_js_browser.test.ts ./scripts/docker-compose-e2e-sandbox-browser.yml + command: cond_run_script end-to-end ./scripts/run_tests_local e2e_aztec_js_browser.test.ts ./scripts/docker-compose-browser.yml environment: { DEBUG: "aztec:*" } e2e-card-game: @@ -855,7 +855,7 @@ jobs: - *setup_env - run: name: "Test" - command: cond_run_script end-to-end ./scripts/run_tests_local pxe_sandbox.test.ts ./scripts/docker-compose-e2e-sandbox.yml + command: cond_run_script end-to-end ./scripts/run_tests_local pxe_sandbox.test.ts environment: { DEBUG: "aztec:*" } cli-docs-sandbox: @@ -867,7 +867,7 @@ jobs: - *setup_env - run: name: "Test" - command: cond_run_script end-to-end ./scripts/run_tests_local cli_docs_sandbox.test.ts ./scripts/docker-compose-e2e-sandbox.yml + command: cond_run_script end-to-end ./scripts/run_tests_local cli_docs_sandbox.test.ts environment: { DEBUG: "aztec:*" } guides-writing-an-account-contract: @@ -891,7 +891,7 @@ jobs: - *setup_env - run: name: "Test" - command: cond_run_script end-to-end ./scripts/run_tests_local guides/dapp_testing.test.ts ./scripts/docker-compose-e2e-sandbox.yml + command: cond_run_script end-to-end ./scripts/run_tests_local guides/dapp_testing.test.ts environment: { DEBUG: "aztec:*" } guides-sample-dapp: @@ -903,7 +903,7 @@ jobs: - *setup_env - run: name: "Test" - command: cond_run_script end-to-end ./scripts/run_tests_local sample-dapp ./scripts/docker-compose-e2e-sandbox.yml + command: cond_run_script end-to-end ./scripts/run_tests_local sample-dapp environment: { DEBUG: "aztec:*" } guides-up-quick-start: @@ -915,20 +915,9 @@ jobs: - *setup_env - run: name: "Test" - command: cond_run_script end-to-end ./scripts/run_tests_local guides/up_quick_start.test.ts ./scripts/docker-compose-e2e-sandbox.yml + command: cond_run_script end-to-end ./scripts/run_tests_local guides/up_quick_start.test.ts environment: { DEBUG: "aztec:*" } - e2e-canary-test: - machine: - image: ubuntu-2204:2023.07.2 - resource_class: large - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_run_script canary-build ./scripts/run_tests uniswap_trade_on_l1_from_l2.test.ts canary-build ./scripts/docker-compose-e2e-sandbox.yml - bench-publish-rollup: machine: image: ubuntu-2204:2023.07.2 @@ -938,7 +927,7 @@ jobs: - *setup_env - run: name: "Benchmark" - command: cond_run_script end-to-end ./scripts/run_tests_local benchmarks/bench_publish_rollup.test.ts + command: cond_run_script end-to-end ./scripts/run_tests_local benchmarks/bench_publish_rollup.test.ts ./scripts/docker-compose-no-sandbox.yml environment: DEBUG: "aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees" @@ -951,7 +940,7 @@ jobs: - *setup_env - run: name: "Benchmark" - command: cond_run_script end-to-end ./scripts/run_tests_local benchmarks/bench_process_history.test.ts + command: cond_run_script end-to-end ./scripts/run_tests_local benchmarks/bench_process_history.test.ts ./scripts/docker-compose-no-sandbox.yml environment: DEBUG: "aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees" @@ -1339,7 +1328,6 @@ workflows: - integration-l1-publisher: *e2e_test - integration-archiver-l1-to-l2: *e2e_test - e2e-p2p: *e2e_test - - e2e-canary-test: *e2e_test - e2e-browser-sandbox: *e2e_test - e2e-card-game: *e2e_test - pxe-sandbox: *e2e_test @@ -1375,7 +1363,6 @@ workflows: - integration-archiver-l1-to-l2 - e2e-p2p - e2e-browser-sandbox - - e2e-canary-test - e2e-card-game - pxe-sandbox - cli-docs-sandbox diff --git a/yarn-project/aztec-sandbox/README.md b/yarn-project/aztec-sandbox/README.md index 91b65563598..02d5daf51bb 100644 --- a/yarn-project/aztec-sandbox/README.md +++ b/yarn-project/aztec-sandbox/README.md @@ -46,7 +46,12 @@ From the `aztec-sandbox` directory, you can run the two existing examples: - `yarn run:example:token` - An L1 / L2 uniswap token trade. - `yarn run:example:uniswap` - - To run this example, you need to use the `docker-compose-fork.yml` configuration. + - To run this example, you need to set the following vars: + +``` +export FORK_BLOCK_NUMBER=17514288 +export FORK_URL= +``` ## Publishing diff --git a/yarn-project/aztec-sandbox/docker-compose-fork.yml b/yarn-project/aztec-sandbox/docker-compose-fork.yml deleted file mode 100644 index 69660298029..00000000000 --- a/yarn-project/aztec-sandbox/docker-compose-fork.yml +++ /dev/null @@ -1,21 +0,0 @@ -version: '3' -services: - fork: - image: ghcr.io/foundry-rs/foundry:nightly-a44aa13cfc23491ba32aaedc093e9488c1a6db43 - entrypoint: 'anvil --fork-url https://mainnet.infura.io/v3/9928b52099854248b3a096be07a6b23c --host 0.0.0.0 --fork-block-number 17514288 --chain-id 31337' - ports: - - '8545:8545' - - rpc-server: - image: aztecprotocol/aztec-sandbox:latest - ports: - - '8080:8080' - environment: - DEBUG: 'aztec:*' - ETHEREUM_HOST: http://fork:8545 - CHAIN_ID: 31337 - ARCHIVER_POLLING_INTERVAL_MS: 50 - P2P_BLOCK_CHECK_INTERVAL_MS: 50 - SEQ_TX_POLLING_INTERVAL_MS: 50 - WS_BLOCK_CHECK_INTERVAL_MS: 50 - ARCHIVER_VIEM_POLLING_INTERVAL_MS: 500 diff --git a/yarn-project/canary/scripts/docker-compose-browser.yml b/yarn-project/canary/scripts/docker-compose-browser.yml index 6e9429371ab..98d8a7d9625 100644 --- a/yarn-project/canary/scripts/docker-compose-browser.yml +++ b/yarn-project/canary/scripts/docker-compose-browser.yml @@ -1,36 +1,9 @@ version: '3' services: - fork: - image: ghcr.io/foundry-rs/foundry:nightly-a44aa13cfc23491ba32aaedc093e9488c1a6db43 - entrypoint: > - sh -c ' - if [ -n "$FORK_BLOCK_NUMBER" ] && [ -n "$FORK_URL" ]; then - exec anvil -p 8545 --host 0.0.0.0 --chain-id 31337 --fork-url "$FORK_URL" --fork-block-number "$FORK_BLOCK_NUMBER" - else - exec anvil -p 8545 --host 0.0.0.0 --chain-id 31337 - fi' - ports: - - '8545:8545' - - sandbox: - image: aztecprotocol/aztec-sandbox:canary - environment: - DEBUG: 'aztec:*' - ETHEREUM_HOST: http://fork:8545 - CHAIN_ID: 31337 - ARCHIVER_POLLING_INTERVAL_MS: 50 - P2P_BLOCK_CHECK_INTERVAL_MS: 50 - SEQ_TX_POLLING_INTERVAL_MS: 50 - WS_BLOCK_CHECK_INTERVAL_MS: 50 - PXE_BLOCK_POLLING_INTERVAL_MS: 50 - ARCHIVER_VIEM_POLLING_INTERVAL_MS: 500 - ports: - - '8080:8080' - canary: image: aztecprotocol/canary:latest environment: - ETHEREUM_HOST: http://fork:8545 + ETHEREUM_HOST: http://ethereum:8545 CHAIN_ID: 31337 - PXE_URL: http://sandbox:8080 + PXE_URL: http://aztec:8080 command: ['./scripts/start_e2e_ci_browser.sh', './src/aztec_js_browser.test.ts'] diff --git a/yarn-project/canary/scripts/docker-compose-e2e-sandbox.yml b/yarn-project/canary/scripts/docker-compose-e2e-sandbox.yml deleted file mode 100644 index e9d8f75c5b3..00000000000 --- a/yarn-project/canary/scripts/docker-compose-e2e-sandbox.yml +++ /dev/null @@ -1,36 +0,0 @@ -version: '3' -services: - fork: - image: ghcr.io/foundry-rs/foundry:nightly-a44aa13cfc23491ba32aaedc093e9488c1a6db43 - entrypoint: > - sh -c ' - if [ -n "$FORK_BLOCK_NUMBER" ] && [ -n "$FORK_URL" ]; then - exec anvil -p 8545 --host 0.0.0.0 --chain-id 31337 --fork-url "$FORK_URL" --fork-block-number "$FORK_BLOCK_NUMBER" - else - exec anvil -p 8545 --host 0.0.0.0 --chain-id 31337 - fi' - ports: - - '8545:8545' - - sandbox: - image: aztecprotocol/sandbox:latest - environment: - DEBUG: 'aztec:*' - ETHEREUM_HOST: http://fork:8545 - CHAIN_ID: 31337 - ARCHIVER_POLLING_INTERVAL_MS: 50 - P2P_BLOCK_CHECK_INTERVAL_MS: 50 - SEQ_TX_POLLING_INTERVAL_MS: 50 - WS_BLOCK_CHECK_INTERVAL_MS: 50 - PXE_BLOCK_POLLING_INTERVAL_MS: 50 - ARCHIVER_VIEM_POLLING_INTERVAL_MS: 500 - ports: - - '8080:8080' - - canary: - image: aztecprotocol/canary:latest - environment: - ETHEREUM_HOST: http://fork:8545 - CHAIN_ID: 31337 - PXE_URL: http://sandbox:8080 - command: ${TEST:-./src/e2e_deploy_contract.test.ts} diff --git a/yarn-project/canary/scripts/docker-compose.yml b/yarn-project/canary/scripts/docker-compose.yml index 06a2c094a19..74a28452a07 100644 --- a/yarn-project/canary/scripts/docker-compose.yml +++ b/yarn-project/canary/scripts/docker-compose.yml @@ -1,36 +1,9 @@ version: '3' services: - fork: - image: ghcr.io/foundry-rs/foundry:nightly-a44aa13cfc23491ba32aaedc093e9488c1a6db43 - entrypoint: > - sh -c ' - if [ -n "$FORK_BLOCK_NUMBER" ] && [ -n "$FORK_URL" ]; then - exec anvil -p 8545 --host 0.0.0.0 --chain-id 31337 --fork-url "$FORK_URL" --fork-block-number "$FORK_BLOCK_NUMBER" - else - exec anvil -p 8545 --host 0.0.0.0 --chain-id 31337 - fi' - ports: - - '8545:8545' - - sandbox: - image: aztecprotocol/aztec-sandbox:canary - environment: - DEBUG: 'aztec:*' - ETHEREUM_HOST: http://fork:8545 - CHAIN_ID: 31337 - ARCHIVER_POLLING_INTERVAL_MS: 50 - P2P_BLOCK_CHECK_INTERVAL_MS: 50 - SEQ_TX_POLLING_INTERVAL_MS: 50 - WS_BLOCK_CHECK_INTERVAL_MS: 50 - PXE_BLOCK_POLLING_INTERVAL_MS: 50 - ARCHIVER_VIEM_POLLING_INTERVAL_MS: 500 - ports: - - '8080:8080' - canary: image: aztecprotocol/canary:latest environment: - ETHEREUM_HOST: http://fork:8545 + ETHEREUM_HOST: http://ethereum:8545 CHAIN_ID: 31337 - PXE_URL: http://sandbox:8080 - command: ${TEST:-./src/uniswap_trade_on_l1_from_l2.test.ts} + PXE_URL: http://aztec:8080 + command: ${TEST:-./src/cli.test.ts} diff --git a/yarn-project/canary/scripts/run_tests b/yarn-project/canary/scripts/run_tests index 5ed4d4609c1..6ea4c000880 100755 --- a/yarn-project/canary/scripts/run_tests +++ b/yarn-project/canary/scripts/run_tests @@ -22,9 +22,6 @@ IMAGE_URI=$(calculate_image_uri $IMAGE) retry docker pull $IMAGE_URI retry docker tag $IMAGE_URI aztecprotocol/canary:latest -SANDBOX_IMAGE_URI=$(calculate_image_uri aztec-sandbox) -retry docker pull $SANDBOX_IMAGE_URI -retry docker tag $SANDBOX_IMAGE_URI aztecprotocol/sandbox:latest - -docker-compose -f $COMPOSE_FILE rm -f -docker-compose -f $COMPOSE_FILE up --exit-code-from canary +export SANDBOX_VERSION=canary +docker-compose -f ../../aztec-sandbox/docker-compose.yml -f $COMPOSE_FILE rm -f +docker-compose -f ../../aztec-sandbox/docker-compose.yml -f $COMPOSE_FILE up --exit-code-from canary diff --git a/yarn-project/end-to-end/scripts/docker-compose-e2e-sandbox-browser.yml b/yarn-project/end-to-end/scripts/docker-compose-browser.yml similarity index 100% rename from yarn-project/end-to-end/scripts/docker-compose-e2e-sandbox-browser.yml rename to yarn-project/end-to-end/scripts/docker-compose-browser.yml diff --git a/yarn-project/end-to-end/scripts/docker-compose-e2e-sandbox.yml b/yarn-project/end-to-end/scripts/docker-compose-no-sandbox.yml similarity index 81% rename from yarn-project/end-to-end/scripts/docker-compose-e2e-sandbox.yml rename to yarn-project/end-to-end/scripts/docker-compose-no-sandbox.yml index b357f9bef83..bd2020709e5 100644 --- a/yarn-project/end-to-end/scripts/docker-compose-e2e-sandbox.yml +++ b/yarn-project/end-to-end/scripts/docker-compose-no-sandbox.yml @@ -12,10 +12,11 @@ services: ports: - '8545:8545' - sandbox: - image: aztecprotocol/aztec-sandbox:latest + end-to-end: + image: aztecprotocol/end-to-end:latest environment: - DEBUG: 'aztec:*' + BENCHMARK: true + DEBUG: ${DEBUG:-'aztec:*'} ETHEREUM_HOST: http://fork:8545 CHAIN_ID: 31337 ARCHIVER_POLLING_INTERVAL_MS: 50 @@ -24,17 +25,6 @@ services: WS_BLOCK_CHECK_INTERVAL_MS: 50 PXE_BLOCK_POLLING_INTERVAL_MS: 50 ARCHIVER_VIEM_POLLING_INTERVAL_MS: 500 - ports: - - '8080:8080' - - end-to-end: - image: aztecprotocol/end-to-end:latest - environment: - BENCHMARK: true - DEBUG: ${DEBUG:-'aztec:*'} - ETHEREUM_HOST: http://fork:8545 - CHAIN_ID: 31337 - PXE_URL: http://sandbox:8080 command: ${TEST:-./src/e2e_deploy_contract.test.ts} volumes: - ../log:/usr/src/yarn-project/end-to-end/log:rw diff --git a/yarn-project/end-to-end/scripts/docker-compose.yml b/yarn-project/end-to-end/scripts/docker-compose.yml index bd2020709e5..ed5880dad89 100644 --- a/yarn-project/end-to-end/scripts/docker-compose.yml +++ b/yarn-project/end-to-end/scripts/docker-compose.yml @@ -12,11 +12,10 @@ services: ports: - '8545:8545' - end-to-end: - image: aztecprotocol/end-to-end:latest + sandbox: + image: aztecprotocol/aztec-sandbox:latest environment: - BENCHMARK: true - DEBUG: ${DEBUG:-'aztec:*'} + DEBUG: 'aztec:*' ETHEREUM_HOST: http://fork:8545 CHAIN_ID: 31337 ARCHIVER_POLLING_INTERVAL_MS: 50 @@ -25,6 +24,18 @@ services: WS_BLOCK_CHECK_INTERVAL_MS: 50 PXE_BLOCK_POLLING_INTERVAL_MS: 50 ARCHIVER_VIEM_POLLING_INTERVAL_MS: 500 + ports: + - '8080:8080' + + end-to-end: + image: aztecprotocol/end-to-end:latest + environment: + BENCHMARK: true + LOG_LEVL: 'debug' + DEBUG: ${DEBUG:-'aztec:*'} + ETHEREUM_HOST: http://fork:8545 + CHAIN_ID: 31337 + PXE_URL: http://sandbox:8080 command: ${TEST:-./src/e2e_deploy_contract.test.ts} volumes: - ../log:/usr/src/yarn-project/end-to-end/log:rw diff --git a/yarn-project/end-to-end/src/e2e_card_game.test.ts b/yarn-project/end-to-end/src/e2e_card_game.test.ts index 11866b7670e..dc454de91c5 100644 --- a/yarn-project/end-to-end/src/e2e_card_game.test.ts +++ b/yarn-project/end-to-end/src/e2e_card_game.test.ts @@ -1,4 +1,10 @@ -import { AccountWallet, AztecAddress, Wallet, deployInitialSandboxAccounts } from '@aztec/aztec.js'; +import { + AccountWallet, + AztecAddress, + Wallet, + deployInitialSandboxAccounts, + getSandboxAccountsWallets, +} from '@aztec/aztec.js'; import { DebugLogger } from '@aztec/foundation/log'; import { CardGameContract } from '@aztec/noir-contracts/types'; import { PXE } from '@aztec/types'; @@ -7,6 +13,8 @@ import { setup } from './fixtures/utils.js'; /* eslint-disable camelcase */ +const { PXE_URL } = process.env; + interface Card { points: bigint; strength: bigint; @@ -65,7 +73,14 @@ describe('e2e_card_game', () => { // Card stats are derived from the users' private keys, so to get consistent values, we set up the // initial sandbox accounts that always use the same private keys, instead of random ones. ({ pxe, logger, teardown } = await setup(0)); - wallets = await Promise.all((await deployInitialSandboxAccounts(pxe)).map(a => a.account.getWallet())); + + // Get pre-deployed account wallets if we're running against sandbox. + if (PXE_URL) { + wallets = await getSandboxAccountsWallets(pxe); + } else { + // Deploy initial wallets if we're NOT running against sandbox. + wallets = await Promise.all((await deployInitialSandboxAccounts(pxe)).map(a => a.account.getWallet())); + } [firstPlayerWallet, secondPlayerWallet, thirdPlayerWallet] = wallets; [firstPlayer, secondPlayer, thirdPlayer] = wallets.map(a => a.getAddress()); await deployContract(); diff --git a/yarn-project/end-to-end/src/e2e_cli.test.ts b/yarn-project/end-to-end/src/e2e_cli.test.ts index dd527374372..bb3d0a11d71 100644 --- a/yarn-project/end-to-end/src/e2e_cli.test.ts +++ b/yarn-project/end-to-end/src/e2e_cli.test.ts @@ -6,24 +6,32 @@ import { setup as e2eSetup } from './fixtures/utils.js'; import { cliTestSuite } from './shared/cli.js'; const HTTP_PORT = 9009; -const RPC_URL = `http://localhost:${HTTP_PORT}`; +let RPC_URL = `http://localhost:${HTTP_PORT}`; const debug = createDebugLogger('aztec:e2e_cli'); let http: ReturnType; let pxe: PXE; let teardown: () => Promise; +// Use Sandbox PXE URL if we're running against sandbox +const { PXE_URL } = process.env; +if (PXE_URL) { + RPC_URL = PXE_URL; +} + const testSetup = async () => { const context = await e2eSetup(2); debug(`Environment set up`); ({ pxe, teardown } = context); - http = startHttpRpcServer(pxe, createPXERpcServer, HTTP_PORT); - debug(`HTTP RPC server started in port ${HTTP_PORT}`); + if (!PXE_URL) { + http = startHttpRpcServer(pxe, createPXERpcServer, HTTP_PORT); + debug(`HTTP RPC server started in port ${HTTP_PORT}`); + } return pxe; }; const testCleanup = async () => { - http.close(); + http?.close(); await teardown(); }; diff --git a/yarn-project/end-to-end/src/e2e_multiple_accounts_1_enc_key.test.ts b/yarn-project/end-to-end/src/e2e_multiple_accounts_1_enc_key.test.ts index 69200cf54a1..85cca3baeb0 100644 --- a/yarn-project/end-to-end/src/e2e_multiple_accounts_1_enc_key.test.ts +++ b/yarn-project/end-to-end/src/e2e_multiple_accounts_1_enc_key.test.ts @@ -4,15 +4,18 @@ import { Wallet, computeMessageSecretHash, generatePublicKey, + getSandboxAccountsWallets, getSchnorrAccount, } from '@aztec/aztec.js'; import { Fr, GrumpkinScalar } from '@aztec/foundation/fields'; import { DebugLogger } from '@aztec/foundation/log'; import { TokenContract } from '@aztec/noir-contracts/types'; -import { AztecNode, PXE, TxStatus } from '@aztec/types'; +import { AztecNode, CompleteAddress, PXE, TxStatus } from '@aztec/types'; import { expectsNumOfEncryptedLogsInTheLastBlockToBe, setup } from './fixtures/utils.js'; +const { PXE_URL } = process.env; + describe('e2e_multiple_accounts_1_enc_key', () => { let aztecNode: AztecNode | undefined; let pxe: PXE; @@ -44,7 +47,19 @@ describe('e2e_multiple_accounts_1_enc_key', () => { // Verify that all accounts use the same encryption key const encryptionPublicKey = await generatePublicKey(encryptionPrivateKey); - for (const account of await pxe.getRegisteredAccounts()) { + + // Disregard sandbox accounts + let keyAccounts: CompleteAddress[]; + if (PXE_URL) { + const sandBoxWallets = await getSandboxAccountsWallets(pxe); + const allAccounts = await pxe.getRegisteredAccounts(); + keyAccounts = allAccounts.filter( + acc => !sandBoxWallets.map(wlt => wlt.getAddress().toString()).includes(acc.address.toString()), + ); + } else { + keyAccounts = await pxe.getRegisteredAccounts(); + } + for (const account of keyAccounts) { expect(account.publicKey).toEqual(encryptionPublicKey); } diff --git a/yarn-project/end-to-end/src/integration_archiver_l1_to_l2.test.ts b/yarn-project/end-to-end/src/integration_archiver_l1_to_l2.test.ts index 94bfe22844e..eb1fe393d18 100644 --- a/yarn-project/end-to-end/src/integration_archiver_l1_to_l2.test.ts +++ b/yarn-project/end-to-end/src/integration_archiver_l1_to_l2.test.ts @@ -35,7 +35,7 @@ describe('archiver integration with l1 to l2 messages', () => { let accounts: CompleteAddress[]; ({ teardown, wallet, deployL1ContractsValues, accounts, config, logger } = await setup(2)); config.archiverPollingIntervalMS = 100; - archiver = await Archiver.createAndSync(config); + archiver = await Archiver.createAndSync({ ...config, l1Contracts: deployL1ContractsValues.l1ContractAddresses }); const walletClient = deployL1ContractsValues.walletClient; publicClient = deployL1ContractsValues.publicClient; diff --git a/yarn-project/foundation/src/json-rpc/server/json_rpc_server.test.ts b/yarn-project/foundation/src/json-rpc/server/json_rpc_server.test.ts index e8e4d2edc45..7c2d2c856cf 100644 --- a/yarn-project/foundation/src/json-rpc/server/json_rpc_server.test.ts +++ b/yarn-project/foundation/src/json-rpc/server/json_rpc_server.test.ts @@ -44,7 +44,7 @@ test('invalid method', async () => { }); expect(response.status).toBe(400); expect(response.body).toEqual({ - error: { code: -32601, message: 'Method not found' }, + error: { code: -32601, message: 'Method not found: invalid' }, id: 42, jsonrpc: '2.0', }); diff --git a/yarn-project/foundation/src/json-rpc/server/json_rpc_server.ts b/yarn-project/foundation/src/json-rpc/server/json_rpc_server.ts index 4302a42b657..722f0c925f8 100644 --- a/yarn-project/foundation/src/json-rpc/server/json_rpc_server.ts +++ b/yarn-project/foundation/src/json-rpc/server/json_rpc_server.ts @@ -145,7 +145,7 @@ export class JsonRpcServer { id, error: { code: -32601, - message: 'Method not found', + message: `Method not found: ${method}`, }, }; } else {