@aztec/end-to-end 3.0.0-nightly.20250910 → 3.0.0-nightly.20250912
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/client_flows_benchmark.d.ts +14 -12
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +35 -39
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +6 -4
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +3 -6
- 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 +38 -38
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +4 -5
- 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 +16 -20
- package/dest/e2e_deploy_contract/deploy_test.d.ts +2 -2
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
- package/dest/e2e_deploy_contract/deploy_test.js +4 -7
- package/dest/e2e_epochs/epochs_test.d.ts +2 -0
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +5 -0
- package/dest/e2e_fees/bridging_race.notest.js +10 -8
- package/dest/e2e_fees/fees_test.d.ts +3 -4
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +26 -21
- package/dest/e2e_nested_contract/nested_contract_test.d.ts +2 -2
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +4 -6
- package/dest/e2e_p2p/p2p_network.d.ts +3 -2
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +7 -11
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +10 -18
- package/dest/e2e_token_contract/token_contract_test.d.ts +2 -4
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/e2e_token_contract/token_contract_test.js +13 -16
- package/dest/fixtures/e2e_prover_test.d.ts +4 -3
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +22 -29
- package/dest/fixtures/snapshot_manager.d.ts +6 -4
- package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.js +22 -12
- package/dest/fixtures/token_utils.d.ts +3 -3
- package/dest/fixtures/token_utils.d.ts.map +1 -1
- package/dest/fixtures/token_utils.js +8 -10
- package/dest/fixtures/utils.d.ts +7 -7
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +31 -28
- package/dest/shared/cross_chain_test_harness.d.ts +6 -6
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +5 -6
- package/dest/shared/gas_portal_test_harness.d.ts +1 -1
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/submit-transactions.d.ts +3 -3
- package/dest/shared/submit-transactions.d.ts.map +1 -1
- package/dest/shared/submit-transactions.js +4 -5
- package/dest/shared/uniswap_l1_l2.d.ts +6 -4
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +18 -21
- package/dest/simulators/lending_simulator.js +1 -1
- package/dest/spartan/setup_test_wallets.d.ts +12 -10
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +54 -50
- package/package.json +37 -36
- package/src/bench/client_flows/client_flows_benchmark.ts +41 -52
- package/src/bench/utils.ts +6 -6
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +39 -50
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +15 -33
- package/src/e2e_deploy_contract/deploy_test.ts +6 -14
- package/src/e2e_epochs/epochs_test.ts +3 -0
- package/src/e2e_fees/bridging_race.notest.ts +12 -9
- package/src/e2e_fees/fees_test.ts +30 -30
- package/src/e2e_nested_contract/nested_contract_test.ts +6 -8
- package/src/e2e_p2p/p2p_network.ts +16 -15
- package/src/e2e_p2p/shared.ts +14 -21
- package/src/e2e_token_contract/token_contract_test.ts +14 -17
- package/src/fixtures/e2e_prover_test.ts +26 -60
- package/src/fixtures/snapshot_manager.ts +32 -24
- package/src/fixtures/token_utils.ts +7 -15
- package/src/fixtures/utils.ts +41 -44
- package/src/shared/cross_chain_test_harness.ts +5 -7
- package/src/shared/gas_portal_test_harness.ts +1 -1
- package/src/shared/submit-transactions.ts +7 -8
- package/src/shared/uniswap_l1_l2.ts +40 -36
- package/src/simulators/lending_simulator.ts +1 -1
- package/src/spartan/setup_test_wallets.ts +82 -73
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { generateSchnorrAccounts, getDeployedTestAccountsWallets } from '@aztec/accounts/testing';
|
|
1
|
+
import { generateSchnorrAccounts, getDeployedTestAccounts } from '@aztec/accounts/testing';
|
|
3
2
|
import {
|
|
4
|
-
type AccountWalletWithSecretKey,
|
|
5
3
|
type AztecAddress,
|
|
6
4
|
type AztecNode,
|
|
7
5
|
FeeJuicePaymentMethodWithClaim,
|
|
@@ -10,6 +8,7 @@ import {
|
|
|
10
8
|
L1FeeJuicePortalManager,
|
|
11
9
|
type PXE,
|
|
12
10
|
SponsoredFeePaymentMethod,
|
|
11
|
+
type Wallet,
|
|
13
12
|
createAztecNodeClient,
|
|
14
13
|
createCompatibleClient,
|
|
15
14
|
retryUntil,
|
|
@@ -19,18 +18,19 @@ import type { Logger } from '@aztec/foundation/log';
|
|
|
19
18
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
20
19
|
import { createPXEService } from '@aztec/pxe/server';
|
|
21
20
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
21
|
+
import { TestWallet } from '@aztec/test-wallet';
|
|
22
22
|
|
|
23
23
|
import { getACVMConfig } from '../fixtures/get_acvm_config.js';
|
|
24
24
|
import { getBBConfig } from '../fixtures/get_bb_config.js';
|
|
25
25
|
import { getSponsoredFPCAddress, registerSponsoredFPC } from '../fixtures/utils.js';
|
|
26
26
|
|
|
27
|
-
export interface
|
|
27
|
+
export interface TestAccounts {
|
|
28
28
|
pxe: PXE;
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
wallet: TestWallet;
|
|
30
|
+
accounts: AztecAddress[];
|
|
31
|
+
tokenContract: TokenContract;
|
|
31
32
|
tokenAdminAddress: AztecAddress;
|
|
32
33
|
tokenName: string;
|
|
33
|
-
recipientWallet: AccountWalletWithSecretKey;
|
|
34
34
|
recipientAddress: AztecAddress;
|
|
35
35
|
tokenAddress: AztecAddress;
|
|
36
36
|
}
|
|
@@ -39,83 +39,86 @@ const TOKEN_NAME = 'USDC';
|
|
|
39
39
|
const TOKEN_SYMBOL = 'USD';
|
|
40
40
|
const TOKEN_DECIMALS = 18n;
|
|
41
41
|
|
|
42
|
-
export async function
|
|
42
|
+
export async function setupTestAccountsWithTokens(
|
|
43
43
|
pxeUrl: string,
|
|
44
44
|
mintAmount: bigint,
|
|
45
45
|
logger: Logger,
|
|
46
|
-
): Promise<
|
|
47
|
-
const
|
|
46
|
+
): Promise<TestAccounts> {
|
|
47
|
+
const ACCOUNT_COUNT = 1; // TODO fix this to allow for 16 wallets again
|
|
48
48
|
|
|
49
49
|
const pxe = await createCompatibleClient(pxeUrl, logger);
|
|
50
|
+
const wallet = new TestWallet(pxe);
|
|
50
51
|
|
|
51
|
-
const [
|
|
52
|
+
const [recipientAccount, ...accounts] = (await getDeployedTestAccounts(pxe)).slice(0, ACCOUNT_COUNT + 1);
|
|
52
53
|
|
|
53
|
-
const tokenAdmin =
|
|
54
|
-
const tokenAddress = await deployTokenAndMint(
|
|
55
|
-
|
|
54
|
+
const tokenAdmin = accounts[0];
|
|
55
|
+
const tokenAddress = await deployTokenAndMint(
|
|
56
|
+
wallet,
|
|
57
|
+
accounts.map(acc => acc.address),
|
|
58
|
+
tokenAdmin.address,
|
|
59
|
+
mintAmount,
|
|
60
|
+
undefined,
|
|
61
|
+
logger,
|
|
62
|
+
);
|
|
63
|
+
const tokenContract = await TokenContract.at(tokenAddress, wallet);
|
|
56
64
|
|
|
57
65
|
return {
|
|
58
66
|
pxe,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
tokenAdminAddress: tokenAdmin.
|
|
67
|
+
accounts: accounts.map(acc => acc.address),
|
|
68
|
+
wallet,
|
|
69
|
+
tokenAdminAddress: tokenAdmin.address,
|
|
62
70
|
tokenName: TOKEN_NAME,
|
|
63
71
|
tokenAddress,
|
|
64
|
-
|
|
65
|
-
|
|
72
|
+
tokenContract,
|
|
73
|
+
recipientAddress: recipientAccount.address,
|
|
66
74
|
};
|
|
67
75
|
}
|
|
68
76
|
|
|
69
|
-
export async function
|
|
77
|
+
export async function deploySponsoredTestAccounts(
|
|
70
78
|
pxe: PXE,
|
|
71
79
|
mintAmount: bigint,
|
|
72
80
|
logger: Logger,
|
|
73
81
|
numberOfFundedWallets = 1,
|
|
74
|
-
): Promise<
|
|
82
|
+
): Promise<TestAccounts> {
|
|
83
|
+
const wallet = new TestWallet(pxe);
|
|
75
84
|
const [recipient, ...funded] = await generateSchnorrAccounts(numberOfFundedWallets + 1);
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
recipient.secret,
|
|
79
|
-
recipient.signingKey,
|
|
80
|
-
recipient.salt,
|
|
81
|
-
);
|
|
82
|
-
const fundedAccounts = await Promise.all(funded.map(a => getSchnorrAccount(pxe, a.secret, a.signingKey, a.salt)));
|
|
85
|
+
const recipientAccount = await wallet.createSchnorrAccount(recipient.secret, recipient.salt);
|
|
86
|
+
const fundedAccounts = await Promise.all(funded.map(a => wallet.createSchnorrAccount(a.secret, a.salt)));
|
|
83
87
|
|
|
84
|
-
await registerSponsoredFPC(
|
|
88
|
+
await registerSponsoredFPC(wallet);
|
|
85
89
|
|
|
86
|
-
|
|
90
|
+
await Promise.all(
|
|
87
91
|
fundedAccounts.map(async a => {
|
|
88
|
-
const wallet = await a.getWallet();
|
|
89
92
|
const paymentMethod = new SponsoredFeePaymentMethod(await getSponsoredFPCAddress());
|
|
90
|
-
await
|
|
93
|
+
await recipientAccount.deploy({ fee: { paymentMethod } }).wait({ timeout: 2400 }); // increase timeout on purpose in order to account for two empty epochs
|
|
91
94
|
logger.info(`Account deployed at ${a.getAddress()}`);
|
|
92
|
-
return wallet;
|
|
93
95
|
}),
|
|
94
96
|
);
|
|
95
97
|
|
|
96
|
-
const tokenAdmin =
|
|
98
|
+
const tokenAdmin = fundedAccounts[0];
|
|
97
99
|
const tokenAddress = await deployTokenAndMint(
|
|
98
|
-
|
|
100
|
+
wallet,
|
|
101
|
+
fundedAccounts.map(acc => acc.getAddress()),
|
|
99
102
|
tokenAdmin.getAddress(),
|
|
100
103
|
mintAmount,
|
|
101
104
|
new SponsoredFeePaymentMethod(await getSponsoredFPCAddress()),
|
|
102
105
|
logger,
|
|
103
106
|
);
|
|
104
|
-
const
|
|
107
|
+
const tokenContract = await TokenContract.at(tokenAddress, wallet);
|
|
105
108
|
|
|
106
109
|
return {
|
|
107
110
|
pxe,
|
|
108
|
-
|
|
111
|
+
wallet,
|
|
112
|
+
accounts: fundedAccounts.map(acc => acc.getAddress()),
|
|
109
113
|
tokenAdminAddress: tokenAdmin.getAddress(),
|
|
110
|
-
tokenAdminWallet,
|
|
111
114
|
tokenName: TOKEN_NAME,
|
|
112
115
|
tokenAddress,
|
|
113
|
-
|
|
114
|
-
recipientAddress:
|
|
116
|
+
tokenContract,
|
|
117
|
+
recipientAddress: recipientAccount.getAddress(),
|
|
115
118
|
};
|
|
116
119
|
}
|
|
117
120
|
|
|
118
|
-
export async function
|
|
121
|
+
export async function deployTestAccountsWithTokens(
|
|
119
122
|
pxeUrl: string,
|
|
120
123
|
nodeUrl: string,
|
|
121
124
|
l1RpcUrls: string[],
|
|
@@ -123,18 +126,14 @@ export async function deployTestWalletWithTokens(
|
|
|
123
126
|
mintAmount: bigint,
|
|
124
127
|
logger: Logger,
|
|
125
128
|
numberOfFundedWallets = 1,
|
|
126
|
-
): Promise<
|
|
129
|
+
): Promise<TestAccounts> {
|
|
127
130
|
const pxe = await createCompatibleClient(pxeUrl, logger);
|
|
128
131
|
const node = createAztecNodeClient(nodeUrl);
|
|
132
|
+
const wallet = new TestWallet(pxe);
|
|
129
133
|
|
|
130
134
|
const [recipient, ...funded] = await generateSchnorrAccounts(numberOfFundedWallets + 1);
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
recipient.secret,
|
|
134
|
-
recipient.signingKey,
|
|
135
|
-
recipient.salt,
|
|
136
|
-
);
|
|
137
|
-
const fundedAccounts = await Promise.all(funded.map(a => getSchnorrAccount(pxe, a.secret, a.signingKey, a.salt)));
|
|
135
|
+
const recipientAccount = await wallet.createSchnorrAccount(recipient.secret, recipient.salt);
|
|
136
|
+
const fundedAccounts = await Promise.all(funded.map(a => wallet.createSchnorrAccount(a.secret, a.salt)));
|
|
138
137
|
|
|
139
138
|
const claims = await Promise.all(
|
|
140
139
|
fundedAccounts.map(a => bridgeL1FeeJuice(l1RpcUrls, mnemonicOrPrivateKey, pxe, a.getAddress(), undefined, logger)),
|
|
@@ -145,29 +144,34 @@ export async function deployTestWalletWithTokens(
|
|
|
145
144
|
await advanceL2Block(node);
|
|
146
145
|
await advanceL2Block(node);
|
|
147
146
|
|
|
148
|
-
|
|
147
|
+
await Promise.all(
|
|
149
148
|
fundedAccounts.map(async (a, i) => {
|
|
150
|
-
const
|
|
151
|
-
const paymentMethod = new FeeJuicePaymentMethodWithClaim(wallet, claims[i]);
|
|
149
|
+
const paymentMethod = new FeeJuicePaymentMethodWithClaim(a.getAddress(), claims[i]);
|
|
152
150
|
await a.deploy({ fee: { paymentMethod } }).wait();
|
|
153
151
|
logger.info(`Account deployed at ${a.getAddress()}`);
|
|
154
|
-
return wallet;
|
|
155
152
|
}),
|
|
156
153
|
);
|
|
157
154
|
|
|
158
|
-
const tokenAdmin =
|
|
159
|
-
const tokenAddress = await deployTokenAndMint(
|
|
160
|
-
|
|
155
|
+
const tokenAdmin = fundedAccounts[0];
|
|
156
|
+
const tokenAddress = await deployTokenAndMint(
|
|
157
|
+
wallet,
|
|
158
|
+
fundedAccounts.map(acc => acc.getAddress()),
|
|
159
|
+
tokenAdmin.getAddress(),
|
|
160
|
+
mintAmount,
|
|
161
|
+
undefined,
|
|
162
|
+
logger,
|
|
163
|
+
);
|
|
164
|
+
const tokenContract = await TokenContract.at(tokenAddress, wallet);
|
|
161
165
|
|
|
162
166
|
return {
|
|
163
167
|
pxe,
|
|
164
|
-
|
|
168
|
+
wallet,
|
|
169
|
+
accounts: fundedAccounts.map(acc => acc.getAddress()),
|
|
165
170
|
tokenAdminAddress: tokenAdmin.getAddress(),
|
|
166
|
-
tokenAdminWallet,
|
|
167
171
|
tokenName: TOKEN_NAME,
|
|
168
172
|
tokenAddress,
|
|
169
|
-
|
|
170
|
-
recipientAddress:
|
|
173
|
+
tokenContract,
|
|
174
|
+
recipientAddress: recipientAccount.getAddress(),
|
|
171
175
|
};
|
|
172
176
|
}
|
|
173
177
|
|
|
@@ -212,14 +216,15 @@ async function advanceL2Block(node: AztecNode, nodeAdmin?: AztecNodeAdmin) {
|
|
|
212
216
|
}
|
|
213
217
|
|
|
214
218
|
async function deployTokenAndMint(
|
|
215
|
-
|
|
219
|
+
wallet: Wallet,
|
|
220
|
+
accounts: AztecAddress[],
|
|
216
221
|
admin: AztecAddress,
|
|
217
222
|
mintAmount: bigint,
|
|
218
223
|
paymentMethod: FeePaymentMethod | undefined,
|
|
219
224
|
logger: Logger,
|
|
220
225
|
) {
|
|
221
226
|
logger.verbose(`Deploying TokenContract...`);
|
|
222
|
-
const tokenContract = await TokenContract.deploy(
|
|
227
|
+
const tokenContract = await TokenContract.deploy(wallet, admin, TOKEN_NAME, TOKEN_SYMBOL, TOKEN_DECIMALS)
|
|
223
228
|
.send({
|
|
224
229
|
from: admin,
|
|
225
230
|
fee: {
|
|
@@ -230,12 +235,12 @@ async function deployTokenAndMint(
|
|
|
230
235
|
|
|
231
236
|
const tokenAddress = tokenContract.address;
|
|
232
237
|
|
|
233
|
-
logger.verbose(`Minting ${mintAmount} public assets to the ${
|
|
238
|
+
logger.verbose(`Minting ${mintAmount} public assets to the ${accounts.length} accounts...`);
|
|
234
239
|
|
|
235
240
|
await Promise.all(
|
|
236
|
-
|
|
237
|
-
(await TokenContract.at(tokenAddress,
|
|
238
|
-
.mint_to_public(
|
|
241
|
+
accounts.map(async acc =>
|
|
242
|
+
(await TokenContract.at(tokenAddress, wallet)).methods
|
|
243
|
+
.mint_to_public(acc, mintAmount)
|
|
239
244
|
.send({ from: admin, fee: { paymentMethod } })
|
|
240
245
|
.wait({ timeout: 600 }),
|
|
241
246
|
),
|
|
@@ -247,22 +252,26 @@ async function deployTokenAndMint(
|
|
|
247
252
|
}
|
|
248
253
|
|
|
249
254
|
export async function performTransfers({
|
|
250
|
-
|
|
255
|
+
testAccounts,
|
|
251
256
|
rounds,
|
|
252
257
|
transferAmount,
|
|
253
258
|
logger,
|
|
259
|
+
feePaymentMethod,
|
|
254
260
|
}: {
|
|
255
|
-
|
|
261
|
+
testAccounts: TestAccounts;
|
|
256
262
|
rounds: number;
|
|
257
263
|
transferAmount: bigint;
|
|
258
264
|
logger: Logger;
|
|
265
|
+
feePaymentMethod?: FeePaymentMethod;
|
|
259
266
|
}) {
|
|
260
|
-
const recipient =
|
|
267
|
+
const recipient = testAccounts.recipientAddress;
|
|
268
|
+
// Default to sponsored fee payment if no fee method is provided
|
|
269
|
+
const defaultFeePaymentMethod = feePaymentMethod || new SponsoredFeePaymentMethod(await getSponsoredFPCAddress());
|
|
261
270
|
for (let i = 0; i < rounds; i++) {
|
|
262
|
-
const txs =
|
|
263
|
-
(await TokenContract.at(
|
|
264
|
-
.transfer_in_public(
|
|
265
|
-
.prove({ from:
|
|
271
|
+
const txs = testAccounts.accounts.map(async acc =>
|
|
272
|
+
(await TokenContract.at(testAccounts.tokenAddress, testAccounts.wallet)).methods
|
|
273
|
+
.transfer_in_public(acc, recipient, transferAmount, 0)
|
|
274
|
+
.prove({ from: acc, fee: { paymentMethod: defaultFeePaymentMethod } }),
|
|
266
275
|
);
|
|
267
276
|
|
|
268
277
|
const provenTxs = await Promise.all(txs);
|