@aztec/end-to-end 0.0.0-test.1 → 0.0.1-commit.017a351
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 +27 -0
- package/dest/bench/client_flows/benchmark.d.ts +76 -0
- package/dest/bench/client_flows/benchmark.d.ts.map +1 -0
- package/dest/bench/client_flows/benchmark.js +298 -0
- package/dest/bench/client_flows/client_flows_benchmark.d.ts +79 -0
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -0
- package/dest/bench/client_flows/client_flows_benchmark.js +318 -0
- package/dest/bench/client_flows/config.d.ts +14 -0
- package/dest/bench/client_flows/config.d.ts.map +1 -0
- package/dest/bench/client_flows/config.js +124 -0
- package/dest/bench/client_flows/data_extractor.d.ts +2 -0
- package/dest/bench/client_flows/data_extractor.d.ts.map +1 -0
- package/dest/bench/client_flows/data_extractor.js +79 -0
- package/dest/bench/utils.d.ts +16 -41
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +46 -72
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +30 -20
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +1 -1
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +137 -106
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +44 -33
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +1 -1
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +136 -103
- package/dest/e2e_deploy_contract/deploy_test.d.ts +20 -11
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
- package/dest/e2e_deploy_contract/deploy_test.js +28 -28
- package/dest/e2e_epochs/epochs_test.d.ts +98 -24
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +366 -61
- package/dest/e2e_fees/bridging_race.notest.d.ts +2 -0
- package/dest/e2e_fees/bridging_race.notest.d.ts.map +1 -0
- package/dest/e2e_fees/bridging_race.notest.js +61 -0
- package/dest/e2e_fees/fees_test.d.ts +42 -24
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +194 -182
- package/dest/e2e_l1_publisher/write_json.d.ts +11 -0
- package/dest/e2e_l1_publisher/write_json.d.ts.map +1 -0
- package/dest/e2e_l1_publisher/write_json.js +56 -0
- package/dest/e2e_multi_validator/utils.d.ts +12 -0
- package/dest/e2e_multi_validator/utils.d.ts.map +1 -0
- package/dest/e2e_multi_validator/utils.js +214 -0
- package/dest/e2e_nested_contract/nested_contract_test.d.ts +16 -16
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +38 -43
- package/dest/e2e_p2p/inactivity_slash_test.d.ts +31 -0
- package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -0
- package/dest/e2e_p2p/inactivity_slash_test.js +137 -0
- package/dest/e2e_p2p/p2p_network.d.ts +287 -31
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +281 -183
- package/dest/e2e_p2p/reqresp/utils.d.ts +22 -0
- package/dest/e2e_p2p/reqresp/utils.d.ts.map +1 -0
- package/dest/e2e_p2p/reqresp/utils.js +206 -0
- package/dest/e2e_p2p/shared.d.ts +73 -8
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +205 -27
- package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts +2 -0
- package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts.map +1 -0
- package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.js +184 -0
- package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.d.ts +18 -0
- package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.d.ts.map +1 -0
- package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.js +120 -0
- package/dest/e2e_token_contract/token_contract_test.d.ts +30 -15
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/e2e_token_contract/token_contract_test.js +110 -76
- 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 +56 -0
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -0
- package/dest/fixtures/e2e_prover_test.js +267 -0
- 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 +79 -8
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/fixtures.js +76 -5
- package/dest/fixtures/get_acvm_config.d.ts +2 -2
- package/dest/fixtures/get_acvm_config.d.ts.map +1 -1
- package/dest/fixtures/get_acvm_config.js +3 -15
- package/dest/fixtures/get_bb_config.d.ts +2 -2
- package/dest/fixtures/get_bb_config.d.ts.map +1 -1
- package/dest/fixtures/get_bb_config.js +10 -17
- 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 +116 -0
- package/dest/fixtures/index.d.ts +2 -1
- package/dest/fixtures/index.d.ts.map +1 -1
- package/dest/fixtures/index.js +1 -0
- package/dest/fixtures/l1_to_l2_messaging.d.ts +11 -7
- package/dest/fixtures/l1_to_l2_messaging.d.ts.map +1 -1
- package/dest/fixtures/l1_to_l2_messaging.js +45 -19
- 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 +272 -0
- package/dest/fixtures/setup.d.ts.map +1 -0
- package/dest/fixtures/setup.js +735 -0
- package/dest/fixtures/setup_p2p_test.d.ts +28 -16
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +103 -32
- package/dest/fixtures/token_utils.d.ts +10 -4
- package/dest/fixtures/token_utils.d.ts.map +1 -1
- package/dest/fixtures/token_utils.js +30 -13
- package/dest/fixtures/utils.d.ts +5 -153
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +4 -552
- package/dest/fixtures/web3signer.d.ts +5 -0
- package/dest/fixtures/web3signer.d.ts.map +1 -0
- package/dest/fixtures/web3signer.js +53 -0
- 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/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 +46 -27
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +113 -55
- package/dest/shared/gas_portal_test_harness.d.ts +39 -28
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.js +64 -34
- 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 +42 -2
- 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 +6 -4
- package/dest/shared/submit-transactions.d.ts.map +1 -1
- package/dest/shared/submit-transactions.js +15 -16
- package/dest/shared/uniswap_l1_l2.d.ts +3 -25
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +202 -135
- 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 +16 -9
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.js +38 -27
- package/dest/simulators/token_simulator.d.ts +6 -3
- package/dest/simulators/token_simulator.d.ts.map +1 -1
- package/dest/simulators/token_simulator.js +12 -30
- package/dest/spartan/setup_test_wallets.d.ts +36 -11
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +301 -63
- package/dest/spartan/tx_metrics.d.ts +102 -0
- package/dest/spartan/tx_metrics.d.ts.map +1 -0
- package/dest/spartan/tx_metrics.js +475 -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 -415
- package/dest/spartan/utils.d.ts.map +1 -1
- package/dest/spartan/utils.js +1 -445
- package/dest/test-wallet/test_wallet.d.ts +85 -0
- package/dest/test-wallet/test_wallet.d.ts.map +1 -0
- package/dest/test-wallet/test_wallet.js +273 -0
- package/dest/test-wallet/utils.d.ts +41 -0
- package/dest/test-wallet/utils.d.ts.map +1 -0
- package/dest/test-wallet/utils.js +66 -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 +53 -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 +160 -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 +79 -64
- package/src/bench/client_flows/benchmark.ts +382 -0
- package/src/bench/client_flows/client_flows_benchmark.ts +399 -0
- package/src/bench/client_flows/config.ts +69 -0
- package/src/bench/client_flows/data_extractor.ts +89 -0
- package/src/bench/utils.ts +49 -87
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +164 -172
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +194 -183
- package/src/e2e_deploy_contract/deploy_test.ts +42 -49
- package/src/e2e_epochs/epochs_test.ts +451 -93
- package/src/e2e_fees/bridging_race.notest.ts +74 -0
- package/src/e2e_fees/fees_test.ts +249 -262
- package/src/e2e_l1_publisher/write_json.ts +77 -0
- package/src/e2e_multi_validator/utils.ts +258 -0
- package/src/e2e_nested_contract/nested_contract_test.ts +51 -60
- package/src/e2e_p2p/inactivity_slash_test.ts +180 -0
- package/src/e2e_p2p/p2p_network.ts +391 -240
- package/src/e2e_p2p/reqresp/utils.ts +274 -0
- package/src/e2e_p2p/shared.ts +304 -39
- package/src/e2e_storage_proof/fixtures/storage_proof.json +915 -0
- package/src/e2e_storage_proof/fixtures/storage_proof_fetcher.ts +190 -0
- package/src/e2e_storage_proof/fixtures/storage_proof_fixture.ts +173 -0
- package/src/e2e_token_contract/token_contract_test.ts +140 -124
- 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 +329 -0
- package/src/fixtures/elu_monitor.ts +126 -0
- package/src/fixtures/fixtures.ts +98 -7
- package/src/fixtures/get_acvm_config.ts +4 -12
- package/src/fixtures/get_bb_config.ts +19 -13
- package/src/fixtures/ha_setup.ts +188 -0
- package/src/fixtures/index.ts +1 -0
- package/src/fixtures/l1_to_l2_messaging.ts +56 -24
- package/src/fixtures/schnorr_hardcoded_account_contract.ts +49 -0
- package/src/fixtures/setup.ts +1056 -0
- package/src/fixtures/setup_p2p_test.ts +142 -54
- package/src/fixtures/token_utils.ts +34 -16
- package/src/fixtures/utils.ts +29 -820
- package/src/fixtures/web3signer.ts +63 -0
- 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 +104 -0
- package/src/guides/up_quick_start.sh +9 -19
- package/src/install_legacy_contracts.cjs +75 -0
- package/src/legacy-jest-resolver.cjs +112 -0
- package/src/quality_of_service/{alert_checker.ts → grafana_client.ts} +2 -2
- package/src/quality_of_service/prometheus_client.ts +113 -0
- package/src/shared/cross_chain_test_harness.ts +116 -90
- package/src/shared/gas_portal_test_harness.ts +75 -56
- package/src/shared/index.ts +2 -1
- package/src/shared/jest_setup.ts +52 -2
- package/src/shared/mock_state_view.ts +188 -0
- package/src/shared/submit-transactions.ts +19 -20
- package/src/shared/uniswap_l1_l2.ts +259 -234
- package/src/shared/wait_for_l1_to_l2_message.ts +23 -0
- package/src/simulators/lending_simulator.ts +43 -26
- package/src/simulators/token_simulator.ts +18 -34
- package/src/spartan/DEVELOP.md +128 -0
- package/src/spartan/setup_test_wallets.ts +420 -96
- package/src/spartan/tx_metrics.ts +434 -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 -582
- package/src/test-wallet/test_wallet.ts +376 -0
- package/src/test-wallet/utils.ts +108 -0
- package/src/test-wallet/wallet_worker_script.ts +63 -0
- package/src/test-wallet/worker_wallet.ts +218 -0
- package/src/test-wallet/worker_wallet_schema.ts +13 -0
- package/dest/e2e_prover/e2e_prover_test.d.ts +0 -56
- package/dest/e2e_prover/e2e_prover_test.d.ts.map +0 -1
- package/dest/e2e_prover/e2e_prover_test.js +0 -291
- 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 -87
- package/dest/fixtures/snapshot_manager.d.ts.map +0 -1
- package/dest/fixtures/snapshot_manager.js +0 -479
- package/dest/quality_of_service/alert_checker.d.ts +0 -41
- package/dest/quality_of_service/alert_checker.d.ts.map +0 -1
- package/dest/sample-dapp/connect.js +0 -12
- package/dest/sample-dapp/contracts.js +0 -10
- package/dest/sample-dapp/deploy.js +0 -35
- package/dest/sample-dapp/index.js +0 -98
- package/src/e2e_prover/e2e_prover_test.ts +0 -418
- package/src/fixtures/setup_l1_contracts.ts +0 -27
- package/src/fixtures/snapshot_manager.ts +0 -617
- package/src/sample-dapp/connect.mjs +0 -16
- package/src/sample-dapp/contracts.mjs +0 -14
- package/src/sample-dapp/deploy.mjs +0 -40
- package/src/sample-dapp/index.mjs +0 -128
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
1
|
+
import { EthAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
+
import { L1TokenPortalManager } from '@aztec/aztec.js/ethereum';
|
|
3
|
+
import { Fr } from '@aztec/aztec.js/fields';
|
|
4
|
+
import { OutboxContract } from '@aztec/ethereum/contracts';
|
|
5
|
+
import { deployL1Contract } from '@aztec/ethereum/deploy-l1-contract';
|
|
3
6
|
import { TestERC20Abi, TokenPortalAbi, TokenPortalBytecode } from '@aztec/l1-artifacts';
|
|
4
7
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
5
8
|
import { TokenBridgeContract } from '@aztec/noir-contracts.js/TokenBridge';
|
|
6
9
|
import { getContract } from 'viem';
|
|
7
10
|
import { mintTokensToPrivate } from '../fixtures/token_utils.js';
|
|
8
|
-
|
|
11
|
+
import { waitForL1ToL2MessageSeen } from './wait_for_l1_to_l2_message.js';
|
|
9
12
|
/**
|
|
10
13
|
* Deploy L1 token and portal, initialize portal, deploy a non native l2 token contract, its L2 bridge contract and attach is to the portal.
|
|
11
14
|
* @param wallet - the wallet instance
|
|
@@ -15,27 +18,39 @@ import { mintTokensToPrivate } from '../fixtures/token_utils.js';
|
|
|
15
18
|
* @param owner - owner of the L2 contract
|
|
16
19
|
* @param underlyingERC20Address - address of the underlying ERC20 contract to use (if none supplied, it deploys one)
|
|
17
20
|
* @returns l2 contract instance, bridge contract instance, token portal instance, token portal address and the underlying ERC20 instance
|
|
18
|
-
*/ export async function deployAndInitializeTokenAndBridgeContracts(wallet,
|
|
21
|
+
*/ export async function deployAndInitializeTokenAndBridgeContracts(wallet, l1Client, rollupRegistryAddress, owner, underlyingERC20Address) {
|
|
19
22
|
// deploy the token portal
|
|
20
|
-
const { address: tokenPortalAddress } = await deployL1Contract(
|
|
23
|
+
const { address: tokenPortalAddress } = await deployL1Contract(l1Client, TokenPortalAbi, TokenPortalBytecode);
|
|
21
24
|
const tokenPortal = getContract({
|
|
22
25
|
address: tokenPortalAddress.toString(),
|
|
23
26
|
abi: TokenPortalAbi,
|
|
24
|
-
client:
|
|
27
|
+
client: l1Client
|
|
25
28
|
});
|
|
26
29
|
// deploy l2 token
|
|
27
|
-
const token = await TokenContract.deploy(wallet, owner, 'TokenName', 'TokenSymbol', 18).send(
|
|
30
|
+
const { contract: token } = await TokenContract.deploy(wallet, owner, 'TokenName', 'TokenSymbol', 18).send({
|
|
31
|
+
from: owner
|
|
32
|
+
});
|
|
28
33
|
// deploy l2 token bridge and attach to the portal
|
|
29
|
-
const bridge = await TokenBridgeContract.deploy(wallet, token.address, tokenPortalAddress).send(
|
|
30
|
-
|
|
34
|
+
const { contract: bridge } = await TokenBridgeContract.deploy(wallet, token.address, tokenPortalAddress).send({
|
|
35
|
+
from: owner
|
|
36
|
+
});
|
|
37
|
+
if ((await token.methods.get_admin().simulate({
|
|
38
|
+
from: owner
|
|
39
|
+
})).result !== owner.toBigInt()) {
|
|
31
40
|
throw new Error(`Token admin is not ${owner}`);
|
|
32
41
|
}
|
|
33
|
-
if (!(await bridge.methods.get_config().simulate(
|
|
42
|
+
if (!(await bridge.methods.get_config().simulate({
|
|
43
|
+
from: owner
|
|
44
|
+
})).result.token.equals(token.address)) {
|
|
34
45
|
throw new Error(`Bridge token is not ${token.address}`);
|
|
35
46
|
}
|
|
36
47
|
// make the bridge a minter on the token:
|
|
37
|
-
await token.methods.set_minter(bridge.address, true).send(
|
|
38
|
-
|
|
48
|
+
await token.methods.set_minter(bridge.address, true).send({
|
|
49
|
+
from: owner
|
|
50
|
+
});
|
|
51
|
+
if ((await token.methods.is_minter(bridge.address).simulate({
|
|
52
|
+
from: owner
|
|
53
|
+
})).result === 1n) {
|
|
39
54
|
throw new Error(`Bridge is not a minter`);
|
|
40
55
|
}
|
|
41
56
|
// initialize portal
|
|
@@ -47,7 +62,7 @@ import { mintTokensToPrivate } from '../fixtures/token_utils.js';
|
|
|
47
62
|
const underlyingERC20 = getContract({
|
|
48
63
|
address: underlyingERC20Address.toString(),
|
|
49
64
|
abi: TestERC20Abi,
|
|
50
|
-
client:
|
|
65
|
+
client: l1Client
|
|
51
66
|
});
|
|
52
67
|
return {
|
|
53
68
|
token,
|
|
@@ -57,55 +72,64 @@ import { mintTokensToPrivate } from '../fixtures/token_utils.js';
|
|
|
57
72
|
underlyingERC20
|
|
58
73
|
};
|
|
59
74
|
}
|
|
60
|
-
// docs:end:deployAndInitializeTokenAndBridgeContracts
|
|
61
75
|
/**
|
|
62
76
|
* A Class for testing cross chain interactions, contains common interactions
|
|
63
77
|
* shared between cross chain tests.
|
|
64
78
|
*/ export class CrossChainTestHarness {
|
|
65
79
|
aztecNode;
|
|
66
|
-
pxeService;
|
|
67
80
|
logger;
|
|
68
81
|
l2Token;
|
|
69
82
|
l2Bridge;
|
|
70
83
|
ethAccount;
|
|
71
84
|
tokenPortalAddress;
|
|
72
85
|
underlyingERC20Address;
|
|
73
|
-
|
|
74
|
-
walletClient;
|
|
86
|
+
l1Client;
|
|
75
87
|
l1ContractAddresses;
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
const
|
|
88
|
+
wallet;
|
|
89
|
+
ownerAddress;
|
|
90
|
+
static async new(aztecNode, l1Client, wallet, ownerAddress, logger, underlyingERC20Address) {
|
|
91
|
+
const ethAccount = EthAddress.fromString((await l1Client.getAddresses())[0]);
|
|
92
|
+
const l1ContractAddresses = (await aztecNode.getNodeInfo()).l1ContractAddresses;
|
|
80
93
|
// Deploy and initialize all required contracts
|
|
81
94
|
logger.info('Deploying and initializing token, portal and its bridge...');
|
|
82
|
-
const { token, bridge, tokenPortalAddress, underlyingERC20 } = await deployAndInitializeTokenAndBridgeContracts(wallet,
|
|
95
|
+
const { token, bridge, tokenPortalAddress, underlyingERC20 } = await deployAndInitializeTokenAndBridgeContracts(wallet, l1Client, l1ContractAddresses.registryAddress, ownerAddress, underlyingERC20Address);
|
|
83
96
|
logger.info('Deployed and initialized token, portal and its bridge.');
|
|
84
|
-
return new CrossChainTestHarness(aztecNode,
|
|
97
|
+
return new CrossChainTestHarness(aztecNode, logger, token, bridge, ethAccount, tokenPortalAddress, underlyingERC20.address, l1Client, l1ContractAddresses, wallet, ownerAddress);
|
|
85
98
|
}
|
|
86
99
|
l1TokenManager;
|
|
87
100
|
l1TokenPortalManager;
|
|
88
|
-
|
|
89
|
-
constructor(/** Aztec node instance. */ aztecNode, /**
|
|
101
|
+
outboxContract;
|
|
102
|
+
constructor(/** Aztec node instance. */ aztecNode, /** Logger. */ logger, /** L2 Token contract. */ l2Token, /** L2 Token bridge contract. */ l2Bridge, /** Eth account to interact with. */ ethAccount, /** Portal address. */ tokenPortalAddress, /** Underlying token for portal tests. */ underlyingERC20Address, /** Viem Extended client instance. */ l1Client, /** Deployment addresses for all L1 contracts */ l1ContractAddresses, /** Wallet to simulate and send txs from. */ wallet, /** Owner of the l2 token and bridge */ ownerAddress){
|
|
90
103
|
this.aztecNode = aztecNode;
|
|
91
|
-
this.pxeService = pxeService;
|
|
92
104
|
this.logger = logger;
|
|
93
105
|
this.l2Token = l2Token;
|
|
94
106
|
this.l2Bridge = l2Bridge;
|
|
95
107
|
this.ethAccount = ethAccount;
|
|
96
108
|
this.tokenPortalAddress = tokenPortalAddress;
|
|
97
109
|
this.underlyingERC20Address = underlyingERC20Address;
|
|
98
|
-
this.
|
|
99
|
-
this.walletClient = walletClient;
|
|
110
|
+
this.l1Client = l1Client;
|
|
100
111
|
this.l1ContractAddresses = l1ContractAddresses;
|
|
101
|
-
this.
|
|
102
|
-
this.
|
|
112
|
+
this.wallet = wallet;
|
|
113
|
+
this.ownerAddress = ownerAddress;
|
|
114
|
+
this.l1TokenPortalManager = new L1TokenPortalManager(this.tokenPortalAddress, this.underlyingERC20Address, this.l1ContractAddresses.feeAssetHandlerAddress, this.l1ContractAddresses.outboxAddress, this.l1Client, this.logger);
|
|
103
115
|
this.l1TokenManager = this.l1TokenPortalManager.getTokenManager();
|
|
104
|
-
this.
|
|
116
|
+
this.outboxContract = new OutboxContract(this.l1Client, this.l1ContractAddresses.outboxAddress);
|
|
105
117
|
}
|
|
106
118
|
async mintTokensOnL1(amount) {
|
|
107
|
-
|
|
108
|
-
|
|
119
|
+
const contract = getContract({
|
|
120
|
+
abi: TestERC20Abi,
|
|
121
|
+
address: this.l1TokenManager.tokenAddress.toString(),
|
|
122
|
+
client: this.l1Client
|
|
123
|
+
});
|
|
124
|
+
const balanceBefore = await this.l1TokenManager.getL1TokenBalance(this.ethAccount.toString());
|
|
125
|
+
const hash = await contract.write.mint([
|
|
126
|
+
this.ethAccount.toString(),
|
|
127
|
+
amount
|
|
128
|
+
]);
|
|
129
|
+
await this.l1Client.waitForTransactionReceipt({
|
|
130
|
+
hash
|
|
131
|
+
});
|
|
132
|
+
expect(await this.l1TokenManager.getL1TokenBalance(this.ethAccount.toString())).toEqual(balanceBefore + amount);
|
|
109
133
|
}
|
|
110
134
|
getL1BalanceOf(address) {
|
|
111
135
|
return this.l1TokenManager.getL1TokenBalance(address.toString());
|
|
@@ -118,37 +142,52 @@ import { mintTokensToPrivate } from '../fixtures/token_utils.js';
|
|
|
118
142
|
}
|
|
119
143
|
async mintTokensPublicOnL2(amount) {
|
|
120
144
|
this.logger.info('Minting tokens on L2 publicly');
|
|
121
|
-
await this.l2Token.methods.mint_to_public(this.ownerAddress, amount).send(
|
|
145
|
+
await this.l2Token.methods.mint_to_public(this.ownerAddress, amount).send({
|
|
146
|
+
from: this.ownerAddress
|
|
147
|
+
});
|
|
122
148
|
}
|
|
123
149
|
async mintTokensPrivateOnL2(amount) {
|
|
124
|
-
await mintTokensToPrivate(this.l2Token, this.
|
|
150
|
+
await mintTokensToPrivate(this.l2Token, this.ownerAddress, this.ownerAddress, amount);
|
|
125
151
|
}
|
|
126
152
|
async sendL2PublicTransfer(transferAmount, receiverAddress) {
|
|
127
153
|
// send a transfer tx to force through rollup with the message included
|
|
128
|
-
await this.l2Token.methods.transfer_in_public(this.ownerAddress, receiverAddress, transferAmount, 0).send(
|
|
154
|
+
await this.l2Token.methods.transfer_in_public(this.ownerAddress, receiverAddress, transferAmount, 0).send({
|
|
155
|
+
from: this.ownerAddress
|
|
156
|
+
});
|
|
129
157
|
}
|
|
130
158
|
async consumeMessageOnAztecAndMintPrivately(claim) {
|
|
131
159
|
this.logger.info('Consuming messages on L2 privately');
|
|
132
160
|
const { recipient, claimAmount, claimSecret: secretForL2MessageConsumption, messageLeafIndex } = claim;
|
|
133
|
-
await this.l2Bridge.methods.claim_private(recipient, claimAmount, secretForL2MessageConsumption, messageLeafIndex).send(
|
|
161
|
+
await this.l2Bridge.methods.claim_private(recipient, claimAmount, secretForL2MessageConsumption, messageLeafIndex).send({
|
|
162
|
+
from: this.ownerAddress
|
|
163
|
+
});
|
|
134
164
|
}
|
|
135
165
|
async consumeMessageOnAztecAndMintPublicly(claim) {
|
|
136
166
|
this.logger.info('Consuming messages on L2 Publicly');
|
|
137
167
|
const { claimAmount, claimSecret, messageLeafIndex } = claim;
|
|
138
|
-
await this.l2Bridge.methods.claim_public(this.ownerAddress, claimAmount, claimSecret, messageLeafIndex).send(
|
|
168
|
+
await this.l2Bridge.methods.claim_public(this.ownerAddress, claimAmount, claimSecret, messageLeafIndex).send({
|
|
169
|
+
from: this.ownerAddress
|
|
170
|
+
});
|
|
139
171
|
}
|
|
140
|
-
async withdrawPrivateFromAztecToL1(withdrawAmount,
|
|
141
|
-
const withdrawReceipt = await this.l2Bridge.methods.exit_to_l1_private(this.l2Token.address, this.ethAccount, withdrawAmount, EthAddress.ZERO,
|
|
172
|
+
async withdrawPrivateFromAztecToL1(withdrawAmount, authwitNonce = Fr.ZERO, authWitness) {
|
|
173
|
+
const { receipt: withdrawReceipt } = await this.l2Bridge.methods.exit_to_l1_private(this.l2Token.address, this.ethAccount, withdrawAmount, EthAddress.ZERO, authwitNonce).send({
|
|
174
|
+
authWitnesses: [
|
|
175
|
+
authWitness
|
|
176
|
+
],
|
|
177
|
+
from: this.ownerAddress
|
|
178
|
+
});
|
|
142
179
|
return withdrawReceipt;
|
|
143
180
|
}
|
|
144
|
-
async withdrawPublicFromAztecToL1(withdrawAmount,
|
|
145
|
-
const withdrawReceipt = await this.l2Bridge.methods.exit_to_l1_public(this.ethAccount, withdrawAmount, EthAddress.ZERO,
|
|
181
|
+
async withdrawPublicFromAztecToL1(withdrawAmount, authwitNonce = Fr.ZERO) {
|
|
182
|
+
const { receipt: withdrawReceipt } = await this.l2Bridge.methods.exit_to_l1_public(this.ethAccount, withdrawAmount, EthAddress.ZERO, authwitNonce).send({
|
|
183
|
+
from: this.ownerAddress
|
|
184
|
+
});
|
|
146
185
|
return withdrawReceipt;
|
|
147
186
|
}
|
|
148
187
|
async getL2PrivateBalanceOf(owner) {
|
|
149
|
-
return await this.l2Token.methods.balance_of_private(owner).simulate({
|
|
188
|
+
return (await this.l2Token.methods.balance_of_private(owner).simulate({
|
|
150
189
|
from: owner
|
|
151
|
-
});
|
|
190
|
+
})).result;
|
|
152
191
|
}
|
|
153
192
|
async expectPrivateBalanceOnL2(owner, expectedBalance) {
|
|
154
193
|
const balance = await this.getL2PrivateBalanceOf(owner);
|
|
@@ -156,25 +195,31 @@ import { mintTokensToPrivate } from '../fixtures/token_utils.js';
|
|
|
156
195
|
expect(balance).toBe(expectedBalance);
|
|
157
196
|
}
|
|
158
197
|
async getL2PublicBalanceOf(owner) {
|
|
159
|
-
return await this.l2Token.methods.balance_of_public(owner).simulate(
|
|
198
|
+
return (await this.l2Token.methods.balance_of_public(owner).simulate({
|
|
199
|
+
from: this.ownerAddress
|
|
200
|
+
})).result;
|
|
160
201
|
}
|
|
161
202
|
async expectPublicBalanceOnL2(owner, expectedBalance) {
|
|
162
203
|
const balance = await this.getL2PublicBalanceOf(owner);
|
|
163
204
|
expect(balance).toBe(expectedBalance);
|
|
164
205
|
}
|
|
165
|
-
getL2ToL1MessageLeaf(withdrawAmount, callerOnL1 = EthAddress.ZERO) {
|
|
166
|
-
return this.l1TokenPortalManager.getL2ToL1MessageLeaf(withdrawAmount, this.ethAccount, this.l2Bridge.address, callerOnL1);
|
|
206
|
+
async getL2ToL1MessageLeaf(withdrawAmount, callerOnL1 = EthAddress.ZERO) {
|
|
207
|
+
return await this.l1TokenPortalManager.getL2ToL1MessageLeaf(withdrawAmount, this.ethAccount, this.l2Bridge.address, callerOnL1);
|
|
167
208
|
}
|
|
168
|
-
withdrawFundsFromBridgeOnL1(amount,
|
|
169
|
-
return this.l1TokenPortalManager.withdrawFunds(amount, this.ethAccount,
|
|
209
|
+
withdrawFundsFromBridgeOnL1(amount, epochNumber, numCheckpointsInEpoch, messageIndex, siblingPath) {
|
|
210
|
+
return this.l1TokenPortalManager.withdrawFunds(amount, this.ethAccount, epochNumber, numCheckpointsInEpoch, messageIndex, siblingPath);
|
|
170
211
|
}
|
|
171
212
|
async transferToPrivateOnL2(shieldAmount) {
|
|
172
213
|
this.logger.info('Transferring to private on L2');
|
|
173
|
-
await this.l2Token.methods.transfer_to_private(this.ownerAddress, shieldAmount).send(
|
|
214
|
+
await this.l2Token.methods.transfer_to_private(this.ownerAddress, shieldAmount).send({
|
|
215
|
+
from: this.ownerAddress
|
|
216
|
+
});
|
|
174
217
|
}
|
|
175
|
-
async transferToPublicOnL2(amount,
|
|
218
|
+
async transferToPublicOnL2(amount, authwitNonce = Fr.ZERO) {
|
|
176
219
|
this.logger.info('Transferring tokens to public');
|
|
177
|
-
await this.l2Token.methods.transfer_to_public(this.ownerAddress, this.ownerAddress, amount,
|
|
220
|
+
await this.l2Token.methods.transfer_to_public(this.ownerAddress, this.ownerAddress, amount, authwitNonce).send({
|
|
221
|
+
from: this.ownerAddress
|
|
222
|
+
});
|
|
178
223
|
}
|
|
179
224
|
/**
|
|
180
225
|
* Makes message available for consumption.
|
|
@@ -184,9 +229,22 @@ import { mintTokensToPrivate } from '../fixtures/token_utils.js';
|
|
|
184
229
|
* it's included it becomes available for consumption in the next block because the l1 to l2 message tree.
|
|
185
230
|
*/ async makeMessageConsumable(msgHash) {
|
|
186
231
|
const frMsgHash = typeof msgHash === 'string' ? Fr.fromHexString(msgHash) : msgHash;
|
|
187
|
-
|
|
188
|
-
|
|
232
|
+
await waitForL1ToL2MessageSeen(this.aztecNode, frMsgHash, {
|
|
233
|
+
timeoutSeconds: 10
|
|
234
|
+
});
|
|
189
235
|
await this.mintTokensPublicOnL2(0n);
|
|
190
236
|
await this.mintTokensPublicOnL2(0n);
|
|
191
237
|
}
|
|
192
|
-
|
|
238
|
+
toCrossChainContext() {
|
|
239
|
+
return {
|
|
240
|
+
l2Token: this.l2Token.address,
|
|
241
|
+
l2Bridge: this.l2Bridge.address,
|
|
242
|
+
tokenPortal: this.tokenPortalAddress,
|
|
243
|
+
underlying: this.underlyingERC20Address,
|
|
244
|
+
ethAccount: this.ethAccount,
|
|
245
|
+
ownerAddress: this.ownerAddress,
|
|
246
|
+
inbox: this.l1ContractAddresses.inboxAddress,
|
|
247
|
+
outbox: this.l1ContractAddresses.outboxAddress
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
}
|
|
@@ -1,18 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { AztecAddress, EthAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
+
import { L1FeeJuicePortalManager, type L1TokenManager, type L2AmountClaim } from '@aztec/aztec.js/ethereum';
|
|
3
|
+
import type { Logger } from '@aztec/aztec.js/log';
|
|
4
|
+
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
5
|
+
import type { Wallet } from '@aztec/aztec.js/wallet';
|
|
6
|
+
import type { ExtendedViemWalletClient } from '@aztec/ethereum/types';
|
|
3
7
|
import { FeeJuiceContract } from '@aztec/noir-contracts.js/FeeJuice';
|
|
8
|
+
import type { AztecNodeAdmin, AztecNodeDebug } from '@aztec/stdlib/interfaces/client';
|
|
9
|
+
/** Aztec node that may expose the debug mining API in local e2e setups. */
|
|
10
|
+
type MiningAztecNode = AztecNode & Partial<AztecNodeDebug>;
|
|
4
11
|
export interface IGasBridgingTestHarness {
|
|
5
12
|
getL1FeeJuiceBalance(address: EthAddress): Promise<bigint>;
|
|
6
|
-
prepareTokensOnL1(
|
|
7
|
-
bridgeFromL1ToL2(
|
|
13
|
+
prepareTokensOnL1(owner: AztecAddress): Promise<L2AmountClaim>;
|
|
14
|
+
bridgeFromL1ToL2(owner: AztecAddress, claimer: AztecAddress): Promise<void>;
|
|
8
15
|
feeJuice: FeeJuiceContract;
|
|
9
16
|
l1FeeJuiceAddress: EthAddress;
|
|
10
17
|
}
|
|
11
18
|
export interface FeeJuicePortalTestingHarnessFactoryConfig {
|
|
12
|
-
aztecNode:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
walletClient: ViemWalletClient;
|
|
19
|
+
aztecNode: MiningAztecNode;
|
|
20
|
+
aztecNodeAdmin?: AztecNodeAdmin;
|
|
21
|
+
l1Client: ExtendedViemWalletClient;
|
|
16
22
|
wallet: Wallet;
|
|
17
23
|
logger: Logger;
|
|
18
24
|
mockL1?: boolean;
|
|
@@ -29,9 +35,11 @@ export declare class FeeJuicePortalTestingHarnessFactory {
|
|
|
29
35
|
*/
|
|
30
36
|
export declare class GasBridgingTestHarness implements IGasBridgingTestHarness {
|
|
31
37
|
/** Aztec node */
|
|
32
|
-
aztecNode:
|
|
33
|
-
/**
|
|
34
|
-
|
|
38
|
+
aztecNode: MiningAztecNode;
|
|
39
|
+
/** Aztec node admin interface */
|
|
40
|
+
aztecNodeAdmin: AztecNodeAdmin | undefined;
|
|
41
|
+
/** Wallet. */
|
|
42
|
+
wallet: Wallet;
|
|
35
43
|
/** Logger. */
|
|
36
44
|
logger: Logger;
|
|
37
45
|
/** L2 Token/Bridge contract. */
|
|
@@ -42,17 +50,19 @@ export declare class GasBridgingTestHarness implements IGasBridgingTestHarness {
|
|
|
42
50
|
feeJuicePortalAddress: EthAddress;
|
|
43
51
|
/** Underlying token for portal tests. */
|
|
44
52
|
l1FeeJuiceAddress: EthAddress;
|
|
45
|
-
/**
|
|
46
|
-
|
|
47
|
-
/** Viem
|
|
48
|
-
|
|
53
|
+
/** Fee asset handler address. */
|
|
54
|
+
feeAssetHandlerAddress: EthAddress;
|
|
55
|
+
/** Viem Extended client instance. */
|
|
56
|
+
l1Client: ExtendedViemWalletClient;
|
|
49
57
|
readonly l1TokenManager: L1TokenManager;
|
|
50
58
|
readonly feeJuicePortalManager: L1FeeJuicePortalManager;
|
|
51
59
|
constructor(
|
|
52
60
|
/** Aztec node */
|
|
53
|
-
aztecNode:
|
|
54
|
-
/**
|
|
55
|
-
|
|
61
|
+
aztecNode: MiningAztecNode,
|
|
62
|
+
/** Aztec node admin interface */
|
|
63
|
+
aztecNodeAdmin: AztecNodeAdmin | undefined,
|
|
64
|
+
/** Wallet. */
|
|
65
|
+
wallet: Wallet,
|
|
56
66
|
/** Logger. */
|
|
57
67
|
logger: Logger,
|
|
58
68
|
/** L2 Token/Bridge contract. */
|
|
@@ -63,18 +73,19 @@ export declare class GasBridgingTestHarness implements IGasBridgingTestHarness {
|
|
|
63
73
|
feeJuicePortalAddress: EthAddress,
|
|
64
74
|
/** Underlying token for portal tests. */
|
|
65
75
|
l1FeeJuiceAddress: EthAddress,
|
|
66
|
-
/**
|
|
67
|
-
|
|
68
|
-
/** Viem
|
|
69
|
-
|
|
70
|
-
mintTokensOnL1(
|
|
76
|
+
/** Fee asset handler address. */
|
|
77
|
+
feeAssetHandlerAddress: EthAddress,
|
|
78
|
+
/** Viem Extended client instance. */
|
|
79
|
+
l1Client: ExtendedViemWalletClient);
|
|
80
|
+
mintTokensOnL1(to?: EthAddress): Promise<void>;
|
|
71
81
|
getL1FeeJuiceBalance(address: EthAddress): Promise<bigint>;
|
|
72
|
-
sendTokensToPortalPublic(bridgeAmount: bigint, l2Address: AztecAddress
|
|
73
|
-
consumeMessageOnAztecAndClaimPrivately(owner: AztecAddress, claim: L2AmountClaim): Promise<void>;
|
|
82
|
+
sendTokensToPortalPublic(bridgeAmount: bigint, l2Address: AztecAddress): Promise<L2AmountClaim>;
|
|
83
|
+
consumeMessageOnAztecAndClaimPrivately(owner: AztecAddress, claimer: AztecAddress, claim: L2AmountClaim): Promise<void>;
|
|
74
84
|
getL2PublicBalanceOf(owner: AztecAddress): Promise<any>;
|
|
75
85
|
expectPublicBalanceOnL2(owner: AztecAddress, expectedBalance: bigint): Promise<void>;
|
|
76
|
-
prepareTokensOnL1(
|
|
77
|
-
bridgeFromL1ToL2(
|
|
86
|
+
prepareTokensOnL1(owner: AztecAddress): Promise<L2AmountClaim>;
|
|
87
|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QUVyRTtJQUVLLHNDQUFzQyxDQUFDLEtBQUssRUFBRSxZQUFZLEVBQUUsT0FBTyxFQUFFLFlBQVksRUFBRSxLQUFLLEVBQUUsYUFBYSxpQkFJNUc7SUFFSyxvQkFBb0IsQ0FBQyxLQUFLLEVBQUUsWUFBWSxnQkFFN0M7SUFFSyx1QkFBdUIsQ0FBQyxLQUFLLEVBQUUsWUFBWSxFQUFFLGVBQWUsRUFBRSxNQUFNLGlCQUd6RTtJQUVLLGlCQUFpQixDQUFDLEtBQUssRUFBRSxZQUFZLDBCQVkxQztJQUVLLGdCQUFnQixDQUFDLEtBQUssRUFBRSxZQUFZLEVBQUUsT0FBTyxFQUFFLFlBQVksaUJBTWhFO1lBRWEsY0FBYztDQXNCN0IifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gas_portal_test_harness.d.ts","sourceRoot":"","sources":["../../src/shared/gas_portal_test_harness.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"gas_portal_test_harness.d.ts","sourceRoot":"","sources":["../../src/shared/gas_portal_test_harness.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE5G,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAEtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAErE,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAItF,2EAA2E;AAC3E,K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ACzC,qCAAqC;IAC9B,QAAQ,EAAE,wBAAwB;IA1B3C,SAAgB,cAAc,EAAE,cAAc,CAAC;IAC/C,SAAgB,qBAAqB,EAAE,uBAAuB,CAAC;IAE/D;IACE,iBAAiB;IACV,SAAS,EAAE,eAAe;IACjC,iCAAiC;IAC1B,cAAc,EAAE,cAAc,GAAG,SAAS;IACjD,cAAc;IACP,MAAM,EAAE,MAAM;IACrB,cAAc;IACP,MAAM,EAAE,MAAM;IAErB,gCAAgC;IACzB,QAAQ,EAAE,gBAAgB;IAEjC,oCAAoC;IAC7B,UAAU,EAAE,UAAU;IAE7B,sBAAsB;IACf,qBAAqB,EAAE,UAAU;IACxC,yCAAyC;IAClC,iBAAiB,EAAE,UAAU;IACpC,iCAAiC;IAC1B,sBAAsB,EAAE,UAAU;IACzC,qCAAqC;IAC9B,QAAQ,EAAE,wBAAwB,EAW1C;IAEK,cAAc,CAAC,EAAE,GAAE,UAA4B,iBAKpD;IAEK,oBAAoB,CAAC,OAAO,EAAE,UAAU,mBAE7C;IAED,wBAAwB,CAAC,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,0BAErE;IAEK,sCAAsC,CAAC,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,aAAa,iBAI5G;IAEK,oBAAoB,CAAC,KAAK,EAAE,YAAY,gBAE7C;IAEK,uBAAuB,CAAC,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,iBAGzE;IAEK,iBAAiB,CAAC,KAAK,EAAE,YAAY,0BAY1C;IAEK,gBAAgB,CAAC,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,iBAMhE;YAEa,cAAc;CAsB7B"}
|
|
@@ -1,22 +1,26 @@
|
|
|
1
|
-
import { EthAddress
|
|
1
|
+
import { EthAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
+
import { L1FeeJuicePortalManager } from '@aztec/aztec.js/ethereum';
|
|
3
|
+
import { Fr } from '@aztec/aztec.js/fields';
|
|
4
|
+
import { retryUntil } from '@aztec/foundation/retry';
|
|
2
5
|
import { FeeJuiceContract } from '@aztec/noir-contracts.js/FeeJuice';
|
|
3
6
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
7
|
+
import { waitForL1ToL2MessageSeen } from './wait_for_l1_to_l2_message.js';
|
|
4
8
|
export class FeeJuicePortalTestingHarnessFactory {
|
|
5
9
|
config;
|
|
6
10
|
constructor(config){
|
|
7
11
|
this.config = config;
|
|
8
12
|
}
|
|
9
13
|
async createReal() {
|
|
10
|
-
const { aztecNode,
|
|
11
|
-
const ethAccount = EthAddress.fromString((await
|
|
12
|
-
const l1ContractAddresses = (await
|
|
14
|
+
const { aztecNode, aztecNodeAdmin, l1Client, wallet, logger } = this.config;
|
|
15
|
+
const ethAccount = EthAddress.fromString((await l1Client.getAddresses())[0]);
|
|
16
|
+
const l1ContractAddresses = (await aztecNode.getNodeInfo()).l1ContractAddresses;
|
|
13
17
|
const feeJuiceAddress = l1ContractAddresses.feeJuiceAddress;
|
|
14
18
|
const feeJuicePortalAddress = l1ContractAddresses.feeJuicePortalAddress;
|
|
15
19
|
if (feeJuiceAddress.isZero() || feeJuicePortalAddress.isZero()) {
|
|
16
20
|
throw new Error('Fee Juice portal not deployed on L1');
|
|
17
21
|
}
|
|
18
|
-
const gasL2 =
|
|
19
|
-
return new GasBridgingTestHarness(aztecNode,
|
|
22
|
+
const gasL2 = FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, wallet);
|
|
23
|
+
return new GasBridgingTestHarness(aztecNode, aztecNodeAdmin, wallet, logger, gasL2, ethAccount, feeJuicePortalAddress, feeJuiceAddress, l1ContractAddresses.feeAssetHandlerAddress, l1Client);
|
|
20
24
|
}
|
|
21
25
|
static create(config) {
|
|
22
26
|
const factory = new FeeJuicePortalTestingHarnessFactory(config);
|
|
@@ -28,71 +32,97 @@ export class FeeJuicePortalTestingHarnessFactory {
|
|
|
28
32
|
* shared between cross chain tests.
|
|
29
33
|
*/ export class GasBridgingTestHarness {
|
|
30
34
|
aztecNode;
|
|
31
|
-
|
|
35
|
+
aztecNodeAdmin;
|
|
36
|
+
wallet;
|
|
32
37
|
logger;
|
|
33
38
|
feeJuice;
|
|
34
39
|
ethAccount;
|
|
35
40
|
feeJuicePortalAddress;
|
|
36
41
|
l1FeeJuiceAddress;
|
|
37
|
-
|
|
38
|
-
|
|
42
|
+
feeAssetHandlerAddress;
|
|
43
|
+
l1Client;
|
|
39
44
|
l1TokenManager;
|
|
40
45
|
feeJuicePortalManager;
|
|
41
|
-
constructor(/** Aztec node */ aztecNode, /**
|
|
46
|
+
constructor(/** Aztec node */ aztecNode, /** Aztec node admin interface */ aztecNodeAdmin, /** Wallet. */ wallet, /** Logger. */ logger, /** L2 Token/Bridge contract. */ feeJuice, /** Eth account to interact with. */ ethAccount, /** Portal address. */ feeJuicePortalAddress, /** Underlying token for portal tests. */ l1FeeJuiceAddress, /** Fee asset handler address. */ feeAssetHandlerAddress, /** Viem Extended client instance. */ l1Client){
|
|
42
47
|
this.aztecNode = aztecNode;
|
|
43
|
-
this.
|
|
48
|
+
this.aztecNodeAdmin = aztecNodeAdmin;
|
|
49
|
+
this.wallet = wallet;
|
|
44
50
|
this.logger = logger;
|
|
45
51
|
this.feeJuice = feeJuice;
|
|
46
52
|
this.ethAccount = ethAccount;
|
|
47
53
|
this.feeJuicePortalAddress = feeJuicePortalAddress;
|
|
48
54
|
this.l1FeeJuiceAddress = l1FeeJuiceAddress;
|
|
49
|
-
this.
|
|
50
|
-
this.
|
|
51
|
-
this.feeJuicePortalManager = new L1FeeJuicePortalManager(this.feeJuicePortalAddress, this.l1FeeJuiceAddress, this.
|
|
55
|
+
this.feeAssetHandlerAddress = feeAssetHandlerAddress;
|
|
56
|
+
this.l1Client = l1Client;
|
|
57
|
+
this.feeJuicePortalManager = new L1FeeJuicePortalManager(this.feeJuicePortalAddress, this.l1FeeJuiceAddress, this.feeAssetHandlerAddress, this.l1Client, this.logger);
|
|
52
58
|
this.l1TokenManager = this.feeJuicePortalManager.getTokenManager();
|
|
53
59
|
}
|
|
54
|
-
async mintTokensOnL1(
|
|
55
|
-
const balanceBefore = await this.l1TokenManager.getL1TokenBalance(to.toString());
|
|
56
|
-
await this.l1TokenManager.mint(
|
|
57
|
-
|
|
60
|
+
async mintTokensOnL1(to = this.ethAccount) {
|
|
61
|
+
// const balanceBefore = await this.l1TokenManager.getL1TokenBalance(to.toString());
|
|
62
|
+
await this.l1TokenManager.mint(to.toString());
|
|
63
|
+
// expect(await this.l1TokenManager.getL1TokenBalance(to.toString())).toEqual(balanceBefore + amount);
|
|
58
64
|
}
|
|
59
65
|
async getL1FeeJuiceBalance(address) {
|
|
60
66
|
return await this.l1TokenManager.getL1TokenBalance(address.toString());
|
|
61
67
|
}
|
|
62
|
-
sendTokensToPortalPublic(bridgeAmount, l2Address
|
|
63
|
-
return this.feeJuicePortalManager.bridgeTokensPublic(l2Address, bridgeAmount,
|
|
68
|
+
sendTokensToPortalPublic(bridgeAmount, l2Address) {
|
|
69
|
+
return this.feeJuicePortalManager.bridgeTokensPublic(l2Address, bridgeAmount, false);
|
|
64
70
|
}
|
|
65
|
-
async consumeMessageOnAztecAndClaimPrivately(owner, claim) {
|
|
71
|
+
async consumeMessageOnAztecAndClaimPrivately(owner, claimer, claim) {
|
|
66
72
|
this.logger.info('Consuming messages on L2 Privately');
|
|
67
73
|
const { claimAmount, claimSecret, messageLeafIndex } = claim;
|
|
68
|
-
await this.feeJuice.methods.claim(owner, claimAmount, claimSecret, messageLeafIndex).send(
|
|
74
|
+
await this.feeJuice.methods.claim(owner, claimAmount, claimSecret, messageLeafIndex).send({
|
|
75
|
+
from: claimer
|
|
76
|
+
});
|
|
69
77
|
}
|
|
70
78
|
async getL2PublicBalanceOf(owner) {
|
|
71
|
-
return await this.feeJuice.methods.balance_of_public(owner).simulate(
|
|
79
|
+
return (await this.feeJuice.methods.balance_of_public(owner).simulate({
|
|
80
|
+
from: owner
|
|
81
|
+
})).result;
|
|
72
82
|
}
|
|
73
83
|
async expectPublicBalanceOnL2(owner, expectedBalance) {
|
|
74
84
|
const balance = await this.getL2PublicBalanceOf(owner);
|
|
75
85
|
expect(balance).toBe(expectedBalance);
|
|
76
86
|
}
|
|
77
|
-
async prepareTokensOnL1(
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
87
|
+
async prepareTokensOnL1(owner) {
|
|
88
|
+
const bridgeAmount = await this.l1TokenManager.getMintAmount();
|
|
89
|
+
await this.mintTokensOnL1();
|
|
90
|
+
const claim = await this.sendTokensToPortalPublic(bridgeAmount, owner);
|
|
91
|
+
await waitForL1ToL2MessageSeen(this.aztecNode, Fr.fromHexString(claim.messageHash), {
|
|
92
|
+
timeoutSeconds: 24
|
|
93
|
+
});
|
|
81
94
|
// Progress by 2 L2 blocks so that the l1ToL2Message added above will be available to use on L2.
|
|
82
95
|
await this.advanceL2Block();
|
|
83
96
|
await this.advanceL2Block();
|
|
84
97
|
return claim;
|
|
85
98
|
}
|
|
86
|
-
async bridgeFromL1ToL2(
|
|
99
|
+
async bridgeFromL1ToL2(owner, claimer) {
|
|
87
100
|
// Prepare the tokens on the L1 side
|
|
88
|
-
const claim = await this.prepareTokensOnL1(
|
|
101
|
+
const claim = await this.prepareTokensOnL1(owner);
|
|
89
102
|
// Consume L1 -> L2 message and claim tokens privately on L2
|
|
90
|
-
await this.consumeMessageOnAztecAndClaimPrivately(owner, claim);
|
|
91
|
-
await this.expectPublicBalanceOnL2(owner, bridgeAmount);
|
|
103
|
+
await this.consumeMessageOnAztecAndClaimPrivately(owner, claimer, claim);
|
|
92
104
|
}
|
|
93
105
|
async advanceL2Block() {
|
|
106
|
+
if (this.aztecNode.mineBlock) {
|
|
107
|
+
await this.aztecNode.mineBlock();
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
94
110
|
const initialBlockNumber = await this.aztecNode.getBlockNumber();
|
|
95
|
-
|
|
96
|
-
|
|
111
|
+
let minTxsPerBlock = undefined;
|
|
112
|
+
if (this.aztecNodeAdmin) {
|
|
113
|
+
({ minTxsPerBlock } = await this.aztecNodeAdmin.getConfig());
|
|
114
|
+
await this.aztecNodeAdmin.setConfig({
|
|
115
|
+
minTxsPerBlock: 0
|
|
116
|
+
}); // Set to 0 to ensure we can advance the block
|
|
117
|
+
}
|
|
118
|
+
try {
|
|
119
|
+
await retryUntil(async ()=>await this.aztecNode.getBlockNumber() >= initialBlockNumber + 1);
|
|
120
|
+
} finally{
|
|
121
|
+
if (this.aztecNodeAdmin && minTxsPerBlock !== undefined) {
|
|
122
|
+
await this.aztecNodeAdmin.setConfig({
|
|
123
|
+
minTxsPerBlock
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}
|
|
97
127
|
}
|
|
98
|
-
}
|
|
128
|
+
}
|
package/dest/shared/index.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export { uniswapL1L2TestSuite
|
|
2
|
-
|
|
1
|
+
export { uniswapL1L2TestSuite } from './uniswap_l1_l2.js';
|
|
2
|
+
export { MockStateView, diffInBps } from './mock_state_view.js';
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zaGFyZWQvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLG9CQUFvQixFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFDMUQsT0FBTyxFQUFFLGFBQWEsRUFBRSxTQUFTLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQyJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shared/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shared/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC"}
|
package/dest/shared/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export {};
|
|
2
|
-
//# sourceMappingURL=
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiamVzdF9zZXR1cC5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3NoYXJlZC9qZXN0X3NldHVwLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIifQ==
|