@aztec/end-to-end 0.0.1-commit.d3ec352c → 0.0.1-commit.d58ff9d0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +217 -14
- package/dest/automine/automine_test_context.d.ts +85 -0
- package/dest/automine/automine_test_context.d.ts.map +1 -0
- package/dest/automine/automine_test_context.js +98 -0
- package/dest/automine/contracts/fixtures/storage_proof_fetcher.d.ts +2 -0
- package/dest/automine/contracts/fixtures/storage_proof_fetcher.d.ts.map +1 -0
- package/dest/automine/contracts/fixtures/storage_proof_fetcher.js +184 -0
- package/dest/automine/contracts/fixtures/storage_proof_fixture.d.ts +18 -0
- package/dest/automine/contracts/fixtures/storage_proof_fixture.d.ts.map +1 -0
- package/dest/automine/contracts/fixtures/storage_proof_fixture.js +120 -0
- package/dest/automine/delivery/interactive_handshake_responder.d.ts +48 -0
- package/dest/automine/delivery/interactive_handshake_responder.d.ts.map +1 -0
- package/dest/automine/delivery/interactive_handshake_responder.js +76 -0
- package/dest/automine/delivery/onchain_delivery_harness.d.ts +19 -0
- package/dest/automine/delivery/onchain_delivery_harness.d.ts.map +1 -0
- package/dest/automine/delivery/onchain_delivery_harness.js +141 -0
- package/dest/automine/token/blacklist_token_contract_test.d.ts +49 -0
- package/dest/automine/token/blacklist_token_contract_test.d.ts.map +1 -0
- package/dest/automine/token/blacklist_token_contract_test.js +166 -0
- package/dest/automine/token/token_contract_test.d.ts +40 -0
- package/dest/automine/token/token_contract_test.d.ts.map +1 -0
- package/dest/automine/token/token_contract_test.js +119 -0
- package/dest/automine/token/token_test_helpers.d.ts +73 -0
- package/dest/automine/token/token_test_helpers.d.ts.map +1 -0
- package/dest/automine/token/token_test_helpers.js +97 -0
- package/dest/bench/client_flows/benchmark.d.ts +17 -2
- package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/benchmark.js +40 -1
- package/dest/bench/client_flows/client_flows_benchmark.d.ts +19 -20
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +155 -159
- package/dest/bench/client_flows/config.d.ts +2 -2
- package/dest/bench/client_flows/config.d.ts.map +1 -1
- package/dest/bench/client_flows/config.js +18 -0
- package/dest/bench/client_flows/data_extractor.js +4 -1
- package/dest/bench/utils.d.ts +11 -10
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +126 -23
- package/dest/composed/ha/ha_full_setup.d.ts +77 -0
- package/dest/composed/ha/ha_full_setup.d.ts.map +1 -0
- package/dest/composed/ha/ha_full_setup.js +383 -0
- package/dest/composed/web3signer/multi_validator_keystore_utils.d.ts +12 -0
- package/dest/composed/web3signer/multi_validator_keystore_utils.d.ts.map +1 -0
- package/dest/{e2e_multi_validator/utils.js → composed/web3signer/multi_validator_keystore_utils.js} +1 -1
- package/dest/fixtures/authwit_proxy.d.ts +15 -0
- package/dest/fixtures/authwit_proxy.d.ts.map +1 -0
- package/dest/fixtures/authwit_proxy.js +34 -0
- package/dest/fixtures/e2e_prover_test.d.ts +25 -29
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +147 -151
- package/dest/fixtures/elu_monitor.d.ts +21 -0
- package/dest/fixtures/elu_monitor.d.ts.map +1 -0
- package/dest/fixtures/elu_monitor.js +102 -0
- package/dest/fixtures/fixtures.d.ts +84 -3
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/fixtures.js +87 -2
- package/dest/fixtures/get_acvm_config.js +1 -1
- package/dest/fixtures/get_bb_config.d.ts +1 -1
- package/dest/fixtures/get_bb_config.d.ts.map +1 -1
- package/dest/fixtures/get_bb_config.js +5 -5
- package/dest/fixtures/ha_setup.d.ts +71 -0
- package/dest/fixtures/ha_setup.d.ts.map +1 -0
- package/dest/fixtures/ha_setup.js +119 -0
- package/dest/fixtures/index.d.ts +3 -1
- package/dest/fixtures/index.d.ts.map +1 -1
- package/dest/fixtures/index.js +2 -0
- package/dest/fixtures/l1_to_l2_messaging.d.ts +4 -3
- package/dest/fixtures/l1_to_l2_messaging.d.ts.map +1 -1
- package/dest/fixtures/l1_to_l2_messaging.js +2 -2
- package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts +25 -0
- package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts.map +1 -0
- package/dest/fixtures/schnorr_hardcoded_account_contract.js +37 -0
- package/dest/fixtures/setup.d.ts +269 -0
- package/dest/fixtures/setup.d.ts.map +1 -0
- package/dest/fixtures/setup.js +688 -0
- package/dest/fixtures/setup_p2p_test.d.ts +22 -11
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +49 -38
- package/dest/fixtures/timing.d.ts +42 -0
- package/dest/fixtures/timing.d.ts.map +1 -0
- package/dest/fixtures/timing.js +72 -0
- package/dest/fixtures/token_utils.d.ts +22 -4
- package/dest/fixtures/token_utils.d.ts.map +1 -1
- package/dest/fixtures/token_utils.js +28 -7
- package/dest/fixtures/utils.d.ts +5 -638
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +4 -647
- package/dest/fixtures/wait_helpers.d.ts +135 -0
- package/dest/fixtures/wait_helpers.d.ts.map +1 -0
- package/dest/fixtures/wait_helpers.js +154 -0
- package/dest/fixtures/web3signer.js +1 -1
- package/dest/fixtures/with_telemetry_utils.d.ts +2 -2
- package/dest/fixtures/with_telemetry_utils.d.ts.map +1 -1
- package/dest/fixtures/with_telemetry_utils.js +2 -2
- package/dest/forward-compatibility/wallet_rpc_client.d.ts +7 -0
- package/dest/forward-compatibility/wallet_rpc_client.d.ts.map +1 -0
- package/dest/forward-compatibility/wallet_rpc_client.js +15 -0
- package/dest/forward-compatibility/wallet_service.d.ts +3 -0
- package/dest/forward-compatibility/wallet_service.d.ts.map +1 -0
- package/dest/forward-compatibility/wallet_service.js +109 -0
- package/dest/install_legacy_contracts.d.cts +10 -0
- package/dest/install_legacy_contracts.d.cts.map +1 -0
- package/dest/legacy-jest-resolver.d.cts +3 -0
- package/dest/legacy-jest-resolver.d.cts.map +1 -0
- package/dest/multi-node/block-production/setup.d.ts +97 -0
- package/dest/multi-node/block-production/setup.d.ts.map +1 -0
- package/dest/multi-node/block-production/setup.js +158 -0
- package/dest/multi-node/governance/setup.d.ts +67 -0
- package/dest/multi-node/governance/setup.d.ts.map +1 -0
- package/dest/multi-node/governance/setup.js +126 -0
- package/dest/multi-node/multi_node_test_context.d.ts +212 -0
- package/dest/multi-node/multi_node_test_context.d.ts.map +1 -0
- package/dest/multi-node/multi_node_test_context.js +347 -0
- package/dest/multi-node/slashing/inactivity_setup.d.ts +27 -0
- package/dest/multi-node/slashing/inactivity_setup.d.ts.map +1 -0
- package/dest/multi-node/slashing/inactivity_setup.js +111 -0
- package/dest/multi-node/slashing/setup.d.ts +167 -0
- package/dest/multi-node/slashing/setup.d.ts.map +1 -0
- package/dest/multi-node/slashing/setup.js +275 -0
- package/dest/{e2e_p2p → p2p}/p2p_network.d.ts +33 -21
- package/dest/p2p/p2p_network.d.ts.map +1 -0
- package/dest/p2p/p2p_network.js +389 -0
- package/dest/p2p/reqresp/utils.d.ts +19 -0
- package/dest/p2p/reqresp/utils.d.ts.map +1 -0
- package/dest/p2p/reqresp/utils.js +193 -0
- package/dest/p2p/shared.d.ts +72 -0
- package/dest/p2p/shared.d.ts.map +1 -0
- package/dest/p2p/shared.js +212 -0
- package/dest/quality_of_service/grafana_client.d.ts +41 -0
- package/dest/quality_of_service/grafana_client.d.ts.map +1 -0
- package/dest/quality_of_service/{alert_checker.js → grafana_client.js} +1 -1
- package/dest/quality_of_service/prometheus_client.d.ts +38 -0
- package/dest/quality_of_service/prometheus_client.d.ts.map +1 -0
- package/dest/quality_of_service/prometheus_client.js +67 -0
- package/dest/shared/cross_chain_test_harness.d.ts +22 -9
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +45 -40
- package/dest/shared/gas_portal_test_harness.d.ts +19 -6
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.js +27 -15
- package/dest/shared/index.d.ts +3 -2
- package/dest/shared/index.d.ts.map +1 -1
- package/dest/shared/index.js +1 -0
- package/dest/shared/jest_setup.js +41 -1
- package/dest/shared/mock_state_view.d.ts +86 -0
- package/dest/shared/mock_state_view.d.ts.map +1 -0
- package/dest/shared/mock_state_view.js +186 -0
- package/dest/shared/submit-transactions.d.ts +4 -4
- package/dest/shared/submit-transactions.d.ts.map +1 -1
- package/dest/shared/submit-transactions.js +19 -14
- package/dest/shared/timing_env.d.js +5 -0
- package/dest/shared/timing_env.js +365 -0
- package/dest/shared/uniswap_l1_l2.d.ts +3 -27
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +86 -54
- package/dest/shared/wait_for_l1_to_l2_message.d.ts +13 -0
- package/dest/shared/wait_for_l1_to_l2_message.d.ts.map +1 -0
- package/dest/shared/wait_for_l1_to_l2_message.js +10 -0
- package/dest/simulators/lending_simulator.d.ts +15 -4
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.js +29 -17
- package/dest/simulators/token_simulator.d.ts +1 -1
- package/dest/simulators/token_simulator.d.ts.map +1 -1
- package/dest/simulators/token_simulator.js +3 -24
- package/dest/single-node/cross-chain/cross_chain_messaging_test.d.ts +75 -0
- package/dest/single-node/cross-chain/cross_chain_messaging_test.d.ts.map +1 -0
- package/dest/single-node/cross-chain/cross_chain_messaging_test.js +209 -0
- package/dest/single-node/cross-chain/message_test_helpers.d.ts +38 -0
- package/dest/single-node/cross-chain/message_test_helpers.d.ts.map +1 -0
- package/dest/single-node/cross-chain/message_test_helpers.js +70 -0
- package/dest/{e2e_fees → single-node/fees}/bridging_race.notest.d.ts +1 -1
- package/dest/single-node/fees/bridging_race.notest.d.ts.map +1 -0
- package/dest/{e2e_fees → single-node/fees}/bridging_race.notest.js +21 -10
- package/dest/single-node/fees/fees_test.d.ts +93 -0
- package/dest/single-node/fees/fees_test.d.ts.map +1 -0
- package/dest/single-node/fees/fees_test.js +274 -0
- package/dest/single-node/l1-reorgs/setup.d.ts +42 -0
- package/dest/single-node/l1-reorgs/setup.d.ts.map +1 -0
- package/dest/single-node/l1-reorgs/setup.js +57 -0
- package/dest/single-node/partial-proofs/setup.d.ts +5 -0
- package/dest/single-node/partial-proofs/setup.d.ts.map +1 -0
- package/dest/single-node/partial-proofs/setup.js +5 -0
- package/dest/single-node/proving/setup.d.ts +5 -0
- package/dest/single-node/proving/setup.d.ts.map +1 -0
- package/dest/single-node/proving/setup.js +5 -0
- package/dest/single-node/recovery/setup.d.ts +5 -0
- package/dest/single-node/recovery/setup.d.ts.map +1 -0
- package/dest/single-node/recovery/setup.js +5 -0
- package/dest/single-node/setup.d.ts +49 -0
- package/dest/single-node/setup.d.ts.map +1 -0
- package/dest/single-node/setup.js +56 -0
- package/dest/single-node/single_node_test_context.d.ts +360 -0
- package/dest/single-node/single_node_test_context.d.ts.map +1 -0
- package/dest/single-node/single_node_test_context.js +833 -0
- package/dest/spartan/setup_test_wallets.d.ts +15 -5
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +155 -50
- package/dest/spartan/tx_metrics.d.ts +111 -0
- package/dest/spartan/tx_metrics.d.ts.map +1 -0
- package/dest/spartan/tx_metrics.js +507 -0
- package/dest/spartan/utils/bot.d.ts +28 -0
- package/dest/spartan/utils/bot.d.ts.map +1 -0
- package/dest/spartan/utils/bot.js +142 -0
- package/dest/spartan/utils/chaos.d.ts +79 -0
- package/dest/spartan/utils/chaos.d.ts.map +1 -0
- package/dest/spartan/utils/chaos.js +142 -0
- package/dest/spartan/utils/clients.d.ts +39 -0
- package/dest/spartan/utils/clients.d.ts.map +1 -0
- package/dest/spartan/utils/clients.js +90 -0
- package/dest/spartan/utils/config.d.ts +19 -0
- package/dest/spartan/utils/config.d.ts.map +1 -0
- package/dest/spartan/utils/config.js +23 -0
- package/dest/spartan/utils/health.d.ts +63 -0
- package/dest/spartan/utils/health.d.ts.map +1 -0
- package/dest/spartan/utils/health.js +202 -0
- package/dest/spartan/utils/helm.d.ts +15 -0
- package/dest/spartan/utils/helm.d.ts.map +1 -0
- package/dest/spartan/utils/helm.js +47 -0
- package/dest/spartan/utils/index.d.ts +11 -0
- package/dest/spartan/utils/index.d.ts.map +1 -0
- package/dest/spartan/utils/index.js +22 -0
- package/dest/spartan/utils/k8s.d.ts +128 -0
- package/dest/spartan/utils/k8s.d.ts.map +1 -0
- package/dest/spartan/utils/k8s.js +381 -0
- package/dest/spartan/utils/nodes.d.ts +40 -0
- package/dest/spartan/utils/nodes.d.ts.map +1 -0
- package/dest/spartan/utils/nodes.js +461 -0
- package/dest/spartan/utils/pod_logs.d.ts +25 -0
- package/dest/spartan/utils/pod_logs.d.ts.map +1 -0
- package/dest/spartan/utils/pod_logs.js +74 -0
- package/dest/spartan/utils/scripts.d.ts +30 -0
- package/dest/spartan/utils/scripts.d.ts.map +1 -0
- package/dest/spartan/utils/scripts.js +81 -0
- package/dest/spartan/utils.d.ts +2 -221
- package/dest/spartan/utils.d.ts.map +1 -1
- package/dest/spartan/utils.js +1 -782
- package/dest/test-wallet/test_wallet.d.ts +105 -0
- package/dest/test-wallet/test_wallet.d.ts.map +1 -0
- package/dest/test-wallet/test_wallet.js +320 -0
- package/dest/test-wallet/utils.d.ts +76 -0
- package/dest/test-wallet/utils.d.ts.map +1 -0
- package/dest/test-wallet/utils.js +126 -0
- package/dest/test-wallet/wallet_worker_script.d.ts +2 -0
- package/dest/test-wallet/wallet_worker_script.d.ts.map +1 -0
- package/dest/test-wallet/wallet_worker_script.js +56 -0
- package/dest/test-wallet/worker_wallet.d.ts +53 -0
- package/dest/test-wallet/worker_wallet.d.ts.map +1 -0
- package/dest/test-wallet/worker_wallet.js +157 -0
- package/dest/test-wallet/worker_wallet_schema.d.ts +4 -0
- package/dest/test-wallet/worker_wallet_schema.d.ts.map +1 -0
- package/dest/test-wallet/worker_wallet_schema.js +23 -0
- package/package.json +54 -46
- package/src/automine/README.md +60 -0
- package/src/automine/automine_test_context.ts +153 -0
- package/src/automine/contracts/fixtures/storage_proof.json +915 -0
- package/src/automine/contracts/fixtures/storage_proof_fetcher.ts +190 -0
- package/src/automine/contracts/fixtures/storage_proof_fixture.ts +173 -0
- package/src/automine/delivery/interactive_handshake_responder.ts +125 -0
- package/src/automine/delivery/onchain_delivery_harness.ts +213 -0
- package/src/automine/token/blacklist_token_contract_test.ts +208 -0
- package/src/automine/token/token_contract_test.ts +146 -0
- package/src/automine/token/token_test_helpers.ts +138 -0
- package/src/bench/client_flows/benchmark.ts +45 -2
- package/src/bench/client_flows/client_flows_benchmark.ts +222 -251
- package/src/bench/client_flows/config.ts +9 -1
- package/src/bench/client_flows/data_extractor.ts +2 -1
- package/src/bench/utils.ts +144 -25
- package/src/composed/ha/ha_full_setup.ts +466 -0
- package/src/{e2e_multi_validator/utils.ts → composed/web3signer/multi_validator_keystore_utils.ts} +1 -1
- package/src/fixtures/authwit_proxy.ts +54 -0
- package/src/fixtures/dumps/epoch_proof_result.json +1 -1
- package/src/fixtures/e2e_prover_test.ts +172 -205
- package/src/fixtures/elu_monitor.ts +126 -0
- package/src/fixtures/fixtures.ts +111 -3
- package/src/fixtures/get_acvm_config.ts +1 -1
- package/src/fixtures/get_bb_config.ts +7 -6
- package/src/fixtures/ha_setup.ts +192 -0
- package/src/fixtures/index.ts +2 -0
- package/src/fixtures/l1_to_l2_messaging.ts +4 -2
- package/src/fixtures/schnorr_hardcoded_account_contract.ts +49 -0
- package/src/fixtures/setup.ts +987 -0
- package/src/fixtures/setup_p2p_test.ts +57 -57
- package/src/fixtures/timing.ts +97 -0
- package/src/fixtures/token_utils.ts +46 -10
- package/src/fixtures/utils.ts +26 -966
- package/src/fixtures/wait_helpers.ts +333 -0
- package/src/fixtures/web3signer.ts +1 -1
- package/src/fixtures/with_telemetry_utils.ts +2 -2
- package/src/forward-compatibility/wallet_rpc_client.ts +14 -0
- package/src/forward-compatibility/wallet_service.ts +106 -0
- package/src/guides/up_quick_start.sh +7 -4
- package/src/infra/README.md +12 -0
- package/src/install_legacy_contracts.cjs +75 -0
- package/src/legacy-jest-resolver.cjs +112 -0
- package/src/multi-node/README.md +95 -0
- package/src/multi-node/block-production/setup.ts +272 -0
- package/src/multi-node/governance/setup.ts +172 -0
- package/src/multi-node/multi_node_test_context.ts +447 -0
- package/src/multi-node/slashing/inactivity_setup.ts +139 -0
- package/src/multi-node/slashing/setup.ts +433 -0
- package/src/p2p/README.md +78 -0
- package/src/p2p/p2p_network.ts +542 -0
- package/src/p2p/reqresp/utils.ts +263 -0
- package/src/p2p/shared.ts +329 -0
- package/src/quality_of_service/{alert_checker.ts → grafana_client.ts} +1 -1
- package/src/quality_of_service/prometheus_client.ts +113 -0
- package/src/shared/cross_chain_test_harness.ts +51 -44
- package/src/shared/gas_portal_test_harness.ts +35 -17
- package/src/shared/index.ts +2 -1
- package/src/shared/jest_setup.ts +51 -1
- package/src/shared/mock_state_view.ts +188 -0
- package/src/shared/submit-transactions.ts +22 -19
- package/src/shared/timing_env.d.mts +39 -0
- package/src/shared/timing_env.mjs +363 -0
- package/src/shared/uniswap_l1_l2.ts +136 -115
- package/src/shared/wait_for_l1_to_l2_message.ts +23 -0
- package/src/simulators/lending_simulator.ts +36 -18
- package/src/simulators/token_simulator.ts +6 -30
- package/src/single-node/README.md +60 -0
- package/src/single-node/cross-chain/cross_chain_messaging_test.ts +302 -0
- package/src/single-node/cross-chain/message_test_helpers.ts +125 -0
- package/src/{e2e_fees → single-node/fees}/bridging_race.notest.ts +23 -15
- package/src/single-node/fees/fees_test.ts +368 -0
- package/src/single-node/l1-reorgs/setup.ts +93 -0
- package/src/single-node/partial-proofs/setup.ts +8 -0
- package/src/single-node/proving/setup.ts +15 -0
- package/src/single-node/recovery/setup.ts +8 -0
- package/src/single-node/setup.ts +63 -0
- package/src/single-node/single_node_test_context.ts +1041 -0
- package/src/spartan/setup_test_wallets.ts +217 -36
- package/src/spartan/tx_metrics.ts +460 -0
- package/src/spartan/utils/bot.ts +188 -0
- package/src/spartan/utils/chaos.ts +253 -0
- package/src/spartan/utils/clients.ts +100 -0
- package/src/spartan/utils/config.ts +29 -0
- package/src/spartan/utils/health.ts +255 -0
- package/src/spartan/utils/helm.ts +84 -0
- package/src/spartan/utils/index.ts +71 -0
- package/src/spartan/utils/k8s.ts +535 -0
- package/src/spartan/utils/nodes.ts +543 -0
- package/src/spartan/utils/pod_logs.ts +99 -0
- package/src/spartan/utils/scripts.ts +99 -0
- package/src/spartan/utils.ts +1 -983
- package/src/test-wallet/test_wallet.ts +426 -0
- package/src/test-wallet/utils.ts +205 -0
- package/src/test-wallet/wallet_worker_script.ts +66 -0
- package/src/test-wallet/worker_wallet.ts +216 -0
- package/src/test-wallet/worker_wallet_schema.ts +14 -0
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +0 -54
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +0 -1
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +0 -185
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +0 -41
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +0 -1
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +0 -108
- package/dest/e2e_deploy_contract/deploy_test.d.ts +0 -36
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +0 -1
- package/dest/e2e_deploy_contract/deploy_test.js +0 -45
- package/dest/e2e_epochs/epochs_test.d.ts +0 -93
- package/dest/e2e_epochs/epochs_test.d.ts.map +0 -1
- package/dest/e2e_epochs/epochs_test.js +0 -337
- package/dest/e2e_fees/bridging_race.notest.d.ts.map +0 -1
- package/dest/e2e_fees/fees_test.d.ts +0 -85
- package/dest/e2e_fees/fees_test.d.ts.map +0 -1
- package/dest/e2e_fees/fees_test.js +0 -263
- package/dest/e2e_l1_publisher/write_json.d.ts +0 -10
- package/dest/e2e_l1_publisher/write_json.d.ts.map +0 -1
- package/dest/e2e_l1_publisher/write_json.js +0 -58
- package/dest/e2e_multi_validator/utils.d.ts +0 -12
- package/dest/e2e_multi_validator/utils.d.ts.map +0 -1
- package/dest/e2e_nested_contract/nested_contract_test.d.ts +0 -29
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +0 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +0 -64
- package/dest/e2e_p2p/inactivity_slash_test.d.ts +0 -31
- package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +0 -1
- package/dest/e2e_p2p/inactivity_slash_test.js +0 -139
- package/dest/e2e_p2p/p2p_network.d.ts.map +0 -1
- package/dest/e2e_p2p/p2p_network.js +0 -320
- package/dest/e2e_p2p/shared.d.ts +0 -46
- package/dest/e2e_p2p/shared.d.ts.map +0 -1
- package/dest/e2e_p2p/shared.js +0 -184
- package/dest/e2e_token_contract/token_contract_test.d.ts +0 -35
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +0 -1
- package/dest/e2e_token_contract/token_contract_test.js +0 -126
- package/dest/fixtures/setup_l1_contracts.d.ts +0 -477
- package/dest/fixtures/setup_l1_contracts.d.ts.map +0 -1
- package/dest/fixtures/setup_l1_contracts.js +0 -17
- package/dest/fixtures/snapshot_manager.d.ts +0 -95
- package/dest/fixtures/snapshot_manager.d.ts.map +0 -1
- package/dest/fixtures/snapshot_manager.js +0 -505
- package/dest/quality_of_service/alert_checker.d.ts +0 -41
- package/dest/quality_of_service/alert_checker.d.ts.map +0 -1
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +0 -256
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +0 -179
- package/src/e2e_deploy_contract/deploy_test.ts +0 -78
- package/src/e2e_epochs/epochs_test.ts +0 -438
- package/src/e2e_fees/fees_test.ts +0 -382
- package/src/e2e_l1_publisher/write_json.ts +0 -77
- package/src/e2e_nested_contract/nested_contract_test.ts +0 -96
- package/src/e2e_p2p/inactivity_slash_test.ts +0 -182
- package/src/e2e_p2p/p2p_network.ts +0 -476
- package/src/e2e_p2p/shared.ts +0 -285
- package/src/e2e_token_contract/token_contract_test.ts +0 -167
- package/src/fixtures/setup_l1_contracts.ts +0 -26
- package/src/fixtures/snapshot_manager.ts +0 -665
|
@@ -1,256 +0,0 @@
|
|
|
1
|
-
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
-
import { computeSecretHash } from '@aztec/aztec.js/crypto';
|
|
3
|
-
import { Fr } from '@aztec/aztec.js/fields';
|
|
4
|
-
import { type Logger, createLogger } from '@aztec/aztec.js/log';
|
|
5
|
-
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
6
|
-
import type { TxHash } from '@aztec/aztec.js/tx';
|
|
7
|
-
import type { CheatCodes } from '@aztec/aztec/testing';
|
|
8
|
-
import type { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
9
|
-
import { TokenBlacklistContract } from '@aztec/noir-contracts.js/TokenBlacklist';
|
|
10
|
-
import { InvalidAccountContract } from '@aztec/noir-test-contracts.js/InvalidAccount';
|
|
11
|
-
import type { SequencerClient } from '@aztec/sequencer-client';
|
|
12
|
-
import type { TestWallet } from '@aztec/test-wallet/server';
|
|
13
|
-
|
|
14
|
-
import { jest } from '@jest/globals';
|
|
15
|
-
|
|
16
|
-
import {
|
|
17
|
-
type ISnapshotManager,
|
|
18
|
-
type SubsystemsContext,
|
|
19
|
-
createSnapshotManager,
|
|
20
|
-
deployAccounts,
|
|
21
|
-
publicDeployAccounts,
|
|
22
|
-
} from '../fixtures/snapshot_manager.js';
|
|
23
|
-
import { TokenSimulator } from '../simulators/token_simulator.js';
|
|
24
|
-
|
|
25
|
-
const { E2E_DATA_PATH: dataPath } = process.env;
|
|
26
|
-
|
|
27
|
-
export class Role {
|
|
28
|
-
private isAdmin = false;
|
|
29
|
-
private isMinter = false;
|
|
30
|
-
private isBlacklisted = false;
|
|
31
|
-
|
|
32
|
-
withAdmin() {
|
|
33
|
-
this.isAdmin = true;
|
|
34
|
-
return this;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
withMinter() {
|
|
38
|
-
this.isMinter = true;
|
|
39
|
-
return this;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
withBlacklisted() {
|
|
43
|
-
this.isBlacklisted = true;
|
|
44
|
-
return this;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
toNoirStruct() {
|
|
48
|
-
// We need to use lowercase identifiers as those are what the noir interface expects
|
|
49
|
-
// eslint-disable-next-line camelcase
|
|
50
|
-
return { is_admin: this.isAdmin, is_minter: this.isMinter, is_blacklisted: this.isBlacklisted };
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export class BlacklistTokenContractTest {
|
|
55
|
-
// This value MUST match the same value that we have in the contract
|
|
56
|
-
static CHANGE_ROLES_DELAY = 86400;
|
|
57
|
-
|
|
58
|
-
private snapshotManager: ISnapshotManager;
|
|
59
|
-
logger: Logger;
|
|
60
|
-
wallet!: TestWallet;
|
|
61
|
-
asset!: TokenBlacklistContract;
|
|
62
|
-
tokenSim!: TokenSimulator;
|
|
63
|
-
badAccount!: InvalidAccountContract;
|
|
64
|
-
cheatCodes!: CheatCodes;
|
|
65
|
-
sequencer!: SequencerClient;
|
|
66
|
-
aztecNode!: AztecNode;
|
|
67
|
-
|
|
68
|
-
adminAddress!: AztecAddress;
|
|
69
|
-
otherAddress!: AztecAddress;
|
|
70
|
-
blacklistedAddress!: AztecAddress;
|
|
71
|
-
|
|
72
|
-
constructor(testName: string) {
|
|
73
|
-
this.logger = createLogger(`e2e:e2e_blacklist_token_contract:${testName}`);
|
|
74
|
-
this.snapshotManager = createSnapshotManager(`e2e_blacklist_token_contract/${testName}`, dataPath);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
async crossTimestampOfChange() {
|
|
78
|
-
await this.cheatCodes.warpL2TimeAtLeastBy(
|
|
79
|
-
this.sequencer,
|
|
80
|
-
this.aztecNode,
|
|
81
|
-
BlacklistTokenContractTest.CHANGE_ROLES_DELAY,
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Adds two state shifts to snapshot manager.
|
|
87
|
-
* 1. Add 3 accounts.
|
|
88
|
-
* 2. Publicly deploy accounts, deploy token contract and a "bad account".
|
|
89
|
-
*/
|
|
90
|
-
async applyBaseSnapshots() {
|
|
91
|
-
// Adding a timeout of 2 minutes in here such that it is propagated to the underlying tests
|
|
92
|
-
jest.setTimeout(120_000);
|
|
93
|
-
|
|
94
|
-
await this.snapshotManager.snapshot(
|
|
95
|
-
'3_accounts',
|
|
96
|
-
deployAccounts(3, this.logger),
|
|
97
|
-
({ deployedAccounts }, { cheatCodes, aztecNode, sequencer, wallet }) => {
|
|
98
|
-
this.cheatCodes = cheatCodes;
|
|
99
|
-
this.aztecNode = aztecNode;
|
|
100
|
-
this.sequencer = sequencer;
|
|
101
|
-
this.wallet = wallet;
|
|
102
|
-
this.adminAddress = deployedAccounts[0].address;
|
|
103
|
-
this.otherAddress = deployedAccounts[1].address;
|
|
104
|
-
this.blacklistedAddress = deployedAccounts[2].address;
|
|
105
|
-
return Promise.resolve();
|
|
106
|
-
},
|
|
107
|
-
);
|
|
108
|
-
|
|
109
|
-
await this.snapshotManager.snapshot(
|
|
110
|
-
'e2e_blacklist_token_contract',
|
|
111
|
-
async () => {
|
|
112
|
-
// Create the token contract state.
|
|
113
|
-
// Move this account thing to addAccounts above?
|
|
114
|
-
this.logger.verbose(`Public deploy accounts...`);
|
|
115
|
-
await publicDeployAccounts(this.wallet, [this.adminAddress, this.otherAddress, this.blacklistedAddress]);
|
|
116
|
-
|
|
117
|
-
this.logger.verbose(`Deploying TokenContract...`);
|
|
118
|
-
this.asset = await TokenBlacklistContract.deploy(this.wallet, this.adminAddress)
|
|
119
|
-
.send({ from: this.adminAddress })
|
|
120
|
-
.deployed();
|
|
121
|
-
this.logger.verbose(`Token deployed to ${this.asset.address}`);
|
|
122
|
-
|
|
123
|
-
this.logger.verbose(`Deploying bad account...`);
|
|
124
|
-
this.badAccount = await InvalidAccountContract.deploy(this.wallet).send({ from: this.adminAddress }).deployed();
|
|
125
|
-
this.logger.verbose(`Deployed to ${this.badAccount.address}.`);
|
|
126
|
-
|
|
127
|
-
await this.crossTimestampOfChange();
|
|
128
|
-
|
|
129
|
-
return { tokenContractAddress: this.asset.address, badAccountAddress: this.badAccount.address };
|
|
130
|
-
},
|
|
131
|
-
async ({ tokenContractAddress, badAccountAddress }) => {
|
|
132
|
-
// Restore the token contract state.
|
|
133
|
-
this.asset = TokenBlacklistContract.at(tokenContractAddress, this.wallet);
|
|
134
|
-
this.logger.verbose(`Token contract address: ${this.asset.address}`);
|
|
135
|
-
|
|
136
|
-
this.tokenSim = new TokenSimulator(
|
|
137
|
-
this.asset as unknown as TokenContract,
|
|
138
|
-
this.wallet,
|
|
139
|
-
this.adminAddress,
|
|
140
|
-
this.logger,
|
|
141
|
-
[this.adminAddress, this.otherAddress, this.blacklistedAddress],
|
|
142
|
-
);
|
|
143
|
-
|
|
144
|
-
this.badAccount = InvalidAccountContract.at(badAccountAddress, this.wallet);
|
|
145
|
-
this.logger.verbose(`Bad account address: ${this.badAccount.address}`);
|
|
146
|
-
|
|
147
|
-
expect(await this.asset.methods.get_roles(this.adminAddress).simulate({ from: this.adminAddress })).toEqual(
|
|
148
|
-
new Role().withAdmin().toNoirStruct(),
|
|
149
|
-
);
|
|
150
|
-
},
|
|
151
|
-
);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
async setup() {
|
|
155
|
-
await this.snapshotManager.setup();
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
snapshot = <T>(
|
|
159
|
-
name: string,
|
|
160
|
-
apply: (context: SubsystemsContext) => Promise<T>,
|
|
161
|
-
restore: (snapshotData: T, context: SubsystemsContext) => Promise<void> = () => Promise.resolve(),
|
|
162
|
-
): Promise<void> => this.snapshotManager.snapshot(name, apply, restore);
|
|
163
|
-
|
|
164
|
-
async teardown() {
|
|
165
|
-
await this.snapshotManager.teardown();
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
async addPendingShieldNoteToPXE(
|
|
169
|
-
contract: TokenBlacklistContract,
|
|
170
|
-
recipient: AztecAddress,
|
|
171
|
-
amount: bigint,
|
|
172
|
-
secretHash: Fr,
|
|
173
|
-
txHash: TxHash,
|
|
174
|
-
) {
|
|
175
|
-
const txEffects = await this.aztecNode.getTxEffect(txHash);
|
|
176
|
-
await contract.methods
|
|
177
|
-
.deliver_transparent_note(
|
|
178
|
-
contract.address,
|
|
179
|
-
amount,
|
|
180
|
-
secretHash,
|
|
181
|
-
txHash.hash,
|
|
182
|
-
txEffects!.data.noteHashes,
|
|
183
|
-
txEffects!.data.nullifiers[0],
|
|
184
|
-
recipient,
|
|
185
|
-
)
|
|
186
|
-
.simulate({ from: recipient });
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
async applyMintSnapshot() {
|
|
190
|
-
await this.snapshotManager.snapshot(
|
|
191
|
-
'mint',
|
|
192
|
-
async () => {
|
|
193
|
-
const { asset } = this;
|
|
194
|
-
const amount = 10000n;
|
|
195
|
-
|
|
196
|
-
const adminMinterRole = new Role().withAdmin().withMinter();
|
|
197
|
-
await this.asset.methods
|
|
198
|
-
.update_roles(this.adminAddress, adminMinterRole.toNoirStruct())
|
|
199
|
-
.send({ from: this.adminAddress })
|
|
200
|
-
.wait();
|
|
201
|
-
|
|
202
|
-
const blacklistRole = new Role().withBlacklisted();
|
|
203
|
-
await this.asset.methods
|
|
204
|
-
.update_roles(this.blacklistedAddress, blacklistRole.toNoirStruct())
|
|
205
|
-
.send({ from: this.adminAddress })
|
|
206
|
-
.wait();
|
|
207
|
-
|
|
208
|
-
await this.crossTimestampOfChange();
|
|
209
|
-
|
|
210
|
-
expect(await this.asset.methods.get_roles(this.adminAddress).simulate({ from: this.adminAddress })).toEqual(
|
|
211
|
-
adminMinterRole.toNoirStruct(),
|
|
212
|
-
);
|
|
213
|
-
|
|
214
|
-
this.logger.verbose(`Minting ${amount} publicly...`);
|
|
215
|
-
await asset.methods.mint_public(this.adminAddress, amount).send({ from: this.adminAddress }).wait();
|
|
216
|
-
|
|
217
|
-
this.logger.verbose(`Minting ${amount} privately...`);
|
|
218
|
-
const secret = Fr.random();
|
|
219
|
-
const secretHash = await computeSecretHash(secret);
|
|
220
|
-
const receipt = await asset.methods.mint_private(amount, secretHash).send({ from: this.adminAddress }).wait();
|
|
221
|
-
|
|
222
|
-
await this.addPendingShieldNoteToPXE(asset, this.adminAddress, amount, secretHash, receipt.txHash);
|
|
223
|
-
const txClaim = asset.methods
|
|
224
|
-
.redeem_shield(this.adminAddress, amount, secret)
|
|
225
|
-
.send({ from: this.adminAddress });
|
|
226
|
-
await txClaim.wait();
|
|
227
|
-
this.logger.verbose(`Minting complete.`);
|
|
228
|
-
|
|
229
|
-
return { amount };
|
|
230
|
-
},
|
|
231
|
-
async ({ amount }) => {
|
|
232
|
-
const { asset, tokenSim } = this;
|
|
233
|
-
tokenSim.mintPublic(this.adminAddress, amount);
|
|
234
|
-
|
|
235
|
-
const publicBalance = await asset.methods
|
|
236
|
-
.balance_of_public(this.adminAddress)
|
|
237
|
-
.simulate({ from: this.adminAddress });
|
|
238
|
-
this.logger.verbose(`Public balance of wallet 0: ${publicBalance}`);
|
|
239
|
-
expect(publicBalance).toEqual(this.tokenSim.balanceOfPublic(this.adminAddress));
|
|
240
|
-
|
|
241
|
-
tokenSim.mintPrivate(this.adminAddress, amount);
|
|
242
|
-
const privateBalance = await asset.methods
|
|
243
|
-
.balance_of_private(this.adminAddress)
|
|
244
|
-
.simulate({ from: this.adminAddress });
|
|
245
|
-
this.logger.verbose(`Private balance of wallet 0: ${privateBalance}`);
|
|
246
|
-
expect(privateBalance).toEqual(tokenSim.balanceOfPrivate(this.adminAddress));
|
|
247
|
-
|
|
248
|
-
const totalSupply = await asset.methods.total_supply().simulate({ from: this.adminAddress });
|
|
249
|
-
this.logger.verbose(`Total supply: ${totalSupply}`);
|
|
250
|
-
expect(totalSupply).toEqual(tokenSim.totalSupply);
|
|
251
|
-
|
|
252
|
-
return Promise.resolve();
|
|
253
|
-
},
|
|
254
|
-
);
|
|
255
|
-
}
|
|
256
|
-
}
|
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
import type { AztecNodeConfig } from '@aztec/aztec-node';
|
|
2
|
-
import { AztecAddress, EthAddress } from '@aztec/aztec.js/addresses';
|
|
3
|
-
import { type Logger, createLogger } from '@aztec/aztec.js/log';
|
|
4
|
-
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
5
|
-
import { CheatCodes } from '@aztec/aztec/testing';
|
|
6
|
-
import {
|
|
7
|
-
type DeployL1ContractsArgs,
|
|
8
|
-
type DeployL1ContractsReturnType,
|
|
9
|
-
type ExtendedViemWalletClient,
|
|
10
|
-
createExtendedL1Client,
|
|
11
|
-
deployL1Contract,
|
|
12
|
-
} from '@aztec/ethereum';
|
|
13
|
-
import { InboxAbi, OutboxAbi, TestERC20Abi, TestERC20Bytecode } from '@aztec/l1-artifacts';
|
|
14
|
-
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
15
|
-
import { TokenBridgeContract } from '@aztec/noir-contracts.js/TokenBridge';
|
|
16
|
-
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
17
|
-
import type { TestWallet } from '@aztec/test-wallet/server';
|
|
18
|
-
|
|
19
|
-
import { getContract } from 'viem';
|
|
20
|
-
|
|
21
|
-
import { MNEMONIC } from '../fixtures/fixtures.js';
|
|
22
|
-
import {
|
|
23
|
-
type ISnapshotManager,
|
|
24
|
-
type SubsystemsContext,
|
|
25
|
-
createSnapshotManager,
|
|
26
|
-
deployAccounts,
|
|
27
|
-
publicDeployAccounts,
|
|
28
|
-
} from '../fixtures/snapshot_manager.js';
|
|
29
|
-
import type { SetupOptions } from '../fixtures/utils.js';
|
|
30
|
-
import { CrossChainTestHarness } from '../shared/cross_chain_test_harness.js';
|
|
31
|
-
|
|
32
|
-
const { E2E_DATA_PATH: dataPath } = process.env;
|
|
33
|
-
|
|
34
|
-
export class CrossChainMessagingTest {
|
|
35
|
-
private snapshotManager: ISnapshotManager;
|
|
36
|
-
logger: Logger;
|
|
37
|
-
aztecNode!: AztecNode;
|
|
38
|
-
aztecNodeConfig!: AztecNodeConfig;
|
|
39
|
-
aztecNodeAdmin!: AztecNodeAdmin;
|
|
40
|
-
ctx!: SubsystemsContext;
|
|
41
|
-
|
|
42
|
-
l1Client!: ExtendedViemWalletClient | undefined;
|
|
43
|
-
|
|
44
|
-
wallet!: TestWallet;
|
|
45
|
-
ownerAddress!: AztecAddress;
|
|
46
|
-
user1Address!: AztecAddress;
|
|
47
|
-
user2Address!: AztecAddress;
|
|
48
|
-
crossChainTestHarness!: CrossChainTestHarness;
|
|
49
|
-
ethAccount!: EthAddress;
|
|
50
|
-
l2Token!: TokenContract;
|
|
51
|
-
l2Bridge!: TokenBridgeContract;
|
|
52
|
-
|
|
53
|
-
inbox!: any; // GetContractReturnType<typeof InboxAbi> | undefined;
|
|
54
|
-
outbox!: any; // GetContractReturnType<typeof OutboxAbi> | undefined;
|
|
55
|
-
cheatCodes!: CheatCodes;
|
|
56
|
-
|
|
57
|
-
deployL1ContractsValues!: DeployL1ContractsReturnType;
|
|
58
|
-
|
|
59
|
-
constructor(testName: string, opts: SetupOptions = {}, deployL1ContractsArgs: Partial<DeployL1ContractsArgs> = {}) {
|
|
60
|
-
this.logger = createLogger(`e2e:e2e_cross_chain_messaging:${testName}`);
|
|
61
|
-
this.snapshotManager = createSnapshotManager(`e2e_cross_chain_messaging/${testName}`, dataPath, opts, {
|
|
62
|
-
initialValidators: [],
|
|
63
|
-
...deployL1ContractsArgs,
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
async assumeProven() {
|
|
68
|
-
await this.cheatCodes.rollup.markAsProven();
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
async setup() {
|
|
72
|
-
this.ctx = await this.snapshotManager.setup();
|
|
73
|
-
this.aztecNode = this.ctx.aztecNode;
|
|
74
|
-
this.wallet = this.ctx.wallet;
|
|
75
|
-
this.aztecNodeConfig = this.ctx.aztecNodeConfig;
|
|
76
|
-
this.cheatCodes = this.ctx.cheatCodes;
|
|
77
|
-
this.deployL1ContractsValues = this.ctx.deployL1ContractsValues;
|
|
78
|
-
this.aztecNodeAdmin = this.ctx.aztecNode;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
snapshot = <T>(
|
|
82
|
-
name: string,
|
|
83
|
-
apply: (context: SubsystemsContext) => Promise<T>,
|
|
84
|
-
restore: (snapshotData: T, context: SubsystemsContext) => Promise<void> = () => Promise.resolve(),
|
|
85
|
-
): Promise<void> => this.snapshotManager.snapshot(name, apply, restore);
|
|
86
|
-
|
|
87
|
-
async teardown() {
|
|
88
|
-
await this.snapshotManager.teardown();
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
async applyBaseSnapshots() {
|
|
92
|
-
// Note that we are using the same `wallet`, `aztecNodeConfig` and `aztecNode` across all snapshots.
|
|
93
|
-
// This is to not have issues with different networks.
|
|
94
|
-
|
|
95
|
-
await this.snapshotManager.snapshot(
|
|
96
|
-
'3_accounts',
|
|
97
|
-
deployAccounts(3, this.logger),
|
|
98
|
-
({ deployedAccounts }, { wallet, aztecNodeConfig, aztecNode }) => {
|
|
99
|
-
[this.ownerAddress, this.user1Address, this.user2Address] = deployedAccounts.map(a => a.address);
|
|
100
|
-
this.wallet = wallet;
|
|
101
|
-
this.aztecNode = aztecNode;
|
|
102
|
-
this.aztecNodeConfig = aztecNodeConfig;
|
|
103
|
-
return Promise.resolve();
|
|
104
|
-
},
|
|
105
|
-
);
|
|
106
|
-
|
|
107
|
-
await this.snapshotManager.snapshot(
|
|
108
|
-
'e2e_cross_chain_messaging',
|
|
109
|
-
async () => {
|
|
110
|
-
// Create the token contract state.
|
|
111
|
-
// Move this account thing to addAccounts above?
|
|
112
|
-
this.logger.verbose(`Public deploy accounts...`);
|
|
113
|
-
await publicDeployAccounts(this.wallet, [this.ownerAddress, this.user1Address, this.user2Address]);
|
|
114
|
-
|
|
115
|
-
this.l1Client = createExtendedL1Client(this.aztecNodeConfig.l1RpcUrls, MNEMONIC);
|
|
116
|
-
|
|
117
|
-
const underlyingERC20Address = await deployL1Contract(this.l1Client, TestERC20Abi, TestERC20Bytecode, [
|
|
118
|
-
'Underlying',
|
|
119
|
-
'UND',
|
|
120
|
-
this.l1Client.account.address,
|
|
121
|
-
]).then(({ address }) => address);
|
|
122
|
-
|
|
123
|
-
this.logger.verbose(`Setting up cross chain harness...`);
|
|
124
|
-
this.crossChainTestHarness = await CrossChainTestHarness.new(
|
|
125
|
-
this.aztecNode,
|
|
126
|
-
this.l1Client,
|
|
127
|
-
this.wallet,
|
|
128
|
-
this.ownerAddress,
|
|
129
|
-
this.logger,
|
|
130
|
-
underlyingERC20Address,
|
|
131
|
-
);
|
|
132
|
-
|
|
133
|
-
this.logger.verbose(`L2 token deployed to: ${this.crossChainTestHarness.l2Token.address}`);
|
|
134
|
-
|
|
135
|
-
return this.crossChainTestHarness.toCrossChainContext();
|
|
136
|
-
},
|
|
137
|
-
crossChainContext => {
|
|
138
|
-
this.l2Token = TokenContract.at(crossChainContext.l2Token, this.wallet);
|
|
139
|
-
this.l2Bridge = TokenBridgeContract.at(crossChainContext.l2Bridge, this.wallet);
|
|
140
|
-
|
|
141
|
-
// There is an issue with the reviver so we are getting strings sometimes. Working around it here.
|
|
142
|
-
this.ethAccount = EthAddress.fromString(crossChainContext.ethAccount.toString());
|
|
143
|
-
const tokenPortalAddress = EthAddress.fromString(crossChainContext.tokenPortal.toString());
|
|
144
|
-
|
|
145
|
-
const l1Client = createExtendedL1Client(this.aztecNodeConfig.l1RpcUrls, MNEMONIC);
|
|
146
|
-
|
|
147
|
-
const inbox = getContract({
|
|
148
|
-
address: this.aztecNodeConfig.l1Contracts.inboxAddress.toString(),
|
|
149
|
-
abi: InboxAbi,
|
|
150
|
-
client: l1Client,
|
|
151
|
-
});
|
|
152
|
-
const outbox = getContract({
|
|
153
|
-
address: this.aztecNodeConfig.l1Contracts.outboxAddress.toString(),
|
|
154
|
-
abi: OutboxAbi,
|
|
155
|
-
client: l1Client,
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
this.crossChainTestHarness = new CrossChainTestHarness(
|
|
159
|
-
this.aztecNode,
|
|
160
|
-
this.logger,
|
|
161
|
-
this.l2Token,
|
|
162
|
-
this.l2Bridge,
|
|
163
|
-
this.ethAccount,
|
|
164
|
-
tokenPortalAddress,
|
|
165
|
-
crossChainContext.underlying,
|
|
166
|
-
l1Client,
|
|
167
|
-
this.aztecNodeConfig.l1Contracts,
|
|
168
|
-
this.wallet,
|
|
169
|
-
this.ownerAddress,
|
|
170
|
-
);
|
|
171
|
-
|
|
172
|
-
this.l1Client = l1Client;
|
|
173
|
-
this.inbox = inbox;
|
|
174
|
-
this.outbox = outbox;
|
|
175
|
-
return Promise.resolve();
|
|
176
|
-
},
|
|
177
|
-
);
|
|
178
|
-
}
|
|
179
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import type { ContractArtifact } from '@aztec/aztec.js/abi';
|
|
2
|
-
import type { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
3
|
-
import { type ContractBase, getContractInstanceFromInstantiationParams } from '@aztec/aztec.js/contracts';
|
|
4
|
-
import { Fr } from '@aztec/aztec.js/fields';
|
|
5
|
-
import type { PublicKeys } from '@aztec/aztec.js/keys';
|
|
6
|
-
import { type Logger, createLogger } from '@aztec/aztec.js/log';
|
|
7
|
-
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
8
|
-
import type { Wallet } from '@aztec/aztec.js/wallet';
|
|
9
|
-
import type { StatefulTestContract } from '@aztec/noir-test-contracts.js/StatefulTest';
|
|
10
|
-
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
11
|
-
import type { TestWallet } from '@aztec/test-wallet/server';
|
|
12
|
-
|
|
13
|
-
import { type ISnapshotManager, createSnapshotManager, deployAccounts } from '../fixtures/snapshot_manager.js';
|
|
14
|
-
|
|
15
|
-
const { E2E_DATA_PATH: dataPath } = process.env;
|
|
16
|
-
|
|
17
|
-
export class DeployTest {
|
|
18
|
-
private snapshotManager: ISnapshotManager;
|
|
19
|
-
public logger: Logger;
|
|
20
|
-
public wallet!: TestWallet;
|
|
21
|
-
public defaultAccountAddress!: AztecAddress;
|
|
22
|
-
public aztecNode!: AztecNode;
|
|
23
|
-
public aztecNodeAdmin!: AztecNodeAdmin;
|
|
24
|
-
|
|
25
|
-
constructor(testName: string) {
|
|
26
|
-
this.logger = createLogger(`e2e:e2e_deploy_contract:${testName}`);
|
|
27
|
-
this.snapshotManager = createSnapshotManager(`e2e_deploy_contract/${testName}`, dataPath);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
async setup() {
|
|
31
|
-
await this.applyInitialAccountSnapshot();
|
|
32
|
-
const context = await this.snapshotManager.setup();
|
|
33
|
-
({ aztecNode: this.aztecNode, wallet: this.wallet } = context);
|
|
34
|
-
this.aztecNodeAdmin = context.aztecNode;
|
|
35
|
-
return this;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
async teardown() {
|
|
39
|
-
await this.snapshotManager.teardown();
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
private async applyInitialAccountSnapshot() {
|
|
43
|
-
await this.snapshotManager.snapshot('initial_account', deployAccounts(1, this.logger), ({ deployedAccounts }) => {
|
|
44
|
-
this.defaultAccountAddress = deployedAccounts[0].address;
|
|
45
|
-
return Promise.resolve();
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
async registerContract<T extends ContractBase>(
|
|
50
|
-
wallet: Wallet,
|
|
51
|
-
contractArtifact: ContractArtifactClass<T>,
|
|
52
|
-
opts: {
|
|
53
|
-
salt?: Fr;
|
|
54
|
-
publicKeys?: PublicKeys;
|
|
55
|
-
initArgs?: any[];
|
|
56
|
-
constructorName?: string;
|
|
57
|
-
deployer?: AztecAddress;
|
|
58
|
-
} = {},
|
|
59
|
-
): Promise<T> {
|
|
60
|
-
const { salt, publicKeys, initArgs, constructorName, deployer } = opts;
|
|
61
|
-
const instance = await getContractInstanceFromInstantiationParams(contractArtifact.artifact, {
|
|
62
|
-
constructorArgs: initArgs ?? [],
|
|
63
|
-
constructorArtifact: constructorName,
|
|
64
|
-
salt: salt ?? Fr.random(),
|
|
65
|
-
publicKeys,
|
|
66
|
-
deployer,
|
|
67
|
-
});
|
|
68
|
-
await wallet.registerContract(instance, contractArtifact.artifact);
|
|
69
|
-
return contractArtifact.at(instance.address, wallet);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export type StatefulContractCtorArgs = Parameters<StatefulTestContract['methods']['constructor']>;
|
|
74
|
-
|
|
75
|
-
export type ContractArtifactClass<T extends ContractBase> = {
|
|
76
|
-
at(address: AztecAddress, wallet: Wallet): T;
|
|
77
|
-
artifact: ContractArtifact;
|
|
78
|
-
};
|