diff --git a/.circleci/config.yml b/.circleci/config.yml index 280015c1e9b5..debe97a230e4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -629,313 +629,23 @@ jobs: command: build end-to-end aztec_manifest_key: end-to-end - e2e-2-pxes: + e2e-tests: steps: - *checkout - *setup_env - run: name: "Test" - command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=e2e_2_pxes.test.ts + command: cond_spot_run_container end-to-end 64 ./src/e2e* aztec_manifest_key: end-to-end <<: *defaults_e2e_test - e2e-auth: - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=e2e_auth_contract.test.ts - aztec_manifest_key: end-to-end - <<: *defaults_e2e_test - - e2e-note-getter: - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=e2e_note_getter.test.ts - aztec_manifest_key: end-to-end - <<: *defaults_e2e_test - - e2e-counter: - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=e2e_counter_contract.test.ts - aztec_manifest_key: end-to-end - <<: *defaults_e2e_test - - e2e-private-voting: - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=e2e_private_voting_contract.test.ts - aztec_manifest_key: end-to-end - <<: *defaults_e2e_test - - e2e-max-block-number: - docker: - - image: aztecprotocol/alpine-build-image - resource_class: small - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=e2e_max_block_number.test.ts - aztec_manifest_key: end-to-end - - e2e-multiple-accounts-1-enc-key: - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=e2e_multiple_accounts_1_enc_key.test.ts - aztec_manifest_key: end-to-end - <<: *defaults_e2e_test - - e2e-deploy-contract: - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_container end-to-end 8 ./src/e2e_deploy_contract/ - aztec_manifest_key: end-to-end - <<: *defaults_e2e_test - - e2e-lending-contract: - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=e2e_lending_contract.test.ts - aztec_manifest_key: end-to-end - <<: *defaults_e2e_test - - e2e-token-contract: - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_container end-to-end 16 ./src/e2e_token_contract/ - aztec_manifest_key: end-to-end - <<: *defaults_e2e_test - - e2e-authwit-test: - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=e2e_authwit.test.ts - aztec_manifest_key: end-to-end - <<: *defaults_e2e_test - - e2e-blacklist-token-contract: - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=e2e_blacklist_token_contract.test.ts - aztec_manifest_key: end-to-end - <<: *defaults_e2e_test - - # TODO(3458): Investigate intermittent failure - # e2e-slow-tree: - # docker: - # - image: aztecprotocol/alpine-build-image - # resource_class: small - # steps: - # - *checkout - # - *setup_env - # - run: - # name: "Test" - # command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=e2e_slow_tree.test.ts - # aztec_manifest_key: end-to-end - e2e-sandbox-example: steps: - *checkout - *setup_env - run: name: "Test" - command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=e2e_sandbox_example.test.ts - aztec_manifest_key: end-to-end - <<: *defaults_e2e_test - - e2e-state-vars: - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=e2e_state_vars.test.ts - aztec_manifest_key: end-to-end - <<: *defaults_e2e_test - - e2e-block-building: - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=e2e_block_building.test.ts - aztec_manifest_key: end-to-end - <<: *defaults_e2e_test - - e2e-nested-contract: - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=e2e_nested_contract.test.ts - aztec_manifest_key: end-to-end - <<: *defaults_e2e_test - - e2e-static-calls: - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=e2e_static_calls.test.ts - aztec_manifest_key: end-to-end - <<: *defaults_e2e_test - - e2e-delegate-calls: - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=e2e_delegate_calls.test.ts - aztec_manifest_key: end-to-end - <<: *defaults_e2e_test - - e2e-non-contract-account: - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=e2e_non_contract_account.test.ts - aztec_manifest_key: end-to-end - <<: *defaults_e2e_test - - e2e-cross-chain-messaging: - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=e2e_cross_chain_messaging.test.ts - aztec_manifest_key: end-to-end - <<: *defaults_e2e_test - - e2e-crowdfunding-and-claim: - docker: - - image: aztecprotocol/alpine-build-image - resource_class: small - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=e2e_crowdfunding_and_claim.test.ts - aztec_manifest_key: end-to-end - - e2e-public-cross-chain-messaging: - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=e2e_public_cross_chain_messaging.test.ts - aztec_manifest_key: end-to-end - <<: *defaults_e2e_test - - e2e-public-to-private-messaging: - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=e2e_public_to_private_messaging.test.ts - aztec_manifest_key: end-to-end - <<: *defaults_e2e_test - - e2e-account-contracts: - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=e2e_account_contracts.test.ts - aztec_manifest_key: end-to-end - <<: *defaults_e2e_test - - e2e-escrow-contract: - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=e2e_escrow_contract.test.ts - aztec_manifest_key: end-to-end - <<: *defaults_e2e_test - - e2e-inclusion-proofs-contract: - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=e2e_inclusion_proofs_contract.test.ts - aztec_manifest_key: end-to-end - <<: *defaults_e2e_test - - e2e-pending-note-hashes-contract: - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=e2e_pending_note_hashes_contract.test.ts - aztec_manifest_key: end-to-end - <<: *defaults_e2e_test - - e2e-ordering: - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=e2e_ordering.test.ts - aztec_manifest_key: end-to-end - <<: *defaults_e2e_test - - e2e-outbox: - docker: - - image: aztecprotocol/alpine-build-image - resource_class: small - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=e2e_outbox.test.ts + command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=composed/e2e_sandbox_example.test.ts aztec_manifest_key: end-to-end <<: *defaults_e2e_test @@ -945,7 +655,7 @@ jobs: - *setup_env - run: name: "Test" - command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=uniswap_trade_on_l1_from_l2.test.ts + command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=composed/uniswap_trade_on_l1_from_l2.test.ts aztec_manifest_key: end-to-end <<: *defaults_e2e_test @@ -955,17 +665,7 @@ jobs: - *setup_env - run: name: "Test" - command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=integration_l1_publisher.test.ts - aztec_manifest_key: end-to-end - <<: *defaults_e2e_test - - e2e-cli: - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=e2e_cli.test.ts + command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=composed/integration_l1_publisher.test.ts aztec_manifest_key: end-to-end <<: *defaults_e2e_test @@ -975,7 +675,7 @@ jobs: - *setup_env - run: name: "Test" - command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose-no-sandbox.yml TEST=e2e_persistence.test.ts + command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose-no-sandbox.yml TEST=composed/e2e_persistence.test.ts aztec_manifest_key: end-to-end <<: *defaults_e2e_test @@ -985,57 +685,7 @@ jobs: - *setup_env - run: name: "Test" - command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=e2e_aztec_js_browser.test.ts - aztec_manifest_key: end-to-end - <<: *defaults_e2e_test - - e2e-card-game: - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=e2e_card_game.test.ts - aztec_manifest_key: end-to-end - <<: *defaults_e2e_test - - e2e-avm-simulator: - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=e2e_avm_simulator.test.ts - aztec_manifest_key: end-to-end - <<: *defaults_e2e_test - - e2e-fees: - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=e2e_fees.test.ts ENABLE_GAS=1 - aztec_manifest_key: end-to-end - <<: *defaults_e2e_test - - e2e-account-init-fees: - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=e2e_account_init_fees.test.ts ENABLE_GAS=1 - aztec_manifest_key: end-to-end - <<: *defaults_e2e_test - - e2e-dapp-subscription: - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=e2e_dapp_subscription.test.ts ENABLE_GAS=1 + command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=composed/e2e_aztec_js_browser.test.ts aztec_manifest_key: end-to-end <<: *defaults_e2e_test @@ -1045,7 +695,7 @@ jobs: - *setup_env - run: name: "Test" - command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=pxe.test.ts + command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=composed/pxe.test.ts aztec_manifest_key: end-to-end <<: *defaults_e2e_test @@ -1055,7 +705,7 @@ jobs: - *setup_env - run: name: "Test" - command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=cli_docs_sandbox.test.ts + command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=composed/cli_docs_sandbox.test.ts aztec_manifest_key: end-to-end <<: *defaults_e2e_test @@ -1065,7 +715,7 @@ jobs: - *setup_env - run: name: "Test" - command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=docs_examples.test.ts + command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=composed/docs_examples.test.ts aztec_manifest_key: end-to-end <<: *defaults_e2e_test @@ -1476,48 +1126,15 @@ workflows: - aztec-package - cli <<: *defaults - - e2e-2-pxes: *e2e_test - - e2e-note-getter: *e2e_test - - e2e-deploy-contract: *e2e_test - - e2e-lending-contract: *e2e_test - - e2e-token-contract: *e2e_test - - e2e-authwit-test: *e2e_test - - e2e-blacklist-token-contract: *e2e_test - # TODO(3458): Investigate intermittent failure - # - e2e-slow-tree: *e2e_test + - e2e-tests: *e2e_test + - cli-docs-sandbox: *e2e_test + - e2e-docs-examples: *e2e_test + - e2e-browser: *e2e_test + - e2e-persistence: *e2e_test - e2e-sandbox-example: *e2e_test - - e2e-state-vars: *e2e_test - - e2e-block-building: *e2e_test - - e2e-nested-contract: *e2e_test - - e2e-static-calls: *e2e_test - - e2e-delegate-calls: *e2e_test - - e2e-non-contract-account: *e2e_test - - e2e-multiple-accounts-1-enc-key: *e2e_test - - e2e-cli: *e2e_test - - e2e-cross-chain-messaging: *e2e_test - - e2e-crowdfunding-and-claim: *e2e_test - - e2e-public-cross-chain-messaging: *e2e_test - - e2e-public-to-private-messaging: *e2e_test - - e2e-account-contracts: *e2e_test - - e2e-escrow-contract: *e2e_test - - e2e-inclusion-proofs-contract: *e2e_test - - e2e-pending-note-hashes-contract: *e2e_test - - e2e-ordering: *e2e_test - - e2e-outbox: *e2e_test - - e2e-counter: *e2e_test - - e2e-private-voting: *e2e_test - - uniswap-trade-on-l1-from-l2: *e2e_test - integration-l1-publisher: *e2e_test - - e2e-persistence: *e2e_test - - e2e-browser: *e2e_test - - e2e-card-game: *e2e_test - - e2e-avm-simulator: *e2e_test - - e2e-fees: *e2e_test - - e2e-account-init-fees: *e2e_test - - e2e-dapp-subscription: *e2e_test - pxe: *e2e_test - - cli-docs-sandbox: *e2e_test - - e2e-docs-examples: *e2e_test + - uniswap-trade-on-l1-from-l2: *e2e_test - guides-writing-an-account-contract: *e2e_test - guides-dapp-testing: *e2e_test - guides-sample-dapp: *e2e_test @@ -1545,52 +1162,21 @@ workflows: - barretenberg-docs - build-docs - mainnet-fork - - e2e-2-pxes - - e2e-note-getter - - e2e-deploy-contract - - e2e-lending-contract - - e2e-token-contract - - e2e-authwit-test - - e2e-blacklist-token-contract + - e2e-tests + - cli-docs-sandbox + - e2e-docs-examples + - e2e-browser + - e2e-persistence - e2e-sandbox-example - - e2e-state-vars - - e2e-block-building - - e2e-nested-contract - - e2e-static-calls - - e2e-delegate-calls - - e2e-non-contract-account - - e2e-multiple-accounts-1-enc-key - - e2e-cli - - e2e-cross-chain-messaging - - e2e-crowdfunding-and-claim - - e2e-public-cross-chain-messaging - - e2e-public-to-private-messaging - - e2e-account-contracts - - e2e-escrow-contract - - e2e-inclusion-proofs-contract - - e2e-pending-note-hashes-contract - - e2e-ordering - - e2e-outbox - - e2e-counter - - e2e-private-voting - - uniswap-trade-on-l1-from-l2 - integration-l1-publisher - - e2e-persistence - - e2e-browser - - e2e-card-game - - e2e-avm-simulator - - e2e-fees - - e2e-account-init-fees - - e2e-dapp-subscription - pxe - - boxes-vanilla - - boxes-react - - cli-docs-sandbox - - e2e-docs-examples + - uniswap-trade-on-l1-from-l2 - guides-writing-an-account-contract - guides-dapp-testing - guides-sample-dapp - guides-up-quick-start + - boxes-vanilla + - boxes-react - yellow-paper - noir-packages-tests - yarn-project-test diff --git a/build-system/scripts/cond_run_container b/build-system/scripts/cond_run_container index 80cbf8a91827..ca476831e311 100755 --- a/build-system/scripts/cond_run_container +++ b/build-system/scripts/cond_run_container @@ -20,6 +20,6 @@ if ! check_rebuild $SUCCESS_TAG $REPOSITORY; then # Login to pull our ecr images with docker. retry ecr_login retry docker pull $IMAGE_URI - docker run --rm -t $IMAGE_URI $@ + docker run --rm $IMAGE_URI $@ retry tag_remote_image $REPOSITORY $BASE_TAG $SUCCESS_TAG fi diff --git a/docs/docs/developers/aztecjs/guides/call_view_function.md b/docs/docs/developers/aztecjs/guides/call_view_function.md index 5028bded9971..4ff12b8e5fde 100644 --- a/docs/docs/developers/aztecjs/guides/call_view_function.md +++ b/docs/docs/developers/aztecjs/guides/call_view_function.md @@ -18,21 +18,22 @@ You can learn how to deploy a contract [here](./deploy_contract.md). You will need to import this from Aztec.js: -#include_code import_contract yarn-project/end-to-end/src/docs_examples.test.ts typescript +#include_code import_contract yarn-project/end-to-end/src/composed/docs_examples.test.ts typescript ## Define contract Get a previously deployed contract like this: -#include_code get_contract yarn-project/end-to-end/src/docs_examples.test.ts typescript +#include_code get_contract yarn-project/end-to-end/src/composed/docs_examples.test.ts typescript ## Simulating function calls Call the `simulate` function on the typescript contract wrapper like this: -#include_code simulate_function yarn-project/end-to-end/src/docs_examples.test.ts typescript +#include_code simulate_function yarn-project/end-to-end/src/composed/docs_examples.test.ts typescript :::info Note + - If the simulated function is `unconstrained` you will get a properly typed value. - If the simulated function is `public` or `private` it will return a Field array of size 4. -::: \ No newline at end of file + ::: diff --git a/docs/docs/developers/aztecjs/guides/create_account.md b/docs/docs/developers/aztecjs/guides/create_account.md index 47157cc6a0fb..9aacc62a851d 100644 --- a/docs/docs/developers/aztecjs/guides/create_account.md +++ b/docs/docs/developers/aztecjs/guides/create_account.md @@ -10,15 +10,14 @@ To do this from the CLI, go [here](../../sandbox/references/cli-commands.md#crea You will need to import these libraries: -#include_code create_account_imports yarn-project/end-to-end/src/docs_examples.test.ts typescript +#include_code create_account_imports yarn-project/end-to-end/src/composed/docs_examples.test.ts typescript ## Define arguments needed -#include_code define_account_vars yarn-project/end-to-end/src/docs_examples.test.ts typescript +#include_code define_account_vars yarn-project/end-to-end/src/composed/docs_examples.test.ts typescript ## Create the wallet with these args -#include_code create_wallet yarn-project/end-to-end/src/docs_examples.test.ts typescript +#include_code create_wallet yarn-project/end-to-end/src/composed/docs_examples.test.ts typescript Now you have a new wallet in your PXE! To learn how to use this wallet to deploy a contract, read [this guide](./deploy_contract.md). - diff --git a/docs/docs/developers/aztecjs/guides/deploy_contract.md b/docs/docs/developers/aztecjs/guides/deploy_contract.md index ffa565f33fa9..8f16fbe33641 100644 --- a/docs/docs/developers/aztecjs/guides/deploy_contract.md +++ b/docs/docs/developers/aztecjs/guides/deploy_contract.md @@ -16,12 +16,12 @@ You can read about contract artifacts [here](../../contracts/compiling_contracts ## Import the contract artifact -In this guide we are using a Token contract artifact. This comes from the [token contract tutorial](../../tutorials/writing_token_contract.md). +In this guide we are using a Token contract artifact. This comes from the [token contract tutorial](../../tutorials/writing_token_contract.md). -#include_code import_token_contract yarn-project/end-to-end/src/docs_examples.test.ts typescript +#include_code import_token_contract yarn-project/end-to-end/src/composed/docs_examples.test.ts typescript ## Deploy contract -#include_code deploy_contract yarn-project/end-to-end/src/docs_examples.test.ts typescript +#include_code deploy_contract yarn-project/end-to-end/src/composed/docs_examples.test.ts typescript -To learn how to send a transaction from Aztec.js read [this guide](./send_transaction.md). You can also call a `view` function from Aztec.js by reading [this guide](./call_view_function.md). \ No newline at end of file +To learn how to send a transaction from Aztec.js read [this guide](./send_transaction.md). You can also call a `view` function from Aztec.js by reading [this guide](./call_view_function.md). diff --git a/docs/docs/developers/aztecjs/guides/send_transaction.md b/docs/docs/developers/aztecjs/guides/send_transaction.md index 0e323c23af5e..cd05c5149421 100644 --- a/docs/docs/developers/aztecjs/guides/send_transaction.md +++ b/docs/docs/developers/aztecjs/guides/send_transaction.md @@ -18,14 +18,14 @@ You can learn how to deploy a contract [here](./deploy_contract.md). You will need to import this library: -#include_code import_contract yarn-project/end-to-end/src/docs_examples.test.ts typescript +#include_code import_contract yarn-project/end-to-end/src/composed/docs_examples.test.ts typescript ## Define contract Get a previously deployed contract like this: -#include_code get_contract yarn-project/end-to-end/src/docs_examples.test.ts typescript +#include_code get_contract yarn-project/end-to-end/src/composed/docs_examples.test.ts typescript ## Call method -#include_code send_transaction yarn-project/end-to-end/src/docs_examples.test.ts typescript +#include_code send_transaction yarn-project/end-to-end/src/composed/docs_examples.test.ts typescript diff --git a/docs/docs/developers/getting_started/aztecjs-getting-started.md b/docs/docs/developers/getting_started/aztecjs-getting-started.md index 330f9a787a37..5df8bf9f1a16 100644 --- a/docs/docs/developers/getting_started/aztecjs-getting-started.md +++ b/docs/docs/developers/getting_started/aztecjs-getting-started.md @@ -100,10 +100,10 @@ yarn add @aztec/aztec.js @aztec/accounts @aztec/noir-contracts.js typescript @ty 6. Create an `index.ts` file in the `src` directory with the following sandbox connection setup: ```ts -#include_code imports /yarn-project/end-to-end/src/e2e_sandbox_example.test.ts raw +#include_code imports /yarn-project/end-to-end/src/composed/e2e_sandbox_example.test.ts raw async function main() { -#include_code setup /yarn-project/end-to-end/src/e2e_sandbox_example.test.ts raw +#include_code setup /yarn-project/end-to-end/src/composed/e2e_sandbox_example.test.ts raw } main(); @@ -147,7 +147,7 @@ Great! The Sandbox is running and we are able to interact with it. The sandbox is preloaded with multiple accounts so you don't have to sit and create them. Let's load these accounts. Add this code to the `main()` function in `index.ts` below the code that's there: -#include_code load_accounts /yarn-project/end-to-end/src/e2e_sandbox_example.test.ts typescript +#include_code load_accounts /yarn-project/end-to-end/src/composed/e2e_sandbox_example.test.ts typescript An explanation on accounts on Aztec can be found [here](../../learn/concepts/accounts/main.md). @@ -157,7 +157,7 @@ If you want more accounts, you can find instructions in the [Account creation se Now that we have our accounts loaded, let's move on to deploy our pre-compiled token smart contract. You can find the full code for the contract [here](https://github.com/AztecProtocol/aztec-packages/tree/master/noir-projects/noir-contracts/contracts/token_contract/src). Add this to `index.ts` below the code you added earlier: -#include_code Deployment /yarn-project/end-to-end/src/e2e_sandbox_example.test.ts typescript +#include_code Deployment /yarn-project/end-to-end/src/composed/e2e_sandbox_example.test.ts typescript `yarn start` will now give something like this: @@ -205,7 +205,7 @@ A token contract wouldn't be very useful if you aren't able to query the balance Call the `balance_of_private` function using the following code (paste this): -#include_code Balance /yarn-project/end-to-end/src/e2e_sandbox_example.test.ts typescript +#include_code Balance /yarn-project/end-to-end/src/composed/e2e_sandbox_example.test.ts typescript Running now should yield output: @@ -263,7 +263,7 @@ Now lets transfer some funds from Alice to Bob by calling the `transfer` functio Here is the Typescript code to call the `transfer` function, add this to your `index.ts` at the bottom of the `main` function: -#include_code Transfer /yarn-project/end-to-end/src/e2e_sandbox_example.test.ts typescript +#include_code Transfer /yarn-project/end-to-end/src/composed/e2e_sandbox_example.test.ts typescript Our output should now look like this: @@ -316,7 +316,7 @@ To make the note spendable the note has to be redeemed. A user can do that by ca Let's now use these functions to mint some tokens to Bob's account using Typescript, add this to `index.ts`: -#include_code Mint /yarn-project/end-to-end/src/e2e_sandbox_example.test.ts typescript +#include_code Mint /yarn-project/end-to-end/src/composed/e2e_sandbox_example.test.ts typescript Our complete output should now be something like: diff --git a/docs/docs/developers/sandbox/references/cli-commands.md b/docs/docs/developers/sandbox/references/cli-commands.md index 7d3a14188366..b9a5b5fc8968 100644 --- a/docs/docs/developers/sandbox/references/cli-commands.md +++ b/docs/docs/developers/sandbox/references/cli-commands.md @@ -49,7 +49,7 @@ You can find more information about compiling contracts [on this page](../../con The first thing we want to do is create a couple of accounts. We will use the `create-account` command which will generate a new private key for us, register the account on the sandbox, and deploy a simple account contract which [uses a single key for privacy and authentication](../../../learn/concepts/accounts/keys.md): -#include_code create-account yarn-project/end-to-end/src/cli_docs_sandbox.test.ts bash +#include_code create-account yarn-project/end-to-end/src/composed/cli_docs_sandbox.test.ts bash Once the account is set up, the CLI returns the resulting address, its privacy key, and partial address. You can read more about these [here](../../../learn/concepts/accounts/keys.md#addresses-partial-addresses-and-public-keys). @@ -62,13 +62,13 @@ export PRIVATE_KEY= Alternatively, we can also manually generate a private key and use it for creating the account, either via a `-k` option or by setting the `PRIVATE_KEY` environment variable. -#include_code create-account-from-private-key yarn-project/end-to-end/src/cli_docs_sandbox.test.ts bash +#include_code create-account-from-private-key yarn-project/end-to-end/src/composed/cli_docs_sandbox.test.ts bash For all commands that require a user's private key, the CLI will look for the `PRIVATE_KEY` environment variable in absence of an optional argument. Let's double check that the accounts have been registered with the sandbox using the `get-accounts` command: -#include_code get-accounts yarn-project/end-to-end/src/cli_docs_sandbox.test.ts bash +#include_code get-accounts yarn-project/end-to-end/src/composed/cli_docs_sandbox.test.ts bash You will see that a number of accounts exist that we did not create. The Sandbox initializes itself with 3 default accounts. Save one of the printed accounts (not the one that you generated above) in an environment variable. We will use it later. @@ -81,7 +81,7 @@ export ADDRESS2= We will now deploy a token contract using the `deploy` command, and set an address of the admin via a constructor argument. You can find the contract we are deploying [here](https://github.com/AztecProtocol/aztec-packages/blob/master/noir-projects/noir-contracts/contracts/token_contract/src/main.nr) (or write it for yourself in [this tutorial!](../../tutorials/writing_token_contract.md)) Make sure to replace this address with one of the two you created earlier. -#include_code deploy yarn-project/end-to-end/src/cli_docs_sandbox.test.ts bash +#include_code deploy yarn-project/end-to-end/src/composed/cli_docs_sandbox.test.ts bash Save the contract address as an environment variable. We will use it later. @@ -93,7 +93,7 @@ export CONTRACT_ADDRESS= The CLI tells us that the contract was successfully deployed. We can use the `check-deploy` command to verify that a contract has been successfully deployed to that address: -#include_code check-deploy yarn-project/end-to-end/src/cli_docs_sandbox.test.ts bash +#include_code check-deploy yarn-project/end-to-end/src/composed/cli_docs_sandbox.test.ts bash ## Sending a Transaction @@ -106,19 +106,19 @@ The `send` command expect the function name as the first unnamed argument and th - `--contract-address` - The deployed address of the contract to call. - `--private-key` - The private key of the sender. -#include_code send yarn-project/end-to-end/src/cli_docs_sandbox.test.ts bash +#include_code send yarn-project/end-to-end/src/composed/cli_docs_sandbox.test.ts bash We called the [`mint_public`](https://github.com/AztecProtocol/aztec-packages/blob/87fa621347e55f82e36c70515c1824161eee5282/noir-projects/noir-contracts/contracts/token_contract/src/main.nr#L157C10-L157C10) function and provided it with the 2 arguments it expects: the recipient's address and the amount to be minted. Make sure to replace all addresses in this command with yours. The command output tells us the details of the transaction such as its hash and status. We can use this hash to query the receipt of the transaction at a later time: -#include_code get-tx-receipt yarn-project/end-to-end/src/cli_docs_sandbox.test.ts bash +#include_code get-tx-receipt yarn-project/end-to-end/src/composed/cli_docs_sandbox.test.ts bash ## Calling an Unconstrained (View) Function Now that the `mint_public` tx has been settled we can call the `balance_of_public` unconstrained function: -#include_code call yarn-project/end-to-end/src/cli_docs_sandbox.test.ts bash +#include_code call yarn-project/end-to-end/src/composed/cli_docs_sandbox.test.ts bash The `call` command calls a read-only method on a contract, one that will not generate a transaction to be sent to the network. The arguments here are: diff --git a/docs/docs/developers/sandbox/references/sandbox-reference.md b/docs/docs/developers/sandbox/references/sandbox-reference.md index c454b16f9b9f..e25b3b02eba6 100644 --- a/docs/docs/developers/sandbox/references/sandbox-reference.md +++ b/docs/docs/developers/sandbox/references/sandbox-reference.md @@ -206,6 +206,6 @@ TokenContractArtifact UniswapContractArtifact ``` -> Source code: /yarn-project/end-to-end/src/cli_docs_sandbox.test.ts#L95-L118 +> Source code: /yarn-project/end-to-end/src/composed/cli_docs_sandbox.test.ts#L95-L118 You can see all of our example contracts in the monorepo [here](https://github.com/AztecProtocol/aztec-packages/tree/master/noir-projects/noir-contracts/contracts). diff --git a/docs/docs/developers/tutorials/uniswap/typescript_glue_code.md b/docs/docs/developers/tutorials/uniswap/typescript_glue_code.md index 3bc026658e57..805a92498268 100644 --- a/docs/docs/developers/tutorials/uniswap/typescript_glue_code.md +++ b/docs/docs/developers/tutorials/uniswap/typescript_glue_code.md @@ -120,7 +120,7 @@ const hdAccount = mnemonicToAccount(MNEMONIC); const expectedForkBlockNumber = 17514288; #include_code uniswap_l1_l2_test_setup_const yarn-project/end-to-end/src/shared/uniswap_l1_l2.ts raw -#include_code uniswap_setup yarn-project/end-to-end/src/uniswap_trade_on_l1_from_l2.test.ts raw +#include_code uniswap_setup yarn-project/end-to-end/src/composed/uniswap_trade_on_l1_from_l2.test.ts raw #include_code uniswap_l1_l2_test_beforeAll yarn-project/end-to-end/src/shared/uniswap_l1_l2.ts raw ``` diff --git a/docs/docs/developers/wallets/creating_schnorr_accounts.md b/docs/docs/developers/wallets/creating_schnorr_accounts.md index 1ac1443ace64..a2b4cefd98fb 100644 --- a/docs/docs/developers/wallets/creating_schnorr_accounts.md +++ b/docs/docs/developers/wallets/creating_schnorr_accounts.md @@ -21,11 +21,11 @@ Let's assume you have a file `src/index.ts` from the example used in the Sandbox 1. Import relevant modules: -#include_code imports /yarn-project/end-to-end/src/e2e_sandbox_example.test.ts typescript +#include_code imports /yarn-project/end-to-end/src/composed/e2e_sandbox_example.test.ts typescript 2. Code to create an account. You must run this inside of a function: -#include_code create_accounts /yarn-project/end-to-end/src/e2e_sandbox_example.test.ts typescript +#include_code create_accounts /yarn-project/end-to-end/src/composed/e2e_sandbox_example.test.ts typescript 3. Running `yarn start` should now output: diff --git a/yarn-project/end-to-end/Earthfile b/yarn-project/end-to-end/Earthfile index 85f737250a0c..4e52cea2c252 100644 --- a/yarn-project/end-to-end/Earthfile +++ b/yarn-project/end-to-end/Earthfile @@ -82,130 +82,16 @@ E2E_TEST: END # Define e2e tests -e2e-2-pxes: - ARG e2e_mode=local - DO +E2E_TEST --test=e2e_2_pxes.test.ts --e2e_mode=$e2e_mode - -e2e-auth-contract: - ARG e2e_mode=local - DO +E2E_TEST --test=e2e_auth_contract.test.ts --e2e_mode=$e2e_mode - -e2e-note-getter: - ARG e2e_mode=local - DO +E2E_TEST --test=e2e_note_getter.test.ts --e2e_mode=$e2e_mode - -e2e-counter: - ARG e2e_mode=local - DO +E2E_TEST --test=e2e_counter_contract.test.ts --e2e_mode=$e2e_mode - -e2e-private-voting: - ARG e2e_mode=local - DO +E2E_TEST --test=e2e_private_voting_contract.test.ts --e2e_mode=$e2e_mode - -e2e-max-block-number: - ARG e2e_mode=local - DO +E2E_TEST --test=e2e_max_block_number.test.ts --e2e_mode=$e2e_mode - -e2e-multiple-accounts-1-enc-key: - ARG e2e_mode=local - DO +E2E_TEST --test=e2e_multiple_accounts_1_enc_key.test.ts --e2e_mode=$e2e_mode - -e2e-deploy-contract: +e2e-tests: LOCALLY WITH DOCKER --load end-to-end=../+end-to-end - RUN docker run --rm -e LOG_LEVEL=silent -e DEBUG=aztec:e2e* end-to-end ./src/e2e_deploy_contract/ + RUN docker run --rm -e LOG_LEVEL=silent -e DEBUG=aztec:e2e* end-to-end ./src/e2e END -e2e-lending-contract: - ARG e2e_mode=local - DO +E2E_TEST --test=e2e_lending_contract.test.ts --e2e_mode=$e2e_mode - -e2e-token-contract: - LOCALLY - WITH DOCKER --load end-to-end=../+end-to-end - RUN docker run --rm -e LOG_LEVEL=silent -e DEBUG=aztec:e2e* end-to-end ./src/e2e_token_contract/ - END - -e2e-authwit-test: - ARG e2e_mode=local - DO +E2E_TEST --test=e2e_authwit.test.ts --e2e_mode=$e2e_mode - -e2e-blacklist-token-contract: - ARG e2e_mode=local - DO +E2E_TEST --test=e2e_blacklist_token_contract.test.ts --e2e_mode=$e2e_mode - -# TODO(3458): Investigate intermittent failure -# e2e-slow-tree: -# DO +E2E_TEST --test=e2e_slow_tree - e2e-sandbox-example: ARG e2e_mode=local DO +E2E_TEST --test=e2e_sandbox_example.test.ts --e2e_mode=$e2e_mode -e2e-state-vars: - ARG e2e_mode=local - DO +E2E_TEST --test=e2e_state_vars.test.ts --e2e_mode=$e2e_mode - -e2e-block-building: - ARG e2e_mode=local - DO +E2E_TEST --test=e2e_block_building.test.ts --e2e_mode=$e2e_mode - -e2e-nested-contract: - ARG e2e_mode=local - DO +E2E_TEST --test=e2e_nested_contract.test.ts --e2e_mode=$e2e_mode - -e2e-static-calls: - ARG e2e_mode=local - DO +E2E_TEST --test=e2e_static_calls.test.ts --e2e_mode=$e2e_mode - -e2e-delegate-calls: - ARG e2e_mode=local - DO +E2E_TEST --test=e2e_delegate_calls.test.ts --e2e_mode=$e2e_mode - -e2e-non-contract-account: - ARG e2e_mode=local - DO +E2E_TEST --test=e2e_non_contract_account.test.ts --e2e_mode=$e2e_mode - -e2e-cross-chain-messaging: - ARG e2e_mode=local - DO +E2E_TEST --test=e2e_cross_chain_messaging.test.ts --e2e_mode=$e2e_mode - -e2e-crowdfunding-and-claim: - ARG e2e_mode=local - DO +E2E_TEST --test=e2e_crowdfunding_and_claim.test.ts --e2e_mode=$e2e_mode - -e2e-public-cross-chain-messaging: - ARG e2e_mode=local - DO +E2E_TEST --test=e2e_public_cross_chain_messaging.test.ts --e2e_mode=$e2e_mode - -e2e-public-to-private-messaging: - ARG e2e_mode=local - DO +E2E_TEST --test=e2e_public_to_private_messaging.test.ts --e2e_mode=$e2e_mode - -e2e-account-contracts: - ARG e2e_mode=local - DO +E2E_TEST --test=e2e_account_contracts.test.ts --e2e_mode=$e2e_mode - -e2e-escrow-contract: - ARG e2e_mode=local - DO +E2E_TEST --test=e2e_escrow_contract.test.ts --e2e_mode=$e2e_mode - -e2e-inclusion-proofs-contract: - ARG e2e_mode=local - DO +E2E_TEST --test=e2e_inclusion_proofs_contract.test.ts --e2e_mode=$e2e_mode - -e2e-pending-note-hashes-contract: - ARG e2e_mode=local - DO +E2E_TEST --test=e2e_pending_note_hashes_contract.test.ts --e2e_mode=$e2e_mode - -e2e-ordering: - ARG e2e_mode=local - DO +E2E_TEST --test=e2e_ordering.test.ts --e2e_mode=$e2e_mode - -e2e-outbox: - ARG e2e_mode=local - DO +E2E_TEST --test=e2e_outbox.test.ts --e2e_mode=$e2e_mode - uniswap-trade-on-l1-from-l2: ARG e2e_mode=local DO +E2E_TEST --test=uniswap_trade_on_l1_from_l2.test.ts --e2e_mode=$e2e_mode @@ -214,35 +100,10 @@ integration-l1-publisher: ARG e2e_mode=local DO +E2E_TEST --test=integration_l1_publisher.test.ts --e2e_mode=$e2e_mode -e2e-cli: - ARG e2e_mode=local - DO +E2E_TEST --test=e2e_cli.test.ts --e2e_mode=$e2e_mode - -# TODO sometimes hangs -# e2e-persistence: -# ARG e2e_mode=local -# DO +E2E_TEST --test=e2e_persistence.test.ts --compose_file=./scripts/docker-compose-no-sandbox.yml --e2e_mode=$e2e_mode - e2e-browser: ARG e2e_mode=local DO +E2E_TEST --test=e2e_aztec_js_browser.test.ts --e2e_mode=$e2e_mode -e2e-card-game: - ARG e2e_mode=local - DO +E2E_TEST --test=e2e_card_game.test.ts --e2e_mode=$e2e_mode - -e2e-avm-simulator: - ARG e2e_mode=local - DO +E2E_TEST --test=e2e_avm_simulator.test.ts --e2e_mode=$e2e_mode - -e2e-fees: - ARG e2e_mode=local - DO +E2E_TEST --test=e2e_fees.test.ts --enable_gas=1 --e2e_mode=$e2e_mode - -e2e-dapp-subscription: - ARG e2e_mode=local - DO +E2E_TEST --test=e2e_dapp_subscription.test.ts --enable_gas=1 --e2e_mode=$e2e_mode - pxe: ARG e2e_mode=local DO +E2E_TEST --test=pxe.test.ts --e2e_mode=$e2e_mode diff --git a/yarn-project/end-to-end/package.json b/yarn-project/end-to-end/package.json index f49c55a71e7f..a430486bb51d 100644 --- a/yarn-project/end-to-end/package.json +++ b/yarn-project/end-to-end/package.json @@ -15,7 +15,7 @@ "clean": "rm -rf ./dest .tsbuildinfo", "formatting": "run -T prettier --check ./src \"!src/web/main.js\" && run -T eslint ./src", "formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src", - "test": "LOG_LEVEL=${LOG_LEVEL:-verbose} DEBUG_COLORS=1 NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=120000 --forceExit", + "test": "LOG_LEVEL=${LOG_LEVEL:-silent} DEBUG=${DEBUG:-'aztec:e2e*'} DEBUG_COLORS=1 NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=120000 --forceExit", "test:integration": "concurrently -k -s first -c reset,dim -n test,anvil \"yarn test:integration:run\" \"anvil\"", "test:integration:run": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --no-cache --runInBand --config jest.integration.config.json" }, @@ -102,7 +102,7 @@ "node": ">=18" }, "jest": { - "slowTestThreshold": 180, + "slowTestThreshold": 300, "extensionsToTreatAsEsm": [ ".ts" ], diff --git a/yarn-project/end-to-end/package.local.json b/yarn-project/end-to-end/package.local.json index 9c4d44ff2892..49ec2d491bcd 100644 --- a/yarn-project/end-to-end/package.local.json +++ b/yarn-project/end-to-end/package.local.json @@ -2,6 +2,6 @@ "scripts": { "build": "yarn clean && tsc -b && webpack", "formatting": "run -T prettier --check ./src \"!src/web/main.js\" && run -T eslint ./src", - "test": "LOG_LEVEL=${LOG_LEVEL:-verbose} DEBUG_COLORS=1 NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=120000 --forceExit" + "test": "LOG_LEVEL=${LOG_LEVEL:-silent} DEBUG=${DEBUG:-'aztec:e2e*'} DEBUG_COLORS=1 NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=120000 --forceExit" } } diff --git a/yarn-project/end-to-end/src/benchmarks/bench_tx_size_fees.test.ts b/yarn-project/end-to-end/src/benchmarks/bench_tx_size_fees.test.ts index 9cd8fcfe741e..493fc8933753 100644 --- a/yarn-project/end-to-end/src/benchmarks/bench_tx_size_fees.test.ts +++ b/yarn-project/end-to-end/src/benchmarks/bench_tx_size_fees.test.ts @@ -28,8 +28,7 @@ describe('benchmarks/tx_size_fees', () => { // setup the environment beforeAll(async () => { - process.env.ENABLE_GAS ??= '1'; - const { wallets, aztecNode, deployL1ContractsValues } = await setup(3); + const { wallets, aztecNode, deployL1ContractsValues } = await setup(3, {}, {}, true); gasPortalAddress = deployL1ContractsValues.l1ContractAddresses.gasPortalAddress; diff --git a/yarn-project/end-to-end/src/cli_docs_sandbox.test.ts b/yarn-project/end-to-end/src/composed/cli_docs_sandbox.test.ts similarity index 100% rename from yarn-project/end-to-end/src/cli_docs_sandbox.test.ts rename to yarn-project/end-to-end/src/composed/cli_docs_sandbox.test.ts diff --git a/yarn-project/end-to-end/src/docs_examples.test.ts b/yarn-project/end-to-end/src/composed/docs_examples.test.ts similarity index 100% rename from yarn-project/end-to-end/src/docs_examples.test.ts rename to yarn-project/end-to-end/src/composed/docs_examples.test.ts diff --git a/yarn-project/end-to-end/src/e2e_aztec_js_browser.test.ts b/yarn-project/end-to-end/src/composed/e2e_aztec_js_browser.test.ts similarity index 91% rename from yarn-project/end-to-end/src/e2e_aztec_js_browser.test.ts rename to yarn-project/end-to-end/src/composed/e2e_aztec_js_browser.test.ts index d9fac6ce3d14..d96397f05c8a 100644 --- a/yarn-project/end-to-end/src/e2e_aztec_js_browser.test.ts +++ b/yarn-project/end-to-end/src/composed/e2e_aztec_js_browser.test.ts @@ -5,8 +5,8 @@ import Koa from 'koa'; import serve from 'koa-static'; import path, { dirname } from 'path'; -import { setup } from './fixtures/utils.js'; -import { browserTestSuite } from './shared/browser.js'; +import { setup } from '../fixtures/utils.js'; +import { browserTestSuite } from '../shared/browser.js'; const { PXE_URL = '' } = process.env; @@ -41,7 +41,7 @@ const setupApp = async () => { } const app = new Koa(); - app.use(serve(path.resolve(__dirname, './web'))); + app.use(serve(path.resolve(__dirname, '../web'))); const server = app.listen(PORT, () => { logger.info(`Web Server started at http://localhost:${PORT}`); }); diff --git a/yarn-project/end-to-end/src/e2e_persistence.test.ts b/yarn-project/end-to-end/src/composed/e2e_persistence.test.ts similarity index 99% rename from yarn-project/end-to-end/src/e2e_persistence.test.ts rename to yarn-project/end-to-end/src/composed/e2e_persistence.test.ts index cc44b29499f6..8138ea8f0a79 100644 --- a/yarn-project/end-to-end/src/e2e_persistence.test.ts +++ b/yarn-project/end-to-end/src/composed/e2e_persistence.test.ts @@ -18,7 +18,7 @@ import { mkdtemp } from 'fs/promises'; import { tmpdir } from 'os'; import { join } from 'path'; -import { type EndToEndContext, setup } from './fixtures/utils.js'; +import { type EndToEndContext, setup } from '../fixtures/utils.js'; jest.setTimeout(60_000); diff --git a/yarn-project/end-to-end/src/e2e_sandbox_example.test.ts b/yarn-project/end-to-end/src/composed/e2e_sandbox_example.test.ts similarity index 100% rename from yarn-project/end-to-end/src/e2e_sandbox_example.test.ts rename to yarn-project/end-to-end/src/composed/e2e_sandbox_example.test.ts diff --git a/yarn-project/end-to-end/src/integration_l1_publisher.test.ts b/yarn-project/end-to-end/src/composed/integration_l1_publisher.test.ts similarity index 99% rename from yarn-project/end-to-end/src/integration_l1_publisher.test.ts rename to yarn-project/end-to-end/src/composed/integration_l1_publisher.test.ts index 7d511f2a34cc..3ee53ecbc72b 100644 --- a/yarn-project/end-to-end/src/integration_l1_publisher.test.ts +++ b/yarn-project/end-to-end/src/composed/integration_l1_publisher.test.ts @@ -59,7 +59,7 @@ import { } from 'viem'; import { type PrivateKeyAccount, privateKeyToAccount } from 'viem/accounts'; -import { setupL1Contracts } from './fixtures/utils.js'; +import { setupL1Contracts } from '../fixtures/utils.js'; // Accounts 4 and 5 of Anvil default startup with mnemonic: 'test test test test test test test test test test test junk' const sequencerPK = '0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a'; diff --git a/yarn-project/end-to-end/src/pxe.test.ts b/yarn-project/end-to-end/src/composed/pxe.test.ts similarity index 83% rename from yarn-project/end-to-end/src/pxe.test.ts rename to yarn-project/end-to-end/src/composed/pxe.test.ts index 0b355e3b8030..6e972b8eb6e7 100644 --- a/yarn-project/end-to-end/src/pxe.test.ts +++ b/yarn-project/end-to-end/src/composed/pxe.test.ts @@ -1,7 +1,7 @@ import { waitForPXE } from '@aztec/aztec.js'; import { pxeTestSuite } from '@aztec/pxe'; -import { setup } from './fixtures/utils.js'; +import { setup } from '../fixtures/utils.js'; const setupEnv = async () => { const { pxe } = await setup(0); diff --git a/yarn-project/end-to-end/src/uniswap_trade_on_l1_from_l2.test.ts b/yarn-project/end-to-end/src/composed/uniswap_trade_on_l1_from_l2.test.ts similarity index 92% rename from yarn-project/end-to-end/src/uniswap_trade_on_l1_from_l2.test.ts rename to yarn-project/end-to-end/src/composed/uniswap_trade_on_l1_from_l2.test.ts index f4bf1b92efd7..02cdc8affee0 100644 --- a/yarn-project/end-to-end/src/uniswap_trade_on_l1_from_l2.test.ts +++ b/yarn-project/end-to-end/src/composed/uniswap_trade_on_l1_from_l2.test.ts @@ -1,5 +1,5 @@ -import { setup as e2eSetup } from './fixtures/utils.js'; -import { type UniswapSetupContext, uniswapL1L2TestSuite } from './shared/uniswap_l1_l2.js'; +import { setup as e2eSetup } from '../fixtures/utils.js'; +import { type UniswapSetupContext, uniswapL1L2TestSuite } from '../shared/uniswap_l1_l2.js'; // This tests works on forked mainnet. There is a dump of the data in `dumpedState` such that we // don't need to burn through RPC requests. diff --git a/yarn-project/end-to-end/src/e2e_account_init_fees.test.ts b/yarn-project/end-to-end/src/e2e_account_init_fees.test.ts index 106610bbe45f..94f7321a0ae9 100644 --- a/yarn-project/end-to-end/src/e2e_account_init_fees.test.ts +++ b/yarn-project/end-to-end/src/e2e_account_init_fees.test.ts @@ -83,8 +83,7 @@ describe('e2e_fees_account_init', () => { } beforeAll(async () => { - process.env.ENABLE_GAS ??= '1'; - ctx = await setup(2); + ctx = await setup(2, {}, {}, true); logger = ctx.logger; [sequencer, alice] = ctx.wallets; sequencersAddress = sequencer.getAddress(); diff --git a/yarn-project/end-to-end/src/e2e_dapp_subscription.test.ts b/yarn-project/end-to-end/src/e2e_dapp_subscription.test.ts index c59164e66a4b..e4865c1ac5a6 100644 --- a/yarn-project/end-to-end/src/e2e_dapp_subscription.test.ts +++ b/yarn-project/end-to-end/src/e2e_dapp_subscription.test.ts @@ -21,12 +21,8 @@ import { } from '@aztec/noir-contracts.js'; import { getCanonicalGasTokenAddress } from '@aztec/protocol-contracts/gas-token'; -import { jest } from '@jest/globals'; - import { type BalancesFn, expectMapping, getBalancesFn, publicDeployAccounts, setup } from './fixtures/utils.js'; -jest.setTimeout(100_000); - const TOKEN_NAME = 'BananaCoin'; const TOKEN_SYMBOL = 'BC'; const TOKEN_DECIMALS = 18n; @@ -66,7 +62,7 @@ describe('e2e_dapp_subscription', () => { let wallets: AccountWalletWithPrivateKey[]; let aztecNode: AztecNode; let deployL1ContractsValues: DeployL1Contracts; - ({ wallets, aztecNode, deployL1ContractsValues, logger, pxe } = await setup(3)); + ({ wallets, aztecNode, deployL1ContractsValues, logger, pxe } = await setup(3, {}, {}, true)); await publicDeployAccounts(wallets[0], wallets); diff --git a/yarn-project/end-to-end/src/e2e_fees.test.ts b/yarn-project/end-to-end/src/e2e_fees.test.ts index 1a2ea85cfc88..010b5a0da443 100644 --- a/yarn-project/end-to-end/src/e2e_fees.test.ts +++ b/yarn-project/end-to-end/src/e2e_fees.test.ts @@ -54,8 +54,7 @@ describe('e2e_fees', () => { let bananaPrivateBalances: BalancesFn; beforeAll(async () => { - process.env.ENABLE_GAS ??= '1'; - const { wallets: _wallets, aztecNode, deployL1ContractsValues, logger, pxe } = await setup(3); + const { wallets: _wallets, aztecNode, deployL1ContractsValues, logger, pxe } = await setup(3, {}, {}, true); wallets = _wallets; logFunctionSignatures(BananaCoin.artifact, logger); diff --git a/yarn-project/end-to-end/src/fixtures/utils.ts b/yarn-project/end-to-end/src/fixtures/utils.ts index 75ae455a9958..fbd83539d978 100644 --- a/yarn-project/end-to-end/src/fixtures/utils.ts +++ b/yarn-project/end-to-end/src/fixtures/utils.ts @@ -221,6 +221,7 @@ async function setupWithRemoteEnvironment( config: AztecNodeConfig, logger: DebugLogger, numberOfAccounts: number, + enableGas: boolean, ) { // we are setting up against a remote environment, l1 contracts are already deployed const aztecNodeUrl = getAztecUrl(); @@ -258,7 +259,7 @@ async function setupWithRemoteEnvironment( const cheatCodes = CheatCodes.create(config.rpcUrl, pxeClient!); const teardown = () => Promise.resolve(); - if (['1', 'true'].includes(process.env.ENABLE_GAS!)) { + if (enableGas) { const { chainId, protocolVersion } = await pxeClient.getNodeInfo(); // this contract might already have been deployed // the following function is idempotent @@ -324,6 +325,7 @@ export async function setup( numberOfAccounts = 1, opts: SetupOptions = {}, pxeOpts: Partial = {}, + enableGas = false, ): Promise { const config = { ...getConfigEnvVars(), ...opts }; @@ -364,7 +366,7 @@ export async function setup( if (PXE_URL) { // we are setting up against a remote environment, l1 contracts are assumed to already be deployed - return await setupWithRemoteEnvironment(hdAccount, config, logger, numberOfAccounts); + return await setupWithRemoteEnvironment(hdAccount, config, logger, numberOfAccounts, enableGas); } const deployL1ContractsValues = @@ -387,7 +389,7 @@ export async function setup( logger.verbose('Creating a pxe...'); const { pxe, wallets } = await setupPXEService(numberOfAccounts, aztecNode!, pxeOpts, logger); - if (['1', 'true'].includes(process.env.ENABLE_GAS!)) { + if (enableGas) { await deployCanonicalGasToken( new SignerlessWallet(pxe, new DefaultMultiCallEntrypoint(config.chainId, config.version)), );