@aztec/end-to-end 0.0.0-test.1 → 0.0.1-commit.0208eb9
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/dest/bench/client_flows/benchmark.d.ts +62 -0
- package/dest/bench/client_flows/benchmark.d.ts.map +1 -0
- package/dest/bench/client_flows/benchmark.js +281 -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 +321 -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 +106 -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 +41 -72
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +26 -19
- 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 +114 -102
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +32 -32
- 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 +104 -104
- package/dest/e2e_deploy_contract/deploy_test.d.ts +19 -10
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
- package/dest/e2e_deploy_contract/deploy_test.js +26 -27
- package/dest/e2e_epochs/epochs_test.d.ts +71 -22
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +260 -54
- 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 +38 -23
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +162 -183
- 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 +15 -15
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +37 -41
- 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 +136 -0
- package/dest/e2e_p2p/p2p_network.d.ts +281 -27
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +237 -175
- 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 +153 -0
- package/dest/e2e_p2p/shared.d.ts +44 -8
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +165 -27
- package/dest/e2e_token_contract/token_contract_test.d.ts +27 -14
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/e2e_token_contract/token_contract_test.js +96 -74
- package/dest/fixtures/e2e_prover_test.d.ts +55 -0
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -0
- package/dest/fixtures/e2e_prover_test.js +278 -0
- package/dest/fixtures/fixtures.d.ts +6 -8
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/fixtures.js +5 -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 +114 -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/setup.d.ts +218 -0
- package/dest/fixtures/setup.d.ts.map +1 -0
- package/dest/fixtures/setup.js +695 -0
- package/dest/fixtures/setup_p2p_test.d.ts +15 -15
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +96 -31
- 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 +31 -12
- 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/index.d.ts +1 -1
- 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 +44 -27
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +105 -51
- package/dest/shared/gas_portal_test_harness.d.ts +33 -25
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.js +51 -30
- package/dest/shared/index.d.ts +2 -2
- package/dest/shared/index.d.ts.map +1 -1
- package/dest/shared/jest_setup.d.ts +1 -1
- package/dest/shared/jest_setup.js +1 -1
- 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 +176 -126
- package/dest/simulators/index.d.ts +1 -1
- package/dest/simulators/lending_simulator.d.ts +7 -7
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.js +17 -18
- 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 +16 -13
- package/dest/spartan/setup_test_wallets.d.ts +27 -11
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +233 -62
- package/dest/spartan/tx_metrics.d.ts +88 -0
- package/dest/spartan/tx_metrics.d.ts.map +1 -0
- package/dest/spartan/tx_metrics.js +422 -0
- package/dest/spartan/utils/bot.d.ts +27 -0
- package/dest/spartan/utils/bot.d.ts.map +1 -0
- package/dest/spartan/utils/bot.js +141 -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 +39 -0
- package/dest/spartan/utils/config.d.ts.map +1 -0
- package/dest/spartan/utils/config.js +21 -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 +9 -0
- package/dest/spartan/utils/index.d.ts.map +1 -0
- package/dest/spartan/utils/index.js +18 -0
- package/dest/spartan/utils/k8s.d.ts +126 -0
- package/dest/spartan/utils/k8s.d.ts.map +1 -0
- package/dest/spartan/utils/k8s.js +375 -0
- package/dest/spartan/utils/nodes.d.ts +41 -0
- package/dest/spartan/utils/nodes.d.ts.map +1 -0
- package/dest/spartan/utils/nodes.js +461 -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/package.json +69 -58
- package/src/bench/client_flows/benchmark.ts +363 -0
- package/src/bench/client_flows/client_flows_benchmark.ts +384 -0
- package/src/bench/client_flows/config.ts +61 -0
- package/src/bench/client_flows/data_extractor.ts +89 -0
- package/src/bench/utils.ts +41 -85
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +134 -169
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +156 -182
- package/src/e2e_deploy_contract/deploy_test.ts +40 -48
- package/src/e2e_epochs/epochs_test.ts +341 -81
- package/src/e2e_fees/bridging_race.notest.ts +74 -0
- package/src/e2e_fees/fees_test.ts +220 -258
- 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 +46 -59
- package/src/e2e_p2p/inactivity_slash_test.ts +179 -0
- package/src/e2e_p2p/p2p_network.ts +341 -234
- package/src/e2e_p2p/reqresp/utils.ts +207 -0
- package/src/e2e_p2p/shared.ts +260 -39
- package/src/e2e_token_contract/token_contract_test.ts +115 -126
- package/src/fixtures/dumps/epoch_proof_result.json +1 -1
- package/src/fixtures/e2e_prover_test.ts +336 -0
- package/src/fixtures/fixtures.ts +5 -7
- package/src/fixtures/get_acvm_config.ts +4 -12
- package/src/fixtures/get_bb_config.ts +18 -13
- package/src/fixtures/ha_setup.ts +184 -0
- package/src/fixtures/index.ts +1 -0
- package/src/fixtures/l1_to_l2_messaging.ts +56 -24
- package/src/fixtures/setup.ts +1017 -0
- package/src/fixtures/setup_p2p_test.ts +133 -50
- package/src/fixtures/token_utils.ts +33 -15
- package/src/fixtures/utils.ts +27 -820
- package/src/fixtures/web3signer.ts +63 -0
- package/src/fixtures/with_telemetry_utils.ts +2 -2
- package/src/guides/up_quick_start.sh +7 -15
- 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 +103 -91
- package/src/shared/gas_portal_test_harness.ts +59 -50
- package/src/shared/index.ts +1 -1
- package/src/shared/jest_setup.ts +1 -1
- package/src/shared/submit-transactions.ts +18 -20
- package/src/shared/uniswap_l1_l2.ts +197 -221
- package/src/simulators/lending_simulator.ts +16 -17
- package/src/simulators/token_simulator.ts +21 -13
- package/src/spartan/DEVELOP.md +128 -0
- package/src/spartan/setup_test_wallets.ts +308 -95
- package/src/spartan/tx_metrics.ts +376 -0
- package/src/spartan/utils/bot.ts +185 -0
- package/src/spartan/utils/chaos.ts +253 -0
- package/src/spartan/utils/clients.ts +100 -0
- package/src/spartan/utils/config.ts +27 -0
- package/src/spartan/utils/health.ts +255 -0
- package/src/spartan/utils/helm.ts +84 -0
- package/src/spartan/utils/index.ts +64 -0
- package/src/spartan/utils/k8s.ts +527 -0
- package/src/spartan/utils/nodes.ts +538 -0
- package/src/spartan/utils/scripts.ts +99 -0
- package/src/spartan/utils.ts +1 -582
- 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,128 +0,0 @@
|
|
|
1
|
-
// docs:start:imports
|
|
2
|
-
import { getInitialTestAccountsWallets } from '@aztec/accounts/testing';
|
|
3
|
-
import { createPXEClient, waitForPXE } from '@aztec/aztec.js';
|
|
4
|
-
import { fileURLToPath } from '@aztec/foundation/url';
|
|
5
|
-
|
|
6
|
-
import { getToken } from './contracts.mjs';
|
|
7
|
-
|
|
8
|
-
// docs:end:imports
|
|
9
|
-
|
|
10
|
-
const { PXE_URL = 'http://localhost:8080' } = process.env;
|
|
11
|
-
|
|
12
|
-
// docs:start:showAccounts
|
|
13
|
-
async function showAccounts(pxe) {
|
|
14
|
-
const accounts = await pxe.getRegisteredAccounts();
|
|
15
|
-
console.log(`User accounts:\n${accounts.map(a => a.address).join('\n')}`);
|
|
16
|
-
}
|
|
17
|
-
// docs:end:showAccounts
|
|
18
|
-
|
|
19
|
-
// docs:start:showPrivateBalances
|
|
20
|
-
async function showPrivateBalances(pxe) {
|
|
21
|
-
const [owner] = await getInitialTestAccountsWallets(pxe);
|
|
22
|
-
const token = await getToken(owner);
|
|
23
|
-
|
|
24
|
-
const accounts = await pxe.getRegisteredAccounts();
|
|
25
|
-
|
|
26
|
-
for (const account of accounts) {
|
|
27
|
-
// highlight-next-line:showPrivateBalances
|
|
28
|
-
const balance = await token.methods.balance_of_private(account.address).simulate();
|
|
29
|
-
console.log(`Balance of ${account.address}: ${balance}`);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
// docs:end:showPrivateBalances
|
|
33
|
-
|
|
34
|
-
// docs:start:mintPrivateFunds
|
|
35
|
-
async function mintPrivateFunds(pxe) {
|
|
36
|
-
const [ownerWallet] = await getInitialTestAccountsWallets(pxe);
|
|
37
|
-
const token = await getToken(ownerWallet);
|
|
38
|
-
|
|
39
|
-
await showPrivateBalances(pxe);
|
|
40
|
-
|
|
41
|
-
// We mint tokens to the owner
|
|
42
|
-
const mintAmount = 20n;
|
|
43
|
-
const from = ownerWallet.getAddress(); // we are setting from to owner here because we need a sender to calculate the tag
|
|
44
|
-
await token.methods.mint_to_private(from, ownerWallet.getAddress(), mintAmount).send().wait();
|
|
45
|
-
|
|
46
|
-
await showPrivateBalances(pxe);
|
|
47
|
-
}
|
|
48
|
-
// docs:end:mintPrivateFunds
|
|
49
|
-
|
|
50
|
-
// docs:start:transferPrivateFunds
|
|
51
|
-
async function transferPrivateFunds(pxe) {
|
|
52
|
-
const [owner, recipient] = await getInitialTestAccountsWallets(pxe);
|
|
53
|
-
const token = await getToken(owner);
|
|
54
|
-
|
|
55
|
-
await showPrivateBalances(pxe);
|
|
56
|
-
console.log(`Sending transaction, awaiting transaction to be mined`);
|
|
57
|
-
const receipt = await token.methods.transfer(recipient.getAddress(), 1).send().wait();
|
|
58
|
-
|
|
59
|
-
console.log(`Transaction ${receipt.txHash} has been mined on block ${receipt.blockNumber}`);
|
|
60
|
-
await showPrivateBalances(pxe);
|
|
61
|
-
}
|
|
62
|
-
// docs:end:transferPrivateFunds
|
|
63
|
-
|
|
64
|
-
// docs:start:showPublicBalances
|
|
65
|
-
async function showPublicBalances(pxe) {
|
|
66
|
-
const [owner] = await getInitialTestAccountsWallets(pxe);
|
|
67
|
-
const token = await getToken(owner);
|
|
68
|
-
|
|
69
|
-
const accounts = await pxe.getRegisteredAccounts();
|
|
70
|
-
|
|
71
|
-
for (const account of accounts) {
|
|
72
|
-
// highlight-next-line:showPublicBalances
|
|
73
|
-
const balance = await token.methods.balance_of_public(account.address).simulate();
|
|
74
|
-
console.log(`Balance of ${account.address}: ${balance}`);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
// docs:end:showPublicBalances
|
|
78
|
-
|
|
79
|
-
// docs:start:mintPublicFunds
|
|
80
|
-
async function mintPublicFunds(pxe) {
|
|
81
|
-
const [owner] = await getInitialTestAccountsWallets(pxe);
|
|
82
|
-
const token = await getToken(owner);
|
|
83
|
-
|
|
84
|
-
await showPublicBalances(pxe);
|
|
85
|
-
|
|
86
|
-
console.log(`Sending transaction, awaiting transaction to be mined`);
|
|
87
|
-
const receipt = await token.methods.mint_to_public(owner.getAddress(), 100).send().wait();
|
|
88
|
-
console.log(`Transaction ${receipt.txHash} has been mined on block ${receipt.blockNumber}`);
|
|
89
|
-
|
|
90
|
-
await showPublicBalances(pxe);
|
|
91
|
-
|
|
92
|
-
// docs:start:showLogs
|
|
93
|
-
const blockNumber = await pxe.getBlockNumber();
|
|
94
|
-
const logs = (await pxe.getPublicLogs({ fromBlock: blockNumber - 1 })).logs;
|
|
95
|
-
const textLogs = logs.map(extendedLog => extendedLog.toHumanReadable().slice(0, 200));
|
|
96
|
-
for (const log of textLogs) console.log(`Log emitted: ${log}`);
|
|
97
|
-
// docs:end:showLogs
|
|
98
|
-
}
|
|
99
|
-
// docs:end:mintPublicFunds
|
|
100
|
-
|
|
101
|
-
async function main() {
|
|
102
|
-
const pxe = createPXEClient(PXE_URL);
|
|
103
|
-
await waitForPXE(pxe);
|
|
104
|
-
|
|
105
|
-
const { l1ChainId } = await pxe.getNodeInfo();
|
|
106
|
-
console.log(`Connected to chain ${l1ChainId}`);
|
|
107
|
-
|
|
108
|
-
await showAccounts(pxe);
|
|
109
|
-
|
|
110
|
-
await mintPrivateFunds(pxe);
|
|
111
|
-
|
|
112
|
-
await transferPrivateFunds(pxe);
|
|
113
|
-
|
|
114
|
-
await mintPublicFunds(pxe);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
// Execute main only if run directly
|
|
118
|
-
if (process.argv[1].replace(/\/index\.m?js$/, '') === fileURLToPath(import.meta.url).replace(/\/index\.m?js$/, '')) {
|
|
119
|
-
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
120
|
-
main()
|
|
121
|
-
.then(() => process.exit(0))
|
|
122
|
-
.catch(err => {
|
|
123
|
-
console.error(`Error in app: ${err}`);
|
|
124
|
-
process.exit(1);
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
export { main };
|