@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
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import type { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
-
import { type Logger } from '@aztec/aztec.js/log';
|
|
3
|
-
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
4
|
-
import { CheatCodes } from '@aztec/aztec/testing';
|
|
5
|
-
import { type DeployL1ContractsArgs, RollupContract } from '@aztec/ethereum';
|
|
6
|
-
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
7
|
-
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
8
|
-
import { AppSubscriptionContract } from '@aztec/noir-contracts.js/AppSubscription';
|
|
9
|
-
import { FPCContract } from '@aztec/noir-contracts.js/FPC';
|
|
10
|
-
import { FeeJuiceContract } from '@aztec/noir-contracts.js/FeeJuice';
|
|
11
|
-
import { SponsoredFPCContract } from '@aztec/noir-contracts.js/SponsoredFPC';
|
|
12
|
-
import { TokenContract as BananaCoin } from '@aztec/noir-contracts.js/Token';
|
|
13
|
-
import { CounterContract } from '@aztec/noir-test-contracts.js/Counter';
|
|
14
|
-
import { GasSettings } from '@aztec/stdlib/gas';
|
|
15
|
-
import { TestWallet } from '@aztec/test-wallet/server';
|
|
16
|
-
import { type SubsystemsContext } from '../fixtures/snapshot_manager.js';
|
|
17
|
-
import { type BalancesFn, type SetupOptions } from '../fixtures/utils.js';
|
|
18
|
-
import { type GasBridgingTestHarness } from '../shared/gas_portal_test_harness.js';
|
|
19
|
-
/**
|
|
20
|
-
* Test fixture for testing fees. Provides the following snapshots:
|
|
21
|
-
* InitialAccounts: Initializes 3 Schnorr account contracts.
|
|
22
|
-
* PublicDeployAccounts: Deploys the accounts publicly.
|
|
23
|
-
* DeployFeeJuice: Deploys the Fee Juice contract.
|
|
24
|
-
* FPCSetup: Deploys BananaCoin and FPC contracts, and bridges gas from L1.
|
|
25
|
-
* SponsoredFPCSetup: Deploys Sponsored FPC contract, and bridges gas from L1.
|
|
26
|
-
* FundAlice: Mints private and public bananas to Alice.
|
|
27
|
-
* SetupSubscription: Deploys a counter contract and a subscription contract, and mints Fee Juice to the subscription contract.
|
|
28
|
-
*/
|
|
29
|
-
export declare class FeesTest {
|
|
30
|
-
private numberOfAccounts;
|
|
31
|
-
private snapshotManager;
|
|
32
|
-
private accounts;
|
|
33
|
-
logger: Logger;
|
|
34
|
-
aztecNode: AztecNode;
|
|
35
|
-
cheatCodes: CheatCodes;
|
|
36
|
-
wallet: TestWallet;
|
|
37
|
-
aliceAddress: AztecAddress;
|
|
38
|
-
bobAddress: AztecAddress;
|
|
39
|
-
sequencerAddress: AztecAddress;
|
|
40
|
-
coinbase: EthAddress;
|
|
41
|
-
fpcAdmin: AztecAddress;
|
|
42
|
-
gasSettings: GasSettings;
|
|
43
|
-
rollupContract: RollupContract;
|
|
44
|
-
feeJuiceContract: FeeJuiceContract;
|
|
45
|
-
bananaCoin: BananaCoin;
|
|
46
|
-
bananaFPC: FPCContract;
|
|
47
|
-
sponsoredFPC: SponsoredFPCContract;
|
|
48
|
-
counterContract: CounterContract;
|
|
49
|
-
subscriptionContract: AppSubscriptionContract;
|
|
50
|
-
feeJuiceBridgeTestHarness: GasBridgingTestHarness;
|
|
51
|
-
context: SubsystemsContext;
|
|
52
|
-
chainMonitor: ChainMonitor;
|
|
53
|
-
getCoinbaseBalance: () => Promise<bigint>;
|
|
54
|
-
getCoinbaseSequencerRewards: () => Promise<bigint>;
|
|
55
|
-
getGasBalanceFn: BalancesFn;
|
|
56
|
-
getBananaPublicBalanceFn: BalancesFn;
|
|
57
|
-
getBananaPrivateBalanceFn: BalancesFn;
|
|
58
|
-
getProverFee: (blockNumber: number) => Promise<bigint>;
|
|
59
|
-
readonly ALICE_INITIAL_BANANAS: bigint;
|
|
60
|
-
readonly SUBSCRIPTION_AMOUNT: bigint;
|
|
61
|
-
readonly APP_SPONSORED_TX_GAS_LIMIT: bigint;
|
|
62
|
-
constructor(testName: string, numberOfAccounts?: number, setupOptions?: Partial<SetupOptions & DeployL1ContractsArgs>);
|
|
63
|
-
setup(): Promise<this>;
|
|
64
|
-
teardown(): Promise<void>;
|
|
65
|
-
setIsMarkingAsProven(b: boolean): void;
|
|
66
|
-
catchUpProvenChain(): Promise<void>;
|
|
67
|
-
getBlockRewards(): Promise<{
|
|
68
|
-
sequencerBlockRewards: bigint;
|
|
69
|
-
proverBlockRewards: bigint;
|
|
70
|
-
}>;
|
|
71
|
-
mintAndBridgeFeeJuice(minter: AztecAddress, recipient: AztecAddress): Promise<void>;
|
|
72
|
-
/** Alice mints bananaCoin tokens privately to the target address and redeems them. */
|
|
73
|
-
mintPrivateBananas(amount: bigint, address: AztecAddress): Promise<void>;
|
|
74
|
-
applyBaseSnapshots(): Promise<void>;
|
|
75
|
-
applyInitialAccountsSnapshot(): Promise<void>;
|
|
76
|
-
applyPublicDeployAccountsSnapshot(): Promise<void>;
|
|
77
|
-
applySetupFeeJuiceSnapshot(): Promise<void>;
|
|
78
|
-
applyDeployBananaTokenSnapshot(): Promise<void>;
|
|
79
|
-
applyFPCSetupSnapshot(): Promise<void>;
|
|
80
|
-
applySponsoredFPCSetupSnapshot(): Promise<void>;
|
|
81
|
-
applyFundAliceWithBananas(): Promise<void>;
|
|
82
|
-
applyFundAliceWithPrivateBananas(): Promise<void>;
|
|
83
|
-
}
|
|
84
|
-
//# sourceMappingURL=fees_test.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fees_test.d.ts","sourceRoot":"","sources":["../../src/e2e_fees/fees_test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,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,EAAE,KAAK,qBAAqB,EAAE,cAAc,EAA0B,MAAM,iBAAiB,CAAC;AACrG,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAG3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,aAAa,IAAI,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAGxE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAKvD,OAAO,EAEL,KAAK,iBAAiB,EAGvB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EACL,KAAK,UAAU,EACf,KAAK,YAAY,EAIlB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAuC,KAAK,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAIxH;;;;;;;;;GASG;AACH,qBAAa,QAAQ;IA4CjB,OAAO,CAAC,gBAAgB;IA3C1B,OAAO,CAAC,eAAe,CAAmB;IAC1C,OAAO,CAAC,QAAQ,CAAsB;IAE/B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAG,SAAS,CAAC;IACtB,UAAU,EAAG,UAAU,CAAC;IAExB,MAAM,EAAG,UAAU,CAAC;IACpB,YAAY,EAAG,YAAY,CAAC;IAC5B,UAAU,EAAG,YAAY,CAAC;IAC1B,gBAAgB,EAAG,YAAY,CAAC;IAChC,QAAQ,EAAG,UAAU,CAAC;IAEtB,QAAQ,EAAG,YAAY,CAAC;IAExB,WAAW,EAAG,WAAW,CAAC;IAE1B,cAAc,EAAG,cAAc,CAAC;IAEhC,gBAAgB,EAAG,gBAAgB,CAAC;IACpC,UAAU,EAAG,UAAU,CAAC;IACxB,SAAS,EAAG,WAAW,CAAC;IACxB,YAAY,EAAG,oBAAoB,CAAC;IACpC,eAAe,EAAG,eAAe,CAAC;IAClC,oBAAoB,EAAG,uBAAuB,CAAC;IAC/C,yBAAyB,EAAG,sBAAsB,CAAC;IAEnD,OAAO,EAAG,iBAAiB,CAAC;IAC5B,YAAY,EAAG,YAAY,CAAC;IAE5B,kBAAkB,EAAG,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IAC3C,2BAA2B,EAAG,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IACpD,eAAe,EAAG,UAAU,CAAC;IAC7B,wBAAwB,EAAG,UAAU,CAAC;IACtC,yBAAyB,EAAG,UAAU,CAAC;IACvC,YAAY,EAAG,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAE/D,SAAgB,qBAAqB,SAAgB;IACrD,SAAgB,mBAAmB,SAAgB;IACnD,SAAgB,0BAA0B,SAAgB;gBAGxD,QAAQ,EAAE,MAAM,EACR,gBAAgB,SAAI,EAC5B,YAAY,GAAE,OAAO,CAAC,YAAY,GAAG,qBAAqB,CAAM;IAgB5D,KAAK;IASL,QAAQ;IAKd,oBAAoB,CAAC,CAAC,EAAE,OAAO;IAIzB,kBAAkB;IAOlB,eAAe;;;;IAef,qBAAqB,CAAC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY;IASzE,sFAAsF;IAChF,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY;IAajD,kBAAkB;IAOzB,4BAA4B;IAsB5B,iCAAiC;IAMjC,0BAA0B;IA2B1B,8BAA8B;IA6BvB,qBAAqB;IAoErB,8BAA8B;IAoB9B,yBAAyB;IAczB,gCAAgC;CAS9C"}
|
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
import { createLogger } from '@aztec/aztec.js/log';
|
|
2
|
-
import { RollupContract, createExtendedL1Client } from '@aztec/ethereum';
|
|
3
|
-
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
4
|
-
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
5
|
-
import { sleep } from '@aztec/foundation/sleep';
|
|
6
|
-
import { TestERC20Abi } from '@aztec/l1-artifacts';
|
|
7
|
-
import { FPCContract } from '@aztec/noir-contracts.js/FPC';
|
|
8
|
-
import { FeeJuiceContract } from '@aztec/noir-contracts.js/FeeJuice';
|
|
9
|
-
import { SponsoredFPCContract } from '@aztec/noir-contracts.js/SponsoredFPC';
|
|
10
|
-
import { TokenContract as BananaCoin } from '@aztec/noir-contracts.js/Token';
|
|
11
|
-
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
12
|
-
import { getCanonicalFeeJuice } from '@aztec/protocol-contracts/fee-juice';
|
|
13
|
-
import { GasSettings } from '@aztec/stdlib/gas';
|
|
14
|
-
import { getContract } from 'viem';
|
|
15
|
-
import { MNEMONIC } from '../fixtures/fixtures.js';
|
|
16
|
-
import { createSnapshotManager, deployAccounts } from '../fixtures/snapshot_manager.js';
|
|
17
|
-
import { mintTokensToPrivate } from '../fixtures/token_utils.js';
|
|
18
|
-
import { ensureAccountContractsPublished, getBalancesFn, setupSponsoredFPC } from '../fixtures/utils.js';
|
|
19
|
-
import { FeeJuicePortalTestingHarnessFactory } from '../shared/gas_portal_test_harness.js';
|
|
20
|
-
const { E2E_DATA_PATH: dataPath } = process.env;
|
|
21
|
-
/**
|
|
22
|
-
* Test fixture for testing fees. Provides the following snapshots:
|
|
23
|
-
* InitialAccounts: Initializes 3 Schnorr account contracts.
|
|
24
|
-
* PublicDeployAccounts: Deploys the accounts publicly.
|
|
25
|
-
* DeployFeeJuice: Deploys the Fee Juice contract.
|
|
26
|
-
* FPCSetup: Deploys BananaCoin and FPC contracts, and bridges gas from L1.
|
|
27
|
-
* SponsoredFPCSetup: Deploys Sponsored FPC contract, and bridges gas from L1.
|
|
28
|
-
* FundAlice: Mints private and public bananas to Alice.
|
|
29
|
-
* SetupSubscription: Deploys a counter contract and a subscription contract, and mints Fee Juice to the subscription contract.
|
|
30
|
-
*/ export class FeesTest {
|
|
31
|
-
numberOfAccounts;
|
|
32
|
-
snapshotManager;
|
|
33
|
-
accounts;
|
|
34
|
-
logger;
|
|
35
|
-
aztecNode;
|
|
36
|
-
cheatCodes;
|
|
37
|
-
wallet;
|
|
38
|
-
aliceAddress;
|
|
39
|
-
bobAddress;
|
|
40
|
-
sequencerAddress;
|
|
41
|
-
coinbase;
|
|
42
|
-
fpcAdmin;
|
|
43
|
-
gasSettings;
|
|
44
|
-
rollupContract;
|
|
45
|
-
feeJuiceContract;
|
|
46
|
-
bananaCoin;
|
|
47
|
-
bananaFPC;
|
|
48
|
-
sponsoredFPC;
|
|
49
|
-
counterContract;
|
|
50
|
-
subscriptionContract;
|
|
51
|
-
feeJuiceBridgeTestHarness;
|
|
52
|
-
context;
|
|
53
|
-
chainMonitor;
|
|
54
|
-
getCoinbaseBalance;
|
|
55
|
-
getCoinbaseSequencerRewards;
|
|
56
|
-
getGasBalanceFn;
|
|
57
|
-
getBananaPublicBalanceFn;
|
|
58
|
-
getBananaPrivateBalanceFn;
|
|
59
|
-
getProverFee;
|
|
60
|
-
ALICE_INITIAL_BANANAS;
|
|
61
|
-
SUBSCRIPTION_AMOUNT;
|
|
62
|
-
APP_SPONSORED_TX_GAS_LIMIT;
|
|
63
|
-
constructor(testName, numberOfAccounts = 3, setupOptions = {}){
|
|
64
|
-
this.numberOfAccounts = numberOfAccounts;
|
|
65
|
-
this.accounts = [];
|
|
66
|
-
this.ALICE_INITIAL_BANANAS = BigInt(1e22);
|
|
67
|
-
this.SUBSCRIPTION_AMOUNT = BigInt(1e19);
|
|
68
|
-
this.APP_SPONSORED_TX_GAS_LIMIT = BigInt(10e9);
|
|
69
|
-
if (!numberOfAccounts) {
|
|
70
|
-
throw new Error('There must be at least 1 initial account.');
|
|
71
|
-
}
|
|
72
|
-
setupOptions.coinbase ??= EthAddress.random();
|
|
73
|
-
this.coinbase = setupOptions.coinbase;
|
|
74
|
-
this.logger = createLogger(`e2e:e2e_fees:${testName}`);
|
|
75
|
-
this.snapshotManager = createSnapshotManager(`e2e_fees/${testName}-${numberOfAccounts}`, dataPath, {
|
|
76
|
-
startProverNode: true,
|
|
77
|
-
...setupOptions
|
|
78
|
-
}, {
|
|
79
|
-
...setupOptions
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
async setup() {
|
|
83
|
-
const context = await this.snapshotManager.setup();
|
|
84
|
-
this.rollupContract = RollupContract.getFromConfig(context.aztecNodeConfig);
|
|
85
|
-
this.chainMonitor = new ChainMonitor(this.rollupContract, context.dateProvider, this.logger, 200).start();
|
|
86
|
-
return this;
|
|
87
|
-
}
|
|
88
|
-
async teardown() {
|
|
89
|
-
await this.chainMonitor.stop();
|
|
90
|
-
await this.snapshotManager.teardown();
|
|
91
|
-
}
|
|
92
|
-
setIsMarkingAsProven(b) {
|
|
93
|
-
this.context.watcher.setIsMarkingAsProven(b);
|
|
94
|
-
}
|
|
95
|
-
async catchUpProvenChain() {
|
|
96
|
-
const bn = await this.aztecNode.getBlockNumber();
|
|
97
|
-
while(await this.aztecNode.getProvenBlockNumber() < bn){
|
|
98
|
-
await sleep(1000);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
async getBlockRewards() {
|
|
102
|
-
const blockReward = await this.rollupContract.getBlockReward();
|
|
103
|
-
const rewardConfig = await this.rollupContract.getRewardConfig();
|
|
104
|
-
const balance = await this.feeJuiceBridgeTestHarness.getL1FeeJuiceBalance(EthAddress.fromString(rewardConfig.rewardDistributor));
|
|
105
|
-
const toDistribute = balance > blockReward ? blockReward : balance;
|
|
106
|
-
const sequencerBlockRewards = toDistribute * BigInt(rewardConfig.sequencerBps) / 10000n;
|
|
107
|
-
const proverBlockRewards = toDistribute - sequencerBlockRewards;
|
|
108
|
-
return {
|
|
109
|
-
sequencerBlockRewards,
|
|
110
|
-
proverBlockRewards
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
async mintAndBridgeFeeJuice(minter, recipient) {
|
|
114
|
-
const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(recipient);
|
|
115
|
-
const { claimSecret: secret, messageLeafIndex: index } = claim;
|
|
116
|
-
await this.feeJuiceContract.methods.claim(recipient, claim.claimAmount, secret, index).send({
|
|
117
|
-
from: minter
|
|
118
|
-
}).wait();
|
|
119
|
-
}
|
|
120
|
-
/** Alice mints bananaCoin tokens privately to the target address and redeems them. */ async mintPrivateBananas(amount, address) {
|
|
121
|
-
const balanceBefore = await this.bananaCoin.methods.balance_of_private(address).simulate({
|
|
122
|
-
from: this.aliceAddress
|
|
123
|
-
});
|
|
124
|
-
await mintTokensToPrivate(this.bananaCoin, this.aliceAddress, address, amount);
|
|
125
|
-
const balanceAfter = await this.bananaCoin.methods.balance_of_private(address).simulate({
|
|
126
|
-
from: this.aliceAddress
|
|
127
|
-
});
|
|
128
|
-
expect(balanceAfter).toEqual(balanceBefore + amount);
|
|
129
|
-
}
|
|
130
|
-
async applyBaseSnapshots() {
|
|
131
|
-
await this.applyInitialAccountsSnapshot();
|
|
132
|
-
await this.applyPublicDeployAccountsSnapshot();
|
|
133
|
-
await this.applySetupFeeJuiceSnapshot();
|
|
134
|
-
await this.applyDeployBananaTokenSnapshot();
|
|
135
|
-
}
|
|
136
|
-
async applyInitialAccountsSnapshot() {
|
|
137
|
-
await this.snapshotManager.snapshot('initial_accounts', deployAccounts(this.numberOfAccounts, this.logger), async ({ deployedAccounts }, { wallet, aztecNode, cheatCodes })=>{
|
|
138
|
-
this.wallet = wallet;
|
|
139
|
-
this.aztecNode = aztecNode;
|
|
140
|
-
this.gasSettings = GasSettings.default({
|
|
141
|
-
maxFeesPerGas: (await this.aztecNode.getCurrentBaseFees()).mul(2)
|
|
142
|
-
});
|
|
143
|
-
this.cheatCodes = cheatCodes;
|
|
144
|
-
this.accounts = deployedAccounts.map((a)=>a.address);
|
|
145
|
-
this.accounts.forEach((a, i)=>this.logger.verbose(`Account ${i} address: ${a}`));
|
|
146
|
-
[this.aliceAddress, this.bobAddress, this.sequencerAddress] = this.accounts.slice(0, 3);
|
|
147
|
-
// We set Alice as the FPC admin to avoid the need for deployment of another account.
|
|
148
|
-
this.fpcAdmin = this.aliceAddress;
|
|
149
|
-
const canonicalFeeJuice = await getCanonicalFeeJuice();
|
|
150
|
-
this.feeJuiceContract = await FeeJuiceContract.at(canonicalFeeJuice.address, this.wallet);
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
async applyPublicDeployAccountsSnapshot() {
|
|
154
|
-
await this.snapshotManager.snapshot('public_deploy_accounts', ()=>ensureAccountContractsPublished(this.wallet, this.accounts));
|
|
155
|
-
}
|
|
156
|
-
async applySetupFeeJuiceSnapshot() {
|
|
157
|
-
await this.snapshotManager.snapshot('setup_fee_juice', async ()=>{}, async (_data, context)=>{
|
|
158
|
-
this.context = context;
|
|
159
|
-
this.feeJuiceContract = await FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, this.wallet);
|
|
160
|
-
this.getGasBalanceFn = getBalancesFn('⛽', this.feeJuiceContract.methods.balance_of_public, this.aliceAddress, this.logger);
|
|
161
|
-
this.feeJuiceBridgeTestHarness = await FeeJuicePortalTestingHarnessFactory.create({
|
|
162
|
-
aztecNode: context.aztecNode,
|
|
163
|
-
aztecNodeAdmin: context.aztecNode,
|
|
164
|
-
l1Client: context.deployL1ContractsValues.l1Client,
|
|
165
|
-
wallet: this.wallet,
|
|
166
|
-
logger: this.logger
|
|
167
|
-
});
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
async applyDeployBananaTokenSnapshot() {
|
|
171
|
-
await this.snapshotManager.snapshot('deploy_banana_token', async ()=>{
|
|
172
|
-
const bananaCoin = await BananaCoin.deploy(this.wallet, this.aliceAddress, 'BC', 'BC', 18n).send({
|
|
173
|
-
from: this.aliceAddress
|
|
174
|
-
}).deployed();
|
|
175
|
-
this.logger.info(`BananaCoin deployed at ${bananaCoin.address}`);
|
|
176
|
-
return {
|
|
177
|
-
bananaCoinAddress: bananaCoin.address
|
|
178
|
-
};
|
|
179
|
-
}, async ({ bananaCoinAddress })=>{
|
|
180
|
-
this.bananaCoin = await BananaCoin.at(bananaCoinAddress, this.wallet);
|
|
181
|
-
const logger = this.logger;
|
|
182
|
-
this.getBananaPublicBalanceFn = getBalancesFn('🍌.public', this.bananaCoin.methods.balance_of_public, this.aliceAddress, logger);
|
|
183
|
-
this.getBananaPrivateBalanceFn = getBalancesFn('🍌.private', this.bananaCoin.methods.balance_of_private, this.aliceAddress, logger);
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
async applyFPCSetupSnapshot() {
|
|
187
|
-
await this.snapshotManager.snapshot('fpc_setup', async (context)=>{
|
|
188
|
-
const feeJuiceContract = this.feeJuiceBridgeTestHarness.feeJuice;
|
|
189
|
-
expect((await context.wallet.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
|
|
190
|
-
const bananaCoin = this.bananaCoin;
|
|
191
|
-
const bananaFPC = await FPCContract.deploy(this.wallet, bananaCoin.address, this.fpcAdmin).send({
|
|
192
|
-
from: this.aliceAddress
|
|
193
|
-
}).deployed();
|
|
194
|
-
this.logger.info(`BananaPay deployed at ${bananaFPC.address}`);
|
|
195
|
-
await this.feeJuiceBridgeTestHarness.bridgeFromL1ToL2(bananaFPC.address, this.aliceAddress);
|
|
196
|
-
return {
|
|
197
|
-
bananaFPCAddress: bananaFPC.address,
|
|
198
|
-
feeJuiceAddress: feeJuiceContract.address,
|
|
199
|
-
l1FeeJuiceAddress: this.feeJuiceBridgeTestHarness.l1FeeJuiceAddress,
|
|
200
|
-
rollupAddress: context.deployL1ContractsValues.l1ContractAddresses.rollupAddress
|
|
201
|
-
};
|
|
202
|
-
}, async (data, context)=>{
|
|
203
|
-
const bananaFPC = await FPCContract.at(data.bananaFPCAddress, this.wallet);
|
|
204
|
-
this.bananaFPC = bananaFPC;
|
|
205
|
-
this.getCoinbaseBalance = async ()=>{
|
|
206
|
-
const l1Client = createExtendedL1Client(context.aztecNodeConfig.l1RpcUrls, MNEMONIC);
|
|
207
|
-
const gasL1 = getContract({
|
|
208
|
-
address: data.l1FeeJuiceAddress.toString(),
|
|
209
|
-
abi: TestERC20Abi,
|
|
210
|
-
client: l1Client
|
|
211
|
-
});
|
|
212
|
-
return await gasL1.read.balanceOf([
|
|
213
|
-
this.coinbase.toString()
|
|
214
|
-
]);
|
|
215
|
-
};
|
|
216
|
-
this.getCoinbaseSequencerRewards = async ()=>{
|
|
217
|
-
return await this.rollupContract.getSequencerRewards(this.coinbase);
|
|
218
|
-
};
|
|
219
|
-
this.getProverFee = async (blockNumber)=>{
|
|
220
|
-
const block = await this.aztecNode.getBlock(blockNumber);
|
|
221
|
-
// @todo @lherskind As we deal with #13601
|
|
222
|
-
// Right now the value is from `FeeLib.sol`
|
|
223
|
-
const L1_GAS_PER_EPOCH_VERIFIED = 1000000n;
|
|
224
|
-
// We round up
|
|
225
|
-
const mulDiv = (a, b, c)=>a * b / c + (a * b % c > 0n ? 1n : 0n);
|
|
226
|
-
const { baseFee } = await this.rollupContract.getL1FeesAt(block.header.globalVariables.timestamp);
|
|
227
|
-
const proverCost = mulDiv(mulDiv(L1_GAS_PER_EPOCH_VERIFIED, baseFee, await this.rollupContract.getEpochDuration()), 1n, await this.rollupContract.getManaTarget()) + await this.rollupContract.getProvingCostPerMana();
|
|
228
|
-
const price = await this.rollupContract.getFeeAssetPerEth();
|
|
229
|
-
const mana = block.header.totalManaUsed.toBigInt();
|
|
230
|
-
return mulDiv(mana * proverCost, price, 10n ** 9n);
|
|
231
|
-
};
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
async applySponsoredFPCSetupSnapshot() {
|
|
235
|
-
await this.snapshotManager.snapshot('sponsored_fpc_setup', async (context)=>{
|
|
236
|
-
const feeJuiceContract = this.feeJuiceBridgeTestHarness.feeJuice;
|
|
237
|
-
expect((await context.wallet.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
|
|
238
|
-
const sponsoredFPC = await setupSponsoredFPC(this.wallet);
|
|
239
|
-
this.logger.info(`SponsoredFPC at ${sponsoredFPC.address}`);
|
|
240
|
-
return {
|
|
241
|
-
sponsoredFPCAddress: sponsoredFPC.address
|
|
242
|
-
};
|
|
243
|
-
}, async (data)=>{
|
|
244
|
-
this.sponsoredFPC = await SponsoredFPCContract.at(data.sponsoredFPCAddress, this.wallet);
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
async applyFundAliceWithBananas() {
|
|
248
|
-
await this.snapshotManager.snapshot('fund_alice', async ()=>{
|
|
249
|
-
await this.mintPrivateBananas(this.ALICE_INITIAL_BANANAS, this.aliceAddress);
|
|
250
|
-
await this.bananaCoin.methods.mint_to_public(this.aliceAddress, this.ALICE_INITIAL_BANANAS).send({
|
|
251
|
-
from: this.aliceAddress
|
|
252
|
-
}).wait();
|
|
253
|
-
}, ()=>Promise.resolve());
|
|
254
|
-
}
|
|
255
|
-
async applyFundAliceWithPrivateBananas() {
|
|
256
|
-
await this.snapshotManager.snapshot('fund_alice_with_private_bananas', async ()=>{
|
|
257
|
-
await this.mintPrivateBananas(this.ALICE_INITIAL_BANANAS, this.aliceAddress);
|
|
258
|
-
}, ()=>Promise.resolve());
|
|
259
|
-
}
|
|
260
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
-
import type { L2Block } from '@aztec/aztec.js/block';
|
|
3
|
-
import { Fr } from '@aztec/aztec.js/fields';
|
|
4
|
-
import { BatchedBlob, Blob } from '@aztec/blob-lib';
|
|
5
|
-
/**
|
|
6
|
-
* Creates a json object that can be used to test the solidity contract.
|
|
7
|
-
* The json object must be put into
|
|
8
|
-
*/
|
|
9
|
-
export declare function writeJson(fileName: string, block: L2Block, l1ToL2Content: Fr[], blobs: Blob[], batchedBlob: BatchedBlob, recipientAddress: AztecAddress, deployerAddress: `0x${string}`): Promise<void>;
|
|
10
|
-
//# sourceMappingURL=write_json.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"write_json.d.ts","sourceRoot":"","sources":["../../src/e2e_l1_publisher/write_json.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,IAAI,EAAiC,MAAM,iBAAiB,CAAC;AAOnF;;;GAGG;AACH,wBAAsB,SAAS,CAC7B,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,OAAO,EACd,aAAa,EAAE,EAAE,EAAE,EACnB,KAAK,EAAE,IAAI,EAAE,EACb,WAAW,EAAE,WAAW,EACxB,gBAAgB,EAAE,YAAY,EAC9B,eAAe,EAAE,KAAK,MAAM,EAAE,GAC7B,OAAO,CAAC,IAAI,CAAC,CAqDf"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { getPrefixedEthBlobCommitments } from '@aztec/blob-lib';
|
|
2
|
-
import { writeFile } from 'fs/promises';
|
|
3
|
-
const AZTEC_GENERATE_TEST_DATA = !!process.env.AZTEC_GENERATE_TEST_DATA;
|
|
4
|
-
/**
|
|
5
|
-
* Creates a json object that can be used to test the solidity contract.
|
|
6
|
-
* The json object must be put into
|
|
7
|
-
*/ export async function writeJson(fileName, block, l1ToL2Content, blobs, batchedBlob, recipientAddress, deployerAddress) {
|
|
8
|
-
if (!AZTEC_GENERATE_TEST_DATA) {
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
// Path relative to the package.json in the end-to-end folder
|
|
12
|
-
const path = `../../l1-contracts/test/fixtures/${fileName}.json`;
|
|
13
|
-
const asHex = (value, size = 64)=>{
|
|
14
|
-
const buffer = Buffer.isBuffer(value) ? value : value.toBuffer();
|
|
15
|
-
return `0x${buffer.toString('hex').padStart(size, '0')}`;
|
|
16
|
-
};
|
|
17
|
-
const jsonObject = {
|
|
18
|
-
populate: {
|
|
19
|
-
l1ToL2Content: l1ToL2Content.map((value)=>asHex(value)),
|
|
20
|
-
recipient: asHex(recipientAddress.toField()),
|
|
21
|
-
sender: deployerAddress
|
|
22
|
-
},
|
|
23
|
-
messages: {
|
|
24
|
-
l2ToL1Messages: block.body.txEffects.flatMap((txEffect)=>txEffect.l2ToL1Msgs).map((value)=>asHex(value))
|
|
25
|
-
},
|
|
26
|
-
block: {
|
|
27
|
-
// The json formatting in forge is a bit brittle, so we convert Fr to a number in the few values below.
|
|
28
|
-
// This should not be a problem for testing as long as the values are not larger than u32.
|
|
29
|
-
archive: asHex(block.archive.root),
|
|
30
|
-
blobCommitments: getPrefixedEthBlobCommitments(blobs),
|
|
31
|
-
batchedBlobInputs: batchedBlob.getEthBlobEvaluationInputs(),
|
|
32
|
-
blockNumber: block.number,
|
|
33
|
-
body: `0x${block.body.toBuffer().toString('hex')}`,
|
|
34
|
-
header: {
|
|
35
|
-
lastArchiveRoot: asHex(block.header.lastArchive.root),
|
|
36
|
-
contentCommitment: {
|
|
37
|
-
blobsHash: asHex(block.header.contentCommitment.blobsHash),
|
|
38
|
-
inHash: asHex(block.header.contentCommitment.inHash),
|
|
39
|
-
outHash: asHex(block.header.contentCommitment.outHash)
|
|
40
|
-
},
|
|
41
|
-
slotNumber: Number(block.header.globalVariables.slotNumber),
|
|
42
|
-
timestamp: Number(block.header.globalVariables.timestamp),
|
|
43
|
-
coinbase: asHex(block.header.globalVariables.coinbase, 40),
|
|
44
|
-
feeRecipient: asHex(block.header.globalVariables.feeRecipient),
|
|
45
|
-
gasFees: {
|
|
46
|
-
feePerDaGas: Number(block.header.globalVariables.gasFees.feePerDaGas),
|
|
47
|
-
feePerL2Gas: Number(block.header.globalVariables.gasFees.feePerL2Gas)
|
|
48
|
-
},
|
|
49
|
-
totalManaUsed: block.header.totalManaUsed.toNumber()
|
|
50
|
-
},
|
|
51
|
-
headerHash: asHex(block.getCheckpointHeader().hash()),
|
|
52
|
-
numTxs: block.body.txEffects.length
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
const output = JSON.stringify(jsonObject, null, 2);
|
|
56
|
-
await writeFile(path, output, 'utf8');
|
|
57
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
-
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
|
-
import type { EthPrivateKey } from '@aztec/node-keystore';
|
|
4
|
-
export declare function createJSONRPCSigner(keyLookup: Map<string, EthPrivateKey>, stats: Map<string, number>): import("http").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse>;
|
|
5
|
-
export declare function createKeyFile1(fileName: string, mnemonic: string, validatorIndex: number, publisher1Key: EthPrivateKey, publisher2Key: EthPrivateKey, coinbase: EthAddress, feeRecipient: AztecAddress): Promise<void>;
|
|
6
|
-
export declare function createKeyFile2(fileName: string, validatorKey: EthPrivateKey, publisherMnemonic: string, publisher1Index: number, coinbase: EthAddress, feeRecipient: AztecAddress): Promise<void>;
|
|
7
|
-
export declare function createKeyFile3(fileName: string, validatorAddress: EthAddress, publisher1Key: EthPrivateKey, publisher2Key: EthPrivateKey, coinbase: EthAddress, remoteSignerUrl: string, feeRecipient: AztecAddress): Promise<void>;
|
|
8
|
-
export declare function createKeyFile4(fileName: string, validator1Address: EthAddress, validator2Address: EthAddress, publisher1Index: number, publisher2Key: EthPrivateKey, mnemonic: string, publisher3Key: EthPrivateKey, coinbase1: EthAddress, coinbase2: EthAddress, remoteSignerUrl: string, feeRecipient1: AztecAddress, feeRecipient2: AztecAddress): Promise<void>;
|
|
9
|
-
export declare function createKeyFile5(fileName: string, proverAddress: EthAddress, remoteSignerUrl: string): Promise<void>;
|
|
10
|
-
export declare function createKeyFile6(fileName: string, mnemonic: string, validator1Index: number, coinbase: EthAddress, feeRecipient: AztecAddress): Promise<void>;
|
|
11
|
-
export declare function addressForPrivateKey(privateKey: EthPrivateKey): EthAddress;
|
|
12
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/e2e_multi_validator/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAW1D,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,sGA0EpG;AAGD,wBAAsB,cAAc,CAClC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,MAAM,EACtB,aAAa,EAAE,aAAa,EAC5B,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,UAAU,EACpB,YAAY,EAAE,YAAY,iBAmB3B;AAED,wBAAsB,cAAc,CAClC,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,aAAa,EAC3B,iBAAiB,EAAE,MAAM,EACzB,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,UAAU,EACpB,YAAY,EAAE,YAAY,iBAmB3B;AAED,wBAAsB,cAAc,CAClC,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,UAAU,EAC5B,aAAa,EAAE,aAAa,EAC5B,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,UAAU,EACpB,eAAe,EAAE,MAAM,EACvB,YAAY,EAAE,YAAY,iBAiB3B;AAED,wBAAsB,cAAc,CAClC,QAAQ,EAAE,MAAM,EAChB,iBAAiB,EAAE,UAAU,EAC7B,iBAAiB,EAAE,UAAU,EAC7B,eAAe,EAAE,MAAM,EACvB,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,UAAU,EACrB,SAAS,EAAE,UAAU,EACrB,eAAe,EAAE,MAAM,EACvB,aAAa,EAAE,YAAY,EAC3B,aAAa,EAAE,YAAY,iBA4B5B;AAED,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,iBAcxG;AAED,wBAAsB,cAAc,CAClC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,UAAU,EACpB,YAAY,EAAE,YAAY,iBAkB3B;AAED,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,aAAa,GAAG,UAAU,CAE1E"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
-
import { type Logger } from '@aztec/aztec.js/log';
|
|
3
|
-
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
4
|
-
import type { Wallet } from '@aztec/aztec.js/wallet';
|
|
5
|
-
import { ChildContract } from '@aztec/noir-test-contracts.js/Child';
|
|
6
|
-
import { ParentContract } from '@aztec/noir-test-contracts.js/Parent';
|
|
7
|
-
import { type SubsystemsContext } from '../fixtures/snapshot_manager.js';
|
|
8
|
-
export declare class NestedContractTest {
|
|
9
|
-
private numberOfAccounts;
|
|
10
|
-
private snapshotManager;
|
|
11
|
-
logger: Logger;
|
|
12
|
-
wallet: Wallet;
|
|
13
|
-
defaultAccountAddress: AztecAddress;
|
|
14
|
-
aztecNode: AztecNode;
|
|
15
|
-
parentContract: ParentContract;
|
|
16
|
-
childContract: ChildContract;
|
|
17
|
-
constructor(testName: string, numberOfAccounts?: number);
|
|
18
|
-
/**
|
|
19
|
-
* Adds two state shifts to snapshot manager.
|
|
20
|
-
* 1. Add 3 accounts.
|
|
21
|
-
* 2. Publicly deploy accounts
|
|
22
|
-
*/
|
|
23
|
-
applyBaseSnapshots(): Promise<void>;
|
|
24
|
-
setup(): Promise<void>;
|
|
25
|
-
teardown(): Promise<void>;
|
|
26
|
-
snapshot: <T>(name: string, apply: (context: SubsystemsContext) => Promise<T>, restore?: (snapshotData: T, context: SubsystemsContext) => Promise<void>) => Promise<void>;
|
|
27
|
-
applyManualSnapshots(): Promise<void>;
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=nested_contract_test.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nested_contract_test.d.ts","sourceRoot":"","sources":["../../src/e2e_nested_contract/nested_contract_test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,qBAAqB,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAEtE,OAAO,EAEL,KAAK,iBAAiB,EAIvB,MAAM,iCAAiC,CAAC;AAIzC,qBAAa,kBAAkB;IAY3B,OAAO,CAAC,gBAAgB;IAX1B,OAAO,CAAC,eAAe,CAAmB;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAG,MAAM,CAAC;IAChB,qBAAqB,EAAG,YAAY,CAAC;IACrC,SAAS,EAAG,SAAS,CAAC;IAEtB,cAAc,EAAG,cAAc,CAAC;IAChC,aAAa,EAAG,aAAa,CAAC;gBAG5B,QAAQ,EAAE,MAAM,EACR,gBAAgB,SAAI;IAM9B;;;;OAIG;IACG,kBAAkB;IAsBlB,KAAK;IAIL,QAAQ;IAId,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,oBAAoB;CAkB3B"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { createLogger } from '@aztec/aztec.js/log';
|
|
2
|
-
import { ChildContract } from '@aztec/noir-test-contracts.js/Child';
|
|
3
|
-
import { ParentContract } from '@aztec/noir-test-contracts.js/Parent';
|
|
4
|
-
import { createSnapshotManager, deployAccounts, publicDeployAccounts } from '../fixtures/snapshot_manager.js';
|
|
5
|
-
const { E2E_DATA_PATH: dataPath } = process.env;
|
|
6
|
-
export class NestedContractTest {
|
|
7
|
-
numberOfAccounts;
|
|
8
|
-
snapshotManager;
|
|
9
|
-
logger;
|
|
10
|
-
wallet;
|
|
11
|
-
defaultAccountAddress;
|
|
12
|
-
aztecNode;
|
|
13
|
-
parentContract;
|
|
14
|
-
childContract;
|
|
15
|
-
constructor(testName, numberOfAccounts = 1){
|
|
16
|
-
this.numberOfAccounts = numberOfAccounts;
|
|
17
|
-
this.snapshot = (name, apply, restore = ()=>Promise.resolve())=>this.snapshotManager.snapshot(name, apply, restore);
|
|
18
|
-
this.logger = createLogger(`e2e:e2e_nested_contract:${testName}`);
|
|
19
|
-
this.snapshotManager = createSnapshotManager(`e2e_nested_contract/${testName}-${numberOfAccounts}`, dataPath);
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Adds two state shifts to snapshot manager.
|
|
23
|
-
* 1. Add 3 accounts.
|
|
24
|
-
* 2. Publicly deploy accounts
|
|
25
|
-
*/ async applyBaseSnapshots() {
|
|
26
|
-
await this.snapshotManager.snapshot('accounts', deployAccounts(this.numberOfAccounts, this.logger), ({ deployedAccounts }, { wallet, aztecNode })=>{
|
|
27
|
-
this.wallet = wallet;
|
|
28
|
-
[{ address: this.defaultAccountAddress }] = deployedAccounts;
|
|
29
|
-
this.aztecNode = aztecNode;
|
|
30
|
-
return Promise.resolve();
|
|
31
|
-
});
|
|
32
|
-
await this.snapshotManager.snapshot('public_deploy', async ()=>{}, async ()=>{
|
|
33
|
-
this.logger.verbose(`Public deploy accounts...`);
|
|
34
|
-
await publicDeployAccounts(this.wallet, [
|
|
35
|
-
this.defaultAccountAddress
|
|
36
|
-
]);
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
async setup() {
|
|
40
|
-
await this.snapshotManager.setup();
|
|
41
|
-
}
|
|
42
|
-
async teardown() {
|
|
43
|
-
await this.snapshotManager.teardown();
|
|
44
|
-
}
|
|
45
|
-
snapshot;
|
|
46
|
-
async applyManualSnapshots() {
|
|
47
|
-
await this.snapshotManager.snapshot('manual', async ()=>{
|
|
48
|
-
const parentContract = await ParentContract.deploy(this.wallet).send({
|
|
49
|
-
from: this.defaultAccountAddress
|
|
50
|
-
}).deployed();
|
|
51
|
-
const childContract = await ChildContract.deploy(this.wallet).send({
|
|
52
|
-
from: this.defaultAccountAddress
|
|
53
|
-
}).deployed();
|
|
54
|
-
return {
|
|
55
|
-
parentContractAddress: parentContract.address,
|
|
56
|
-
childContractAddress: childContract.address
|
|
57
|
-
};
|
|
58
|
-
}, async ({ parentContractAddress, childContractAddress })=>{
|
|
59
|
-
this.parentContract = await ParentContract.at(parentContractAddress, this.wallet);
|
|
60
|
-
this.childContract = await ChildContract.at(childContractAddress, this.wallet);
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { AztecNodeService } from '@aztec/aztec-node';
|
|
2
|
-
import { EthAddress } from '@aztec/aztec.js/addresses';
|
|
3
|
-
import { RollupContract } from '@aztec/ethereum';
|
|
4
|
-
import 'jest-extended';
|
|
5
|
-
import { P2PNetworkTest } from './p2p_network.js';
|
|
6
|
-
export declare class P2PInactivityTest {
|
|
7
|
-
readonly test: P2PNetworkTest;
|
|
8
|
-
nodes: AztecNodeService[];
|
|
9
|
-
activeNodes: AztecNodeService[];
|
|
10
|
-
inactiveNodes: AztecNodeService[];
|
|
11
|
-
rollup: RollupContract;
|
|
12
|
-
offlineValidators: EthAddress[];
|
|
13
|
-
private dataDir;
|
|
14
|
-
private inactiveNodeCount;
|
|
15
|
-
private keepInitialNode;
|
|
16
|
-
constructor(test: P2PNetworkTest, opts: {
|
|
17
|
-
inactiveNodeCount: number;
|
|
18
|
-
keepInitialNode?: boolean;
|
|
19
|
-
});
|
|
20
|
-
static create(testName: string, opts: {
|
|
21
|
-
slashInactivityConsecutiveEpochThreshold: number;
|
|
22
|
-
inactiveNodeCount: number;
|
|
23
|
-
keepInitialNode?: boolean;
|
|
24
|
-
}): Promise<P2PInactivityTest>;
|
|
25
|
-
setup(): Promise<this>;
|
|
26
|
-
teardown(): Promise<void>;
|
|
27
|
-
get ctx(): import("../fixtures/snapshot_manager.js").SubsystemsContext;
|
|
28
|
-
get logger(): import("@aztec/foundation/log").Logger;
|
|
29
|
-
get slashingAmount(): bigint;
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=inactivity_slash_test.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inactivity_slash_test.d.ts","sourceRoot":"","sources":["../../src/e2e_p2p/inactivity_slash_test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGjD,OAAO,eAAe,CAAC;AAKvB,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAiBlD,qBAAa,iBAAiB;aAaV,IAAI,EAAE,cAAc;IAZ/B,KAAK,EAAG,gBAAgB,EAAE,CAAC;IAC3B,WAAW,EAAG,gBAAgB,EAAE,CAAC;IACjC,aAAa,EAAG,gBAAgB,EAAE,CAAC;IAEnC,MAAM,EAAG,cAAc,CAAC;IACxB,iBAAiB,EAAG,UAAU,EAAE,CAAC;IAExC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,iBAAiB,CAAS;IAClC,OAAO,CAAC,eAAe,CAAU;gBAGf,IAAI,EAAE,cAAc,EACpC,IAAI,EAAE;QAAE,iBAAiB,EAAE,MAAM,CAAC;QAAC,eAAe,CAAC,EAAE,OAAO,CAAA;KAAE;WAOnD,MAAM,CACjB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE;QAAE,wCAAwC,EAAE,MAAM,CAAC;QAAC,iBAAiB,EAAE,MAAM,CAAC;QAAC,eAAe,CAAC,EAAE,OAAO,CAAA;KAAE;IAgCrG,KAAK;IA4EL,QAAQ;IAQrB,IAAW,GAAG,gEAEb;IAED,IAAW,MAAM,2CAEhB;IAED,IAAW,cAAc,WAExB;CACF"}
|