@aztec/end-to-end 0.0.1-commit.b655e406 → 0.0.1-commit.b8a057fa
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/onchain_delivery_harness.d.ts +17 -0
- package/dest/automine/delivery/onchain_delivery_harness.d.ts.map +1 -0
- package/dest/automine/delivery/onchain_delivery_harness.js +123 -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 +26 -20
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +159 -140
- 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.d.ts +1 -1
- package/dest/bench/client_flows/data_extractor.js +8 -27
- package/dest/bench/utils.d.ts +10 -9
- 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 +27 -29
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +156 -156
- 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 +83 -3
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/fixtures.js +86 -3
- package/dest/fixtures/get_acvm_config.d.ts +1 -1
- 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/logging.d.ts +1 -1
- 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 +60 -41
- 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 +26 -5
- package/dest/fixtures/token_utils.d.ts.map +1 -1
- package/dest/fixtures/token_utils.js +33 -9
- package/dest/fixtures/utils.d.ts +5 -192
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +4 -648
- 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.d.ts +1 -1
- 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/index.d.ts +1 -1
- 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/p2p/p2p_network.d.ts +325 -0
- 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 +11 -8
- 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 +9 -6
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.js +28 -16
- 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.d.ts +1 -1
- 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/index.d.ts +1 -1
- package/dest/simulators/lending_simulator.d.ts +11 -4
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.js +33 -19
- 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/single-node/fees/bridging_race.notest.d.ts +2 -0
- 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 +18 -6
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +169 -30
- 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 -218
- package/dest/spartan/utils.d.ts.map +1 -1
- package/dest/spartan/utils.js +1 -749
- 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 +323 -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 +155 -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 +22 -0
- package/package.json +57 -47
- 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/onchain_delivery_harness.ts +177 -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 +227 -211
- package/src/bench/client_flows/config.ts +9 -1
- package/src/bench/client_flows/data_extractor.ts +7 -28
- 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 +175 -214
- package/src/fixtures/elu_monitor.ts +126 -0
- package/src/fixtures/fixtures.ts +110 -5
- 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 +72 -58
- package/src/fixtures/timing.ts +97 -0
- package/src/fixtures/token_utils.ts +47 -11
- package/src/fixtures/utils.ts +26 -947
- 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 +8 -5
- 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 -43
- package/src/shared/gas_portal_test_harness.ts +36 -18
- 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 +40 -20
- 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/DEVELOP.md +7 -0
- package/src/spartan/setup_test_wallets.ts +243 -32
- 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 -942
- package/src/test-wallet/test_wallet.ts +429 -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 +214 -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 -107
- 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 -92
- package/dest/e2e_epochs/epochs_test.d.ts.map +0 -1
- package/dest/e2e_epochs/epochs_test.js +0 -336
- package/dest/e2e_fees/bridging_race.notest.d.ts +0 -2
- package/dest/e2e_fees/bridging_race.notest.d.ts.map +0 -1
- package/dest/e2e_fees/fees_test.d.ts +0 -84
- package/dest/e2e_fees/fees_test.d.ts.map +0 -1
- package/dest/e2e_fees/fees_test.js +0 -260
- 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 -57
- 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 -63
- 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 -135
- package/dest/e2e_p2p/p2p_network.d.ts +0 -108
- package/dest/e2e_p2p/p2p_network.d.ts.map +0 -1
- package/dest/e2e_p2p/p2p_network.js +0 -318
- 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 -183
- 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 -6
- 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 -178
- package/src/e2e_deploy_contract/deploy_test.ts +0 -78
- package/src/e2e_epochs/epochs_test.ts +0 -437
- package/src/e2e_fees/fees_test.ts +0 -378
- package/src/e2e_l1_publisher/write_json.ts +0 -76
- package/src/e2e_nested_contract/nested_contract_test.ts +0 -95
- package/src/e2e_p2p/inactivity_slash_test.ts +0 -178
- package/src/e2e_p2p/p2p_network.ts +0 -472
- package/src/e2e_p2p/shared.ts +0 -282
- 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
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { DefaultWaitOpts } from '@aztec/aztec.js/contracts';
|
|
2
|
+
import { createAztecNodeClient } from '@aztec/aztec.js/node';
|
|
3
|
+
import type { SendOptions } from '@aztec/aztec.js/wallet';
|
|
4
|
+
import { BackendType, BarretenbergSync } from '@aztec/bb.js';
|
|
5
|
+
import { jsonStringify } from '@aztec/foundation/json-rpc';
|
|
6
|
+
import { createLogger } from '@aztec/foundation/log';
|
|
7
|
+
import type { ApiSchema, Fr } from '@aztec/foundation/schemas';
|
|
8
|
+
import { getSchemaParameters, parseWithOptionals, schemaHasMethod } from '@aztec/foundation/schemas';
|
|
9
|
+
import { NodeListener, TransportServer } from '@aztec/foundation/transport';
|
|
10
|
+
import { ExecutionPayload, Tx } from '@aztec/stdlib/tx';
|
|
11
|
+
|
|
12
|
+
import { workerData } from 'worker_threads';
|
|
13
|
+
|
|
14
|
+
import { TestWallet } from './test_wallet.js';
|
|
15
|
+
import { WorkerWalletSchema } from './worker_wallet_schema.js';
|
|
16
|
+
|
|
17
|
+
const logger = createLogger('e2e:test-wallet:worker');
|
|
18
|
+
|
|
19
|
+
try {
|
|
20
|
+
const { nodeUrl, pxeConfig } = workerData as { nodeUrl: string; pxeConfig?: Record<string, unknown> };
|
|
21
|
+
|
|
22
|
+
logger.info('Initializing worker wallet', { nodeUrl });
|
|
23
|
+
const node = createAztecNodeClient(nodeUrl);
|
|
24
|
+
// Worker sync bb use is limited to crypto and proof serialization helpers.
|
|
25
|
+
await BarretenbergSync.initSingleton({ backend: BackendType.Wasm });
|
|
26
|
+
const wallet = await TestWallet.create(node, pxeConfig);
|
|
27
|
+
// Worker wallets are only used by spartan tests against remote JSON-RPC nodes: keep the 1s poll cadence.
|
|
28
|
+
wallet.setDefaultWaitInterval(DefaultWaitOpts.interval);
|
|
29
|
+
logger.info('Worker wallet initialized');
|
|
30
|
+
|
|
31
|
+
const customMethods = {
|
|
32
|
+
proveTx: async (exec: ExecutionPayload, opts: Omit<SendOptions, 'wait'>) => {
|
|
33
|
+
const provenTx = await wallet.proveTx(exec, opts);
|
|
34
|
+
return new Tx(
|
|
35
|
+
provenTx.getTxHash(),
|
|
36
|
+
provenTx.data,
|
|
37
|
+
provenTx.chonkProof,
|
|
38
|
+
provenTx.contractClassLogFields,
|
|
39
|
+
provenTx.publicFunctionCalldata,
|
|
40
|
+
);
|
|
41
|
+
},
|
|
42
|
+
registerAccount: async (secret: Fr, salt: Fr) => {
|
|
43
|
+
const manager = await wallet.createSchnorrAccount(secret, salt);
|
|
44
|
+
return manager.address;
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const schema = WorkerWalletSchema as ApiSchema;
|
|
49
|
+
const listener = new NodeListener();
|
|
50
|
+
const server = new TransportServer<{ fn: string; args: string }>(listener, async msg => {
|
|
51
|
+
if (!schemaHasMethod(schema, msg.fn)) {
|
|
52
|
+
throw new Error(`Unknown method: ${msg.fn}`);
|
|
53
|
+
}
|
|
54
|
+
const jsonParams = JSON.parse(msg.args) as unknown[];
|
|
55
|
+
const args: any[] = await parseWithOptionals(jsonParams, getSchemaParameters(schema[msg.fn]));
|
|
56
|
+
// we have to erase the fn type in order to be able to spread ...args
|
|
57
|
+
const handler: ((...args: any[]) => Promise<any>) | undefined =
|
|
58
|
+
msg.fn in customMethods ? customMethods[msg.fn as keyof typeof customMethods] : undefined;
|
|
59
|
+
const result = handler ? await handler(...args) : await (wallet as any)[msg.fn](...args);
|
|
60
|
+
return jsonStringify(result);
|
|
61
|
+
});
|
|
62
|
+
server.start();
|
|
63
|
+
} catch (err: unknown) {
|
|
64
|
+
logger.error('Worker wallet initialization failed', { error: err instanceof Error ? err.stack : String(err) });
|
|
65
|
+
process.exit(1);
|
|
66
|
+
}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import type { CallIntent, IntentInnerHash } from '@aztec/aztec.js/authorization';
|
|
2
|
+
import type { InteractionWaitOptions, SendReturn } from '@aztec/aztec.js/contracts';
|
|
3
|
+
import type {
|
|
4
|
+
Aliased,
|
|
5
|
+
AppCapabilities,
|
|
6
|
+
BatchResults,
|
|
7
|
+
BatchedMethod,
|
|
8
|
+
ContractClassMetadata,
|
|
9
|
+
ContractMetadata,
|
|
10
|
+
ExecuteUtilityOptions,
|
|
11
|
+
PrivateEvent,
|
|
12
|
+
PrivateEventFilter,
|
|
13
|
+
ProfileOptions,
|
|
14
|
+
SendOptions,
|
|
15
|
+
SimulateOptions,
|
|
16
|
+
TxSimulationResultWithAppOffset,
|
|
17
|
+
Wallet,
|
|
18
|
+
WalletCapabilities,
|
|
19
|
+
} from '@aztec/aztec.js/wallet';
|
|
20
|
+
import type { ChainInfo } from '@aztec/entrypoints/interfaces';
|
|
21
|
+
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
22
|
+
import { jsonStringify } from '@aztec/foundation/json-rpc';
|
|
23
|
+
import { createLogger } from '@aztec/foundation/log';
|
|
24
|
+
import { promiseWithResolvers } from '@aztec/foundation/promise';
|
|
25
|
+
import { type ApiSchema, getSchemaReturnType } from '@aztec/foundation/schemas';
|
|
26
|
+
import { sleep } from '@aztec/foundation/sleep';
|
|
27
|
+
import { NodeConnector, TransportClient } from '@aztec/foundation/transport';
|
|
28
|
+
import type { PXEConfig } from '@aztec/pxe/config';
|
|
29
|
+
import type { ContractArtifact, EventMetadataDefinition, FunctionCall } from '@aztec/stdlib/abi';
|
|
30
|
+
import type { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
31
|
+
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
32
|
+
import type { ContractInstancePreimage } from '@aztec/stdlib/contract';
|
|
33
|
+
import type { ExecutionPayload, TxProfileResult, UtilityExecutionResult } from '@aztec/stdlib/tx';
|
|
34
|
+
import { Tx } from '@aztec/stdlib/tx';
|
|
35
|
+
|
|
36
|
+
import { Worker } from 'worker_threads';
|
|
37
|
+
|
|
38
|
+
import { WorkerWalletSchema } from './worker_wallet_schema.js';
|
|
39
|
+
|
|
40
|
+
type WorkerMsg = { fn: string; args: string };
|
|
41
|
+
|
|
42
|
+
const log = createLogger('e2e:test-wallet:worker-wallet');
|
|
43
|
+
|
|
44
|
+
const WORKER_READY_TIMEOUT_MS = 120_000;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Wallet implementation that offloads all work to a worker thread.
|
|
48
|
+
* Implements the Wallet interface by proxying calls over a transport layer
|
|
49
|
+
* using JSON serialization with Zod schema parsing on both ends.
|
|
50
|
+
*/
|
|
51
|
+
export class WorkerWallet implements Wallet {
|
|
52
|
+
private constructor(
|
|
53
|
+
private worker: Worker,
|
|
54
|
+
private client: TransportClient<WorkerMsg>,
|
|
55
|
+
) {}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Creates a WorkerWallet by spawning a worker thread that creates a TestWallet internally.
|
|
59
|
+
* @param nodeUrl - URL of the Aztec node to connect to.
|
|
60
|
+
* @param pxeConfig - Optional PXE configuration overrides.
|
|
61
|
+
* @returns A WorkerWallet ready to use.
|
|
62
|
+
*/
|
|
63
|
+
static async create(nodeUrl: string, pxeConfig?: Partial<PXEConfig>): Promise<WorkerWallet> {
|
|
64
|
+
// replace stc/ with dest/ so the wallet works in Jest tests
|
|
65
|
+
const workerUrl = new URL('./wallet_worker_script.js', import.meta.url);
|
|
66
|
+
workerUrl.pathname = workerUrl.pathname.replace('/src/', '/dest/');
|
|
67
|
+
// remove JEST_WORKER_ID so the worker uses pino-pretty transport instead of Jest's raw output.
|
|
68
|
+
const { JEST_WORKER_ID: _, ...parentEnv } = process.env;
|
|
69
|
+
const worker = new Worker(workerUrl, {
|
|
70
|
+
workerData: { nodeUrl, pxeConfig },
|
|
71
|
+
env: {
|
|
72
|
+
...parentEnv,
|
|
73
|
+
...(process.stderr.isTTY || process.env.FORCE_COLOR ? { FORCE_COLOR: '1' } : {}),
|
|
74
|
+
LOG_LEVEL: process.env.WORKER_LOG_LEVEL ?? 'info',
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
const connector = new NodeConnector(worker);
|
|
79
|
+
const client = new TransportClient<WorkerMsg>(connector);
|
|
80
|
+
await client.open();
|
|
81
|
+
|
|
82
|
+
const wallet = new WorkerWallet(worker, client);
|
|
83
|
+
|
|
84
|
+
const { promise: workerDied, reject: rejectWorkerDied } = promiseWithResolvers<void>();
|
|
85
|
+
// reject if the worker exits or errors before the warmup completes.
|
|
86
|
+
const onError = (err: Error): void => {
|
|
87
|
+
worker.off('exit', onExit!);
|
|
88
|
+
rejectWorkerDied(new Error(`Worker wallet thread error: ${err.message}`));
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const onExit = (code: number): void => {
|
|
92
|
+
worker.off('error', onError!);
|
|
93
|
+
rejectWorkerDied(new Error(`Worker wallet thread exited with code ${code} before becoming ready`));
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
worker.once('error', onError);
|
|
97
|
+
worker.once('exit', onExit);
|
|
98
|
+
|
|
99
|
+
const timeout = sleep(WORKER_READY_TIMEOUT_MS).then(() => {
|
|
100
|
+
throw new Error(`Worker wallet creation timed out after ${WORKER_READY_TIMEOUT_MS / 1000}s`);
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
try {
|
|
104
|
+
// wait for worker wallet to start
|
|
105
|
+
await Promise.race([wallet.getChainInfo(), workerDied, timeout]);
|
|
106
|
+
} catch (err) {
|
|
107
|
+
log.error('Worker wallet creation failed, cleaning up', { error: String(err) });
|
|
108
|
+
client.close();
|
|
109
|
+
await worker.terminate();
|
|
110
|
+
throw err;
|
|
111
|
+
} finally {
|
|
112
|
+
worker.off('error', onError);
|
|
113
|
+
worker.off('exit', onExit);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return wallet;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
private async callRaw(fn: string, ...args: any[]): Promise<string> {
|
|
120
|
+
const argsJson = jsonStringify(args);
|
|
121
|
+
return (await this.client.request({ fn, args: argsJson })) as string;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
private async call(fn: string, ...args: any[]): Promise<any> {
|
|
125
|
+
const resultJson = await this.callRaw(fn, ...args);
|
|
126
|
+
const methodSchema = (WorkerWalletSchema as ApiSchema)[fn];
|
|
127
|
+
return getSchemaReturnType(methodSchema).parseAsync(JSON.parse(resultJson));
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
getChainInfo(): Promise<ChainInfo> {
|
|
131
|
+
return this.call('getChainInfo');
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
getContractMetadata(address: AztecAddress): Promise<ContractMetadata> {
|
|
135
|
+
return this.call('getContractMetadata', address);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
getContractClassMetadata(id: Fr): Promise<ContractClassMetadata> {
|
|
139
|
+
return this.call('getContractClassMetadata', id);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
getPrivateEvents<T>(
|
|
143
|
+
eventMetadata: EventMetadataDefinition,
|
|
144
|
+
eventFilter: PrivateEventFilter,
|
|
145
|
+
): Promise<PrivateEvent<T>[]> {
|
|
146
|
+
return this.call('getPrivateEvents', eventMetadata, eventFilter);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
registerSender(address: AztecAddress, alias?: string): Promise<AztecAddress> {
|
|
150
|
+
return this.call('registerSender', address, alias);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
getAddressBook(): Promise<Aliased<AztecAddress>[]> {
|
|
154
|
+
return this.call('getAddressBook');
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
getAccounts(): Promise<Aliased<AztecAddress>[]> {
|
|
158
|
+
return this.call('getAccounts');
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
registerContract(instance: ContractInstancePreimage, artifact?: ContractArtifact, secretKey?: Fr): Promise<void> {
|
|
162
|
+
return this.call('registerContract', instance, artifact, secretKey);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
registerContractClass(artifact: ContractArtifact): Promise<void> {
|
|
166
|
+
return this.call('registerContractClass', artifact);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
simulateTx(exec: ExecutionPayload, opts: SimulateOptions): Promise<TxSimulationResultWithAppOffset> {
|
|
170
|
+
return this.call('simulateTx', exec, opts);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
executeUtility(call: FunctionCall, opts: ExecuteUtilityOptions): Promise<UtilityExecutionResult> {
|
|
174
|
+
return this.call('executeUtility', call, opts);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
profileTx(exec: ExecutionPayload, opts: ProfileOptions): Promise<TxProfileResult> {
|
|
178
|
+
return this.call('profileTx', exec, opts);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
sendTx<W extends InteractionWaitOptions = undefined>(
|
|
182
|
+
exec: ExecutionPayload,
|
|
183
|
+
opts: SendOptions<W>,
|
|
184
|
+
): Promise<SendReturn<W>> {
|
|
185
|
+
return this.call('sendTx', exec, opts);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
proveTx(exec: ExecutionPayload, opts: Omit<SendOptions, 'wait'>): Promise<Tx> {
|
|
189
|
+
return this.call('proveTx', exec, opts);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/** Registers an account inside the worker's TestWallet, populating its accounts map. */
|
|
193
|
+
registerAccount(secret: Fr, salt: Fr): Promise<AztecAddress> {
|
|
194
|
+
return this.call('registerAccount', secret, salt);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
createAuthWit(from: AztecAddress, messageHashOrIntent: IntentInnerHash | CallIntent): Promise<AuthWitness> {
|
|
198
|
+
return this.call('createAuthWit', from, messageHashOrIntent);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
requestCapabilities(manifest: AppCapabilities): Promise<WalletCapabilities> {
|
|
202
|
+
return this.call('requestCapabilities', manifest);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
batch<const T extends readonly BatchedMethod[]>(methods: T): Promise<BatchResults<T>> {
|
|
206
|
+
return this.call('batch', methods);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/** Shuts down the worker thread and closes the transport. */
|
|
210
|
+
async stop(): Promise<void> {
|
|
211
|
+
this.client.close();
|
|
212
|
+
await this.worker.terminate();
|
|
213
|
+
}
|
|
214
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ExecutionPayloadSchema, SendOptionsSchema, WalletSchema } from '@aztec/aztec.js/wallet';
|
|
2
|
+
import type { ApiSchema } from '@aztec/foundation/schemas';
|
|
3
|
+
import { schemas } from '@aztec/foundation/schemas';
|
|
4
|
+
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
|
+
import { Tx } from '@aztec/stdlib/tx';
|
|
6
|
+
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
|
|
9
|
+
/** Schema for the WorkerWallet API — extends WalletSchema with proveTx and registerAccount. */
|
|
10
|
+
export const WorkerWalletSchema: ApiSchema = {
|
|
11
|
+
...WalletSchema,
|
|
12
|
+
proveTx: z.function({ input: z.tuple([ExecutionPayloadSchema, SendOptionsSchema]), output: Tx.schema }),
|
|
13
|
+
registerAccount: z.function({ input: z.tuple([schemas.Fr, schemas.Fr]), output: AztecAddress.schema }),
|
|
14
|
+
};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
-
import { Fr } from '@aztec/aztec.js/fields';
|
|
3
|
-
import { type Logger } from '@aztec/aztec.js/log';
|
|
4
|
-
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
5
|
-
import type { TxHash } from '@aztec/aztec.js/tx';
|
|
6
|
-
import type { CheatCodes } from '@aztec/aztec/testing';
|
|
7
|
-
import { TokenBlacklistContract } from '@aztec/noir-contracts.js/TokenBlacklist';
|
|
8
|
-
import { InvalidAccountContract } from '@aztec/noir-test-contracts.js/InvalidAccount';
|
|
9
|
-
import type { SequencerClient } from '@aztec/sequencer-client';
|
|
10
|
-
import type { TestWallet } from '@aztec/test-wallet/server';
|
|
11
|
-
import { type SubsystemsContext } from '../fixtures/snapshot_manager.js';
|
|
12
|
-
import { TokenSimulator } from '../simulators/token_simulator.js';
|
|
13
|
-
export declare class Role {
|
|
14
|
-
private isAdmin;
|
|
15
|
-
private isMinter;
|
|
16
|
-
private isBlacklisted;
|
|
17
|
-
withAdmin(): this;
|
|
18
|
-
withMinter(): this;
|
|
19
|
-
withBlacklisted(): this;
|
|
20
|
-
toNoirStruct(): {
|
|
21
|
-
is_admin: boolean;
|
|
22
|
-
is_minter: boolean;
|
|
23
|
-
is_blacklisted: boolean;
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
export declare class BlacklistTokenContractTest {
|
|
27
|
-
static CHANGE_ROLES_DELAY: number;
|
|
28
|
-
private snapshotManager;
|
|
29
|
-
logger: Logger;
|
|
30
|
-
wallet: TestWallet;
|
|
31
|
-
asset: TokenBlacklistContract;
|
|
32
|
-
tokenSim: TokenSimulator;
|
|
33
|
-
badAccount: InvalidAccountContract;
|
|
34
|
-
cheatCodes: CheatCodes;
|
|
35
|
-
sequencer: SequencerClient;
|
|
36
|
-
aztecNode: AztecNode;
|
|
37
|
-
adminAddress: AztecAddress;
|
|
38
|
-
otherAddress: AztecAddress;
|
|
39
|
-
blacklistedAddress: AztecAddress;
|
|
40
|
-
constructor(testName: string);
|
|
41
|
-
crossTimestampOfChange(): Promise<void>;
|
|
42
|
-
/**
|
|
43
|
-
* Adds two state shifts to snapshot manager.
|
|
44
|
-
* 1. Add 3 accounts.
|
|
45
|
-
* 2. Publicly deploy accounts, deploy token contract and a "bad account".
|
|
46
|
-
*/
|
|
47
|
-
applyBaseSnapshots(): Promise<void>;
|
|
48
|
-
setup(): Promise<void>;
|
|
49
|
-
snapshot: <T>(name: string, apply: (context: SubsystemsContext) => Promise<T>, restore?: (snapshotData: T, context: SubsystemsContext) => Promise<void>) => Promise<void>;
|
|
50
|
-
teardown(): Promise<void>;
|
|
51
|
-
addPendingShieldNoteToPXE(contract: TokenBlacklistContract, recipient: AztecAddress, amount: bigint, secretHash: Fr, txHash: TxHash): Promise<void>;
|
|
52
|
-
applyMintSnapshot(): Promise<void>;
|
|
53
|
-
}
|
|
54
|
-
//# sourceMappingURL=blacklist_token_contract_test.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"blacklist_token_contract_test.d.ts","sourceRoot":"","sources":["../../src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,OAAO,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AAC5C,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,qBAAqB,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,8CAA8C,CAAC;AACtF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAI5D,OAAO,EAEL,KAAK,iBAAiB,EAIvB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAIlE,qBAAa,IAAI;IACf,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,aAAa,CAAS;IAE9B,SAAS;IAKT,UAAU;IAKV,eAAe;IAKf,YAAY;;;;;CAKb;AAED,qBAAa,0BAA0B;IAErC,MAAM,CAAC,kBAAkB,SAAS;IAElC,OAAO,CAAC,eAAe,CAAmB;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAG,UAAU,CAAC;IACpB,KAAK,EAAG,sBAAsB,CAAC;IAC/B,QAAQ,EAAG,cAAc,CAAC;IAC1B,UAAU,EAAG,sBAAsB,CAAC;IACpC,UAAU,EAAG,UAAU,CAAC;IACxB,SAAS,EAAG,eAAe,CAAC;IAC5B,SAAS,EAAG,SAAS,CAAC;IAEtB,YAAY,EAAG,YAAY,CAAC;IAC5B,YAAY,EAAG,YAAY,CAAC;IAC5B,kBAAkB,EAAG,YAAY,CAAC;gBAEtB,QAAQ,EAAE,MAAM;IAKtB,sBAAsB;IAQ5B;;;;OAIG;IACG,kBAAkB;IAgElB,KAAK;IAIX,QAAQ,GAAI,CAAC,EACX,MAAM,MAAM,EACZ,OAAO,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,CAAC,CAAC,EACjD,UAAS,CAAC,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAA2B,KAChG,OAAO,CAAC,IAAI,CAAC,CAAwD;IAElE,QAAQ;IAIR,yBAAyB,CAC7B,QAAQ,EAAE,sBAAsB,EAChC,SAAS,EAAE,YAAY,EACvB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,EAAE,EACd,MAAM,EAAE,MAAM;IAgBV,iBAAiB;CAmExB"}
|
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
import { computeSecretHash } from '@aztec/aztec.js/crypto';
|
|
2
|
-
import { Fr } from '@aztec/aztec.js/fields';
|
|
3
|
-
import { createLogger } from '@aztec/aztec.js/log';
|
|
4
|
-
import { TokenBlacklistContract } from '@aztec/noir-contracts.js/TokenBlacklist';
|
|
5
|
-
import { InvalidAccountContract } from '@aztec/noir-test-contracts.js/InvalidAccount';
|
|
6
|
-
import { jest } from '@jest/globals';
|
|
7
|
-
import { createSnapshotManager, deployAccounts, publicDeployAccounts } from '../fixtures/snapshot_manager.js';
|
|
8
|
-
import { TokenSimulator } from '../simulators/token_simulator.js';
|
|
9
|
-
const { E2E_DATA_PATH: dataPath } = process.env;
|
|
10
|
-
export class Role {
|
|
11
|
-
isAdmin = false;
|
|
12
|
-
isMinter = false;
|
|
13
|
-
isBlacklisted = false;
|
|
14
|
-
withAdmin() {
|
|
15
|
-
this.isAdmin = true;
|
|
16
|
-
return this;
|
|
17
|
-
}
|
|
18
|
-
withMinter() {
|
|
19
|
-
this.isMinter = true;
|
|
20
|
-
return this;
|
|
21
|
-
}
|
|
22
|
-
withBlacklisted() {
|
|
23
|
-
this.isBlacklisted = true;
|
|
24
|
-
return this;
|
|
25
|
-
}
|
|
26
|
-
toNoirStruct() {
|
|
27
|
-
// We need to use lowercase identifiers as those are what the noir interface expects
|
|
28
|
-
// eslint-disable-next-line camelcase
|
|
29
|
-
return {
|
|
30
|
-
is_admin: this.isAdmin,
|
|
31
|
-
is_minter: this.isMinter,
|
|
32
|
-
is_blacklisted: this.isBlacklisted
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
export class BlacklistTokenContractTest {
|
|
37
|
-
// This value MUST match the same value that we have in the contract
|
|
38
|
-
static CHANGE_ROLES_DELAY = 86400;
|
|
39
|
-
snapshotManager;
|
|
40
|
-
logger;
|
|
41
|
-
wallet;
|
|
42
|
-
asset;
|
|
43
|
-
tokenSim;
|
|
44
|
-
badAccount;
|
|
45
|
-
cheatCodes;
|
|
46
|
-
sequencer;
|
|
47
|
-
aztecNode;
|
|
48
|
-
adminAddress;
|
|
49
|
-
otherAddress;
|
|
50
|
-
blacklistedAddress;
|
|
51
|
-
constructor(testName){
|
|
52
|
-
this.logger = createLogger(`e2e:e2e_blacklist_token_contract:${testName}`);
|
|
53
|
-
this.snapshotManager = createSnapshotManager(`e2e_blacklist_token_contract/${testName}`, dataPath);
|
|
54
|
-
}
|
|
55
|
-
async crossTimestampOfChange() {
|
|
56
|
-
await this.cheatCodes.warpL2TimeAtLeastBy(this.sequencer, this.aztecNode, BlacklistTokenContractTest.CHANGE_ROLES_DELAY);
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Adds two state shifts to snapshot manager.
|
|
60
|
-
* 1. Add 3 accounts.
|
|
61
|
-
* 2. Publicly deploy accounts, deploy token contract and a "bad account".
|
|
62
|
-
*/ async applyBaseSnapshots() {
|
|
63
|
-
// Adding a timeout of 2 minutes in here such that it is propagated to the underlying tests
|
|
64
|
-
jest.setTimeout(120_000);
|
|
65
|
-
await this.snapshotManager.snapshot('3_accounts', deployAccounts(3, this.logger), ({ deployedAccounts }, { cheatCodes, aztecNode, sequencer, wallet })=>{
|
|
66
|
-
this.cheatCodes = cheatCodes;
|
|
67
|
-
this.aztecNode = aztecNode;
|
|
68
|
-
this.sequencer = sequencer;
|
|
69
|
-
this.wallet = wallet;
|
|
70
|
-
this.adminAddress = deployedAccounts[0].address;
|
|
71
|
-
this.otherAddress = deployedAccounts[1].address;
|
|
72
|
-
this.blacklistedAddress = deployedAccounts[2].address;
|
|
73
|
-
return Promise.resolve();
|
|
74
|
-
});
|
|
75
|
-
await this.snapshotManager.snapshot('e2e_blacklist_token_contract', async ()=>{
|
|
76
|
-
// Create the token contract state.
|
|
77
|
-
// Move this account thing to addAccounts above?
|
|
78
|
-
this.logger.verbose(`Public deploy accounts...`);
|
|
79
|
-
await publicDeployAccounts(this.wallet, [
|
|
80
|
-
this.adminAddress,
|
|
81
|
-
this.otherAddress,
|
|
82
|
-
this.blacklistedAddress
|
|
83
|
-
]);
|
|
84
|
-
this.logger.verbose(`Deploying TokenContract...`);
|
|
85
|
-
this.asset = await TokenBlacklistContract.deploy(this.wallet, this.adminAddress).send({
|
|
86
|
-
from: this.adminAddress
|
|
87
|
-
}).deployed();
|
|
88
|
-
this.logger.verbose(`Token deployed to ${this.asset.address}`);
|
|
89
|
-
this.logger.verbose(`Deploying bad account...`);
|
|
90
|
-
this.badAccount = await InvalidAccountContract.deploy(this.wallet).send({
|
|
91
|
-
from: this.adminAddress
|
|
92
|
-
}).deployed();
|
|
93
|
-
this.logger.verbose(`Deployed to ${this.badAccount.address}.`);
|
|
94
|
-
await this.crossTimestampOfChange();
|
|
95
|
-
return {
|
|
96
|
-
tokenContractAddress: this.asset.address,
|
|
97
|
-
badAccountAddress: this.badAccount.address
|
|
98
|
-
};
|
|
99
|
-
}, async ({ tokenContractAddress, badAccountAddress })=>{
|
|
100
|
-
// Restore the token contract state.
|
|
101
|
-
this.asset = await TokenBlacklistContract.at(tokenContractAddress, this.wallet);
|
|
102
|
-
this.logger.verbose(`Token contract address: ${this.asset.address}`);
|
|
103
|
-
this.tokenSim = new TokenSimulator(this.asset, this.wallet, this.adminAddress, this.logger, [
|
|
104
|
-
this.adminAddress,
|
|
105
|
-
this.otherAddress,
|
|
106
|
-
this.blacklistedAddress
|
|
107
|
-
]);
|
|
108
|
-
this.badAccount = await InvalidAccountContract.at(badAccountAddress, this.wallet);
|
|
109
|
-
this.logger.verbose(`Bad account address: ${this.badAccount.address}`);
|
|
110
|
-
expect(await this.asset.methods.get_roles(this.adminAddress).simulate({
|
|
111
|
-
from: this.adminAddress
|
|
112
|
-
})).toEqual(new Role().withAdmin().toNoirStruct());
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
async setup() {
|
|
116
|
-
await this.snapshotManager.setup();
|
|
117
|
-
}
|
|
118
|
-
snapshot = (name, apply, restore = ()=>Promise.resolve())=>this.snapshotManager.snapshot(name, apply, restore);
|
|
119
|
-
async teardown() {
|
|
120
|
-
await this.snapshotManager.teardown();
|
|
121
|
-
}
|
|
122
|
-
async addPendingShieldNoteToPXE(contract, recipient, amount, secretHash, txHash) {
|
|
123
|
-
const txEffects = await this.aztecNode.getTxEffect(txHash);
|
|
124
|
-
await contract.methods.deliver_transparent_note(contract.address, amount, secretHash, txHash.hash, txEffects.data.noteHashes, txEffects.data.nullifiers[0], recipient).simulate({
|
|
125
|
-
from: recipient
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
async applyMintSnapshot() {
|
|
129
|
-
await this.snapshotManager.snapshot('mint', async ()=>{
|
|
130
|
-
const { asset } = this;
|
|
131
|
-
const amount = 10000n;
|
|
132
|
-
const adminMinterRole = new Role().withAdmin().withMinter();
|
|
133
|
-
await this.asset.methods.update_roles(this.adminAddress, adminMinterRole.toNoirStruct()).send({
|
|
134
|
-
from: this.adminAddress
|
|
135
|
-
}).wait();
|
|
136
|
-
const blacklistRole = new Role().withBlacklisted();
|
|
137
|
-
await this.asset.methods.update_roles(this.blacklistedAddress, blacklistRole.toNoirStruct()).send({
|
|
138
|
-
from: this.adminAddress
|
|
139
|
-
}).wait();
|
|
140
|
-
await this.crossTimestampOfChange();
|
|
141
|
-
expect(await this.asset.methods.get_roles(this.adminAddress).simulate({
|
|
142
|
-
from: this.adminAddress
|
|
143
|
-
})).toEqual(adminMinterRole.toNoirStruct());
|
|
144
|
-
this.logger.verbose(`Minting ${amount} publicly...`);
|
|
145
|
-
await asset.methods.mint_public(this.adminAddress, amount).send({
|
|
146
|
-
from: this.adminAddress
|
|
147
|
-
}).wait();
|
|
148
|
-
this.logger.verbose(`Minting ${amount} privately...`);
|
|
149
|
-
const secret = Fr.random();
|
|
150
|
-
const secretHash = await computeSecretHash(secret);
|
|
151
|
-
const receipt = await asset.methods.mint_private(amount, secretHash).send({
|
|
152
|
-
from: this.adminAddress
|
|
153
|
-
}).wait();
|
|
154
|
-
await this.addPendingShieldNoteToPXE(asset, this.adminAddress, amount, secretHash, receipt.txHash);
|
|
155
|
-
const txClaim = asset.methods.redeem_shield(this.adminAddress, amount, secret).send({
|
|
156
|
-
from: this.adminAddress
|
|
157
|
-
});
|
|
158
|
-
await txClaim.wait();
|
|
159
|
-
this.logger.verbose(`Minting complete.`);
|
|
160
|
-
return {
|
|
161
|
-
amount
|
|
162
|
-
};
|
|
163
|
-
}, async ({ amount })=>{
|
|
164
|
-
const { asset, tokenSim } = this;
|
|
165
|
-
tokenSim.mintPublic(this.adminAddress, amount);
|
|
166
|
-
const publicBalance = await asset.methods.balance_of_public(this.adminAddress).simulate({
|
|
167
|
-
from: this.adminAddress
|
|
168
|
-
});
|
|
169
|
-
this.logger.verbose(`Public balance of wallet 0: ${publicBalance}`);
|
|
170
|
-
expect(publicBalance).toEqual(this.tokenSim.balanceOfPublic(this.adminAddress));
|
|
171
|
-
tokenSim.mintPrivate(this.adminAddress, amount);
|
|
172
|
-
const privateBalance = await asset.methods.balance_of_private(this.adminAddress).simulate({
|
|
173
|
-
from: this.adminAddress
|
|
174
|
-
});
|
|
175
|
-
this.logger.verbose(`Private balance of wallet 0: ${privateBalance}`);
|
|
176
|
-
expect(privateBalance).toEqual(tokenSim.balanceOfPrivate(this.adminAddress));
|
|
177
|
-
const totalSupply = await asset.methods.total_supply().simulate({
|
|
178
|
-
from: this.adminAddress
|
|
179
|
-
});
|
|
180
|
-
this.logger.verbose(`Total supply: ${totalSupply}`);
|
|
181
|
-
expect(totalSupply).toEqual(tokenSim.totalSupply);
|
|
182
|
-
return Promise.resolve();
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { AztecNodeConfig } from '@aztec/aztec-node';
|
|
2
|
-
import { AztecAddress, EthAddress } from '@aztec/aztec.js/addresses';
|
|
3
|
-
import { type Logger } from '@aztec/aztec.js/log';
|
|
4
|
-
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
5
|
-
import { CheatCodes } from '@aztec/aztec/testing';
|
|
6
|
-
import { type DeployL1ContractsArgs, type DeployL1ContractsReturnType, type ExtendedViemWalletClient } from '@aztec/ethereum';
|
|
7
|
-
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
8
|
-
import { TokenBridgeContract } from '@aztec/noir-contracts.js/TokenBridge';
|
|
9
|
-
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
10
|
-
import type { TestWallet } from '@aztec/test-wallet/server';
|
|
11
|
-
import { type SubsystemsContext } from '../fixtures/snapshot_manager.js';
|
|
12
|
-
import type { SetupOptions } from '../fixtures/utils.js';
|
|
13
|
-
import { CrossChainTestHarness } from '../shared/cross_chain_test_harness.js';
|
|
14
|
-
export declare class CrossChainMessagingTest {
|
|
15
|
-
private snapshotManager;
|
|
16
|
-
logger: Logger;
|
|
17
|
-
aztecNode: AztecNode;
|
|
18
|
-
aztecNodeConfig: AztecNodeConfig;
|
|
19
|
-
aztecNodeAdmin: AztecNodeAdmin;
|
|
20
|
-
ctx: SubsystemsContext;
|
|
21
|
-
l1Client: ExtendedViemWalletClient | undefined;
|
|
22
|
-
wallet: TestWallet;
|
|
23
|
-
ownerAddress: AztecAddress;
|
|
24
|
-
user1Address: AztecAddress;
|
|
25
|
-
user2Address: AztecAddress;
|
|
26
|
-
crossChainTestHarness: CrossChainTestHarness;
|
|
27
|
-
ethAccount: EthAddress;
|
|
28
|
-
l2Token: TokenContract;
|
|
29
|
-
l2Bridge: TokenBridgeContract;
|
|
30
|
-
inbox: any;
|
|
31
|
-
outbox: any;
|
|
32
|
-
cheatCodes: CheatCodes;
|
|
33
|
-
deployL1ContractsValues: DeployL1ContractsReturnType;
|
|
34
|
-
constructor(testName: string, opts?: SetupOptions, deployL1ContractsArgs?: Partial<DeployL1ContractsArgs>);
|
|
35
|
-
assumeProven(): Promise<void>;
|
|
36
|
-
setup(): Promise<void>;
|
|
37
|
-
snapshot: <T>(name: string, apply: (context: SubsystemsContext) => Promise<T>, restore?: (snapshotData: T, context: SubsystemsContext) => Promise<void>) => Promise<void>;
|
|
38
|
-
teardown(): Promise<void>;
|
|
39
|
-
applyBaseSnapshots(): Promise<void>;
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=cross_chain_messaging_test.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cross_chain_messaging_test.d.ts","sourceRoot":"","sources":["../../src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,qBAAqB,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAG9B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAK5D,OAAO,EAEL,KAAK,iBAAiB,EAIvB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAI9E,qBAAa,uBAAuB;IAClC,OAAO,CAAC,eAAe,CAAmB;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAG,SAAS,CAAC;IACtB,eAAe,EAAG,eAAe,CAAC;IAClC,cAAc,EAAG,cAAc,CAAC;IAChC,GAAG,EAAG,iBAAiB,CAAC;IAExB,QAAQ,EAAG,wBAAwB,GAAG,SAAS,CAAC;IAEhD,MAAM,EAAG,UAAU,CAAC;IACpB,YAAY,EAAG,YAAY,CAAC;IAC5B,YAAY,EAAG,YAAY,CAAC;IAC5B,YAAY,EAAG,YAAY,CAAC;IAC5B,qBAAqB,EAAG,qBAAqB,CAAC;IAC9C,UAAU,EAAG,UAAU,CAAC;IACxB,OAAO,EAAG,aAAa,CAAC;IACxB,QAAQ,EAAG,mBAAmB,CAAC;IAE/B,KAAK,EAAG,GAAG,CAAC;IACZ,MAAM,EAAG,GAAG,CAAC;IACb,UAAU,EAAG,UAAU,CAAC;IAExB,uBAAuB,EAAG,2BAA2B,CAAC;gBAE1C,QAAQ,EAAE,MAAM,EAAE,IAAI,GAAE,YAAiB,EAAE,qBAAqB,GAAE,OAAO,CAAC,qBAAqB,CAAM;IAQ3G,YAAY;IAIZ,KAAK;IAUX,QAAQ,GAAI,CAAC,EACX,MAAM,MAAM,EACZ,OAAO,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,CAAC,CAAC,EACjD,UAAS,CAAC,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAA2B,KAChG,OAAO,CAAC,IAAI,CAAC,CAAwD;IAElE,QAAQ;IAIR,kBAAkB;CAuFzB"}
|