@aztec/end-to-end 3.0.0-nightly.20250918 → 3.0.0-nightly.20250919
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.js +1 -1
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +1 -1
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +1 -1
- package/dest/e2e_fees/fees_test.js +2 -2
- package/dest/e2e_nested_contract/nested_contract_test.d.ts +2 -1
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +3 -1
- package/dest/e2e_token_contract/token_contract_test.d.ts +3 -2
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.d.ts +3 -3
- package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.js +7 -7
- package/dest/fixtures/utils.js +3 -3
- package/dest/shared/uniswap_l1_l2.d.ts +3 -2
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +6 -17
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +3 -3
- package/package.json +37 -37
- package/src/bench/client_flows/client_flows_benchmark.ts +1 -1
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +1 -1
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +1 -1
- package/src/e2e_fees/fees_test.ts +2 -2
- package/src/e2e_nested_contract/nested_contract_test.ts +4 -2
- package/src/e2e_token_contract/token_contract_test.ts +3 -2
- package/src/fixtures/snapshot_manager.ts +7 -8
- package/src/fixtures/utils.ts +3 -3
- package/src/shared/uniswap_l1_l2.ts +16 -14
- package/src/spartan/setup_test_wallets.ts +5 -2
|
@@ -154,7 +154,7 @@ export class ClientFlowsBenchmark {
|
|
|
154
154
|
this.pxe = pxe;
|
|
155
155
|
this.adminWallet = wallet;
|
|
156
156
|
this.aztecNode = aztecNode;
|
|
157
|
-
this.cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, pxe);
|
|
157
|
+
this.cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, pxe, aztecNode);
|
|
158
158
|
this.adminAddress = adminAddress;
|
|
159
159
|
this.sequencerAddress = sequencerAddress;
|
|
160
160
|
const canonicalFeeJuice = await getCanonicalFeeJuice();
|
|
@@ -120,7 +120,7 @@ export class BlacklistTokenContractTest {
|
|
|
120
120
|
await this.snapshotManager.teardown();
|
|
121
121
|
}
|
|
122
122
|
async addPendingShieldNoteToPXE(contract, recipient, amount, secretHash, txHash) {
|
|
123
|
-
const txEffects = await this.
|
|
123
|
+
const txEffects = await this.aztecNode.getTxEffect(txHash);
|
|
124
124
|
await contract.methods.deliver_transparent_note(contract.address, amount, secretHash, txHash.hash, txEffects.data.noteHashes, txEffects.data.nullifiers[0], recipient).simulate({
|
|
125
125
|
from: recipient
|
|
126
126
|
});
|
|
@@ -45,7 +45,7 @@ export class CrossChainMessagingTest {
|
|
|
45
45
|
this.aztecNode = this.ctx.aztecNode;
|
|
46
46
|
this.pxe = this.ctx.pxe;
|
|
47
47
|
this.aztecNodeConfig = this.ctx.aztecNodeConfig;
|
|
48
|
-
this.cheatCodes = await CheatCodes.create(this.aztecNodeConfig.l1RpcUrls, this.pxe);
|
|
48
|
+
this.cheatCodes = await CheatCodes.create(this.aztecNodeConfig.l1RpcUrls, this.pxe, this.aztecNode);
|
|
49
49
|
this.deployL1ContractsValues = this.ctx.deployL1ContractsValues;
|
|
50
50
|
this.aztecNodeAdmin = this.ctx.aztecNode;
|
|
51
51
|
}
|
|
@@ -143,7 +143,7 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
143
143
|
this.gasSettings = GasSettings.default({
|
|
144
144
|
maxFeesPerGas: (await this.aztecNode.getCurrentBaseFees()).mul(2)
|
|
145
145
|
});
|
|
146
|
-
this.cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, pxe);
|
|
146
|
+
this.cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, pxe, aztecNode);
|
|
147
147
|
this.accounts = deployedAccounts.map((a)=>a.address);
|
|
148
148
|
this.accounts.forEach((a, i)=>this.logger.verbose(`Account ${i} address: ${a}`));
|
|
149
149
|
[this.aliceAddress, this.bobAddress, this.sequencerAddress] = this.accounts.slice(0, 3);
|
|
@@ -230,7 +230,7 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
230
230
|
return await this.rollupContract.getSequencerRewards(this.coinbase);
|
|
231
231
|
};
|
|
232
232
|
this.getProverFee = async (blockNumber)=>{
|
|
233
|
-
const block = await this.
|
|
233
|
+
const block = await this.aztecNode.getBlock(blockNumber);
|
|
234
234
|
// @todo @lherskind As we deal with #13601
|
|
235
235
|
// Right now the value is from `FeeLib.sol`
|
|
236
236
|
const L1_GAS_PER_EPOCH_VERIFIED = 1000000n;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AztecAddress, type Logger, type PXE, type Wallet } from '@aztec/aztec.js';
|
|
1
|
+
import { AztecAddress, type AztecNode, type Logger, type PXE, type Wallet } from '@aztec/aztec.js';
|
|
2
2
|
import { ChildContract } from '@aztec/noir-test-contracts.js/Child';
|
|
3
3
|
import { ParentContract } from '@aztec/noir-test-contracts.js/Parent';
|
|
4
4
|
import { type SubsystemsContext } from '../fixtures/snapshot_manager.js';
|
|
@@ -9,6 +9,7 @@ export declare class NestedContractTest {
|
|
|
9
9
|
wallet: Wallet;
|
|
10
10
|
defaultAccountAddress: AztecAddress;
|
|
11
11
|
pxe: PXE;
|
|
12
|
+
aztecNode: AztecNode;
|
|
12
13
|
parentContract: ParentContract;
|
|
13
14
|
childContract: ChildContract;
|
|
14
15
|
constructor(testName: string, numberOfAccounts?: number);
|
|
@@ -1 +1 @@
|
|
|
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,KAAK,MAAM,EAAE,KAAK,GAAG,EAAE,KAAK,MAAM,EAAgB,MAAM,iBAAiB,CAAC;
|
|
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,KAAK,SAAS,EAAE,KAAK,MAAM,EAAE,KAAK,GAAG,EAAE,KAAK,MAAM,EAAgB,MAAM,iBAAiB,CAAC;AACjH,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;IAa3B,OAAO,CAAC,gBAAgB;IAZ1B,OAAO,CAAC,eAAe,CAAmB;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAG,MAAM,CAAC;IAChB,qBAAqB,EAAG,YAAY,CAAC;IACrC,GAAG,EAAG,GAAG,CAAC;IACV,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;IAuBlB,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"}
|
|
@@ -10,6 +10,7 @@ export class NestedContractTest {
|
|
|
10
10
|
wallet;
|
|
11
11
|
defaultAccountAddress;
|
|
12
12
|
pxe;
|
|
13
|
+
aztecNode;
|
|
13
14
|
parentContract;
|
|
14
15
|
childContract;
|
|
15
16
|
constructor(testName, numberOfAccounts = 1){
|
|
@@ -23,10 +24,11 @@ export class NestedContractTest {
|
|
|
23
24
|
* 1. Add 3 accounts.
|
|
24
25
|
* 2. Publicly deploy accounts
|
|
25
26
|
*/ async applyBaseSnapshots() {
|
|
26
|
-
await this.snapshotManager.snapshot('accounts', deployAccounts(this.numberOfAccounts, this.logger), ({ deployedAccounts }, { pxe, wallet })=>{
|
|
27
|
+
await this.snapshotManager.snapshot('accounts', deployAccounts(this.numberOfAccounts, this.logger), ({ deployedAccounts }, { pxe, wallet, aztecNode })=>{
|
|
27
28
|
this.wallet = wallet;
|
|
28
29
|
[{ address: this.defaultAccountAddress }] = deployedAccounts;
|
|
29
30
|
this.pxe = pxe;
|
|
31
|
+
this.aztecNode = aztecNode;
|
|
30
32
|
return Promise.resolve();
|
|
31
33
|
});
|
|
32
34
|
await this.snapshotManager.snapshot('public_deploy', async ()=>{}, async ()=>{
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { AztecAddress, type AztecNode, type Logger
|
|
1
|
+
import { AztecAddress, type AztecNode, type Logger } from '@aztec/aztec.js';
|
|
2
2
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
3
3
|
import { InvalidAccountContract } from '@aztec/noir-test-contracts.js/InvalidAccount';
|
|
4
|
+
import type { TestWallet } from '@aztec/test-wallet';
|
|
4
5
|
import { type SubsystemsContext } from '../fixtures/snapshot_manager.js';
|
|
5
6
|
import { TokenSimulator } from '../simulators/token_simulator.js';
|
|
6
7
|
export declare class TokenContractTest {
|
|
@@ -13,7 +14,7 @@ export declare class TokenContractTest {
|
|
|
13
14
|
tokenSim: TokenSimulator;
|
|
14
15
|
node: AztecNode;
|
|
15
16
|
badAccount: InvalidAccountContract;
|
|
16
|
-
wallet:
|
|
17
|
+
wallet: TestWallet;
|
|
17
18
|
adminAddress: AztecAddress;
|
|
18
19
|
account1Address: AztecAddress;
|
|
19
20
|
account2Address: AztecAddress;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token_contract_test.d.ts","sourceRoot":"","sources":["../../src/e2e_token_contract/token_contract_test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,SAAS,EAAE,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"token_contract_test.d.ts","sourceRoot":"","sources":["../../src/e2e_token_contract/token_contract_test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,SAAS,EAAE,KAAK,MAAM,EAAgB,MAAM,iBAAiB,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,8CAA8C,CAAC;AACtF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAIrD,OAAO,EAEL,KAAK,iBAAiB,EAIvB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAIlE,qBAAa,iBAAiB;IAC5B,MAAM,CAAC,UAAU,SAAU;IAC3B,MAAM,CAAC,YAAY,SAAS;IAC5B,MAAM,CAAC,cAAc,SAAO;IAC5B,OAAO,CAAC,eAAe,CAAmB;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAG,aAAa,CAAC;IACtB,QAAQ,EAAG,cAAc,CAAC;IAC1B,IAAI,EAAG,SAAS,CAAC;IAEjB,UAAU,EAAG,sBAAsB,CAAC;IACpC,MAAM,EAAG,UAAU,CAAC;IACpB,YAAY,EAAG,YAAY,CAAC;IAC5B,eAAe,EAAG,YAAY,CAAC;IAC/B,eAAe,EAAG,YAAY,CAAC;gBAEnB,QAAQ,EAAE,MAAM;IAO5B;;;;OAIG;IACG,kBAAkB;IAkElB,KAAK;IAIX,QAAQ,GAAI,CAAC,EACX,MAAM,MAAM,EACZ,OAAO,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,CAAC,CAAC,EACjD,UAAS,CAAC,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAA2B,KAChG,OAAO,CAAC,IAAI,CAAC,CAAwD;IAElE,QAAQ;IAIR,iBAAiB;CAqCxB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type InitialAccountData } from '@aztec/accounts/testing';
|
|
2
2
|
import { type AztecNodeConfig, AztecNodeService } from '@aztec/aztec-node';
|
|
3
|
-
import { type AztecAddress, type AztecNode, type Logger, type
|
|
3
|
+
import { type AztecAddress, type AztecNode, type Logger, type Wallet } from '@aztec/aztec.js';
|
|
4
4
|
import { AnvilTestWatcher, CheatCodes } from '@aztec/aztec/testing';
|
|
5
5
|
import { type BlobSinkServer } from '@aztec/blob-sink/server';
|
|
6
6
|
import { type DeployL1ContractsArgs, type DeployL1ContractsReturnType } from '@aztec/ethereum';
|
|
@@ -87,8 +87,8 @@ export declare const deployAccounts: (numberOfAccounts: number, logger: Logger)
|
|
|
87
87
|
* @param sender - Wallet to send the deployment tx.
|
|
88
88
|
* @param accountsToDeploy - Which accounts to publicly deploy.
|
|
89
89
|
* @param waitUntilProven - Whether to wait for the tx to be proven.
|
|
90
|
-
* @param
|
|
90
|
+
* @param node - AztecNode used to wait for proven tx.
|
|
91
91
|
*/
|
|
92
|
-
export declare function publicDeployAccounts(wallet: Wallet, accountsToDeploy: AztecAddress[], waitUntilProven?: boolean,
|
|
92
|
+
export declare function publicDeployAccounts(wallet: Wallet, accountsToDeploy: AztecAddress[], waitUntilProven?: boolean, node?: AztecNode): Promise<void>;
|
|
93
93
|
export {};
|
|
94
94
|
//# sourceMappingURL=snapshot_manager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapshot_manager.d.ts","sourceRoot":"","sources":["../../src/fixtures/snapshot_manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,kBAAkB,EAA2B,MAAM,yBAAyB,CAAC;AAC3F,OAAO,EAAE,KAAK,eAAe,EAAE,gBAAgB,EAAoB,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,SAAS,EAId,KAAK,MAAM,EACX,KAAK,
|
|
1
|
+
{"version":3,"file":"snapshot_manager.d.ts","sourceRoot":"","sources":["../../src/fixtures/snapshot_manager.ts"],"names":[],"mappings":"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"}
|
|
@@ -332,7 +332,7 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
332
332
|
pxeConfig.proverEnabled = !!opts.realProofs;
|
|
333
333
|
const pxe = await createPXEService(aztecNode, pxeConfig);
|
|
334
334
|
const wallet = new TestWallet(pxe);
|
|
335
|
-
const cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, pxe);
|
|
335
|
+
const cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, pxe, aztecNode);
|
|
336
336
|
if (statePath) {
|
|
337
337
|
writeFileSync(`${statePath}/aztec_node_config.json`, JSON.stringify(aztecNodeConfig, resolver));
|
|
338
338
|
writeFileSync(`${statePath}/accounts.json`, JSON.stringify(initialFundedAccounts, resolver));
|
|
@@ -431,7 +431,7 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
431
431
|
pxeConfig.dataDirectory = statePath;
|
|
432
432
|
const pxe = await createPXEService(aztecNode, pxeConfig);
|
|
433
433
|
const wallet = new TestWallet(pxe);
|
|
434
|
-
const cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, pxe);
|
|
434
|
+
const cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, pxe, aztecNode);
|
|
435
435
|
return {
|
|
436
436
|
aztecNodeConfig,
|
|
437
437
|
anvil,
|
|
@@ -481,8 +481,8 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
481
481
|
* @param sender - Wallet to send the deployment tx.
|
|
482
482
|
* @param accountsToDeploy - Which accounts to publicly deploy.
|
|
483
483
|
* @param waitUntilProven - Whether to wait for the tx to be proven.
|
|
484
|
-
* @param
|
|
485
|
-
*/ export async function publicDeployAccounts(wallet, accountsToDeploy, waitUntilProven = false,
|
|
484
|
+
* @param node - AztecNode used to wait for proven tx.
|
|
485
|
+
*/ export async function publicDeployAccounts(wallet, accountsToDeploy, waitUntilProven = false, node) {
|
|
486
486
|
const instances = (await Promise.all(accountsToDeploy.map((account)=>wallet.getContractMetadata(account)))).map((metadata)=>metadata.contractInstance);
|
|
487
487
|
const contractClass = await getContractClassFromArtifact(SchnorrAccountContractArtifact);
|
|
488
488
|
const alreadyRegistered = (await wallet.getContractClassMetadata(contractClass.id)).isContractClassPubliclyRegistered;
|
|
@@ -497,10 +497,10 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
497
497
|
from: accountsToDeploy[0]
|
|
498
498
|
}).wait();
|
|
499
499
|
if (waitUntilProven) {
|
|
500
|
-
if (!
|
|
501
|
-
throw new Error('Need to provide
|
|
500
|
+
if (!node) {
|
|
501
|
+
throw new Error('Need to provide an AztecNode to wait for proven.');
|
|
502
502
|
} else {
|
|
503
|
-
await waitForProven(
|
|
503
|
+
await waitForProven(node, txReceipt);
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
506
|
}
|
package/dest/fixtures/utils.js
CHANGED
|
@@ -145,7 +145,7 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
145
145
|
rollupVersion
|
|
146
146
|
};
|
|
147
147
|
const ethCheatCodes = new EthCheatCodes(config.l1RpcUrls);
|
|
148
|
-
const cheatCodes = await CheatCodes.create(config.l1RpcUrls, pxeClient);
|
|
148
|
+
const cheatCodes = await CheatCodes.create(config.l1RpcUrls, pxeClient, aztecNode);
|
|
149
149
|
const teardown = ()=>Promise.resolve();
|
|
150
150
|
logger.verbose('Populating wallet from already registered accounts...');
|
|
151
151
|
const initialFundedAccounts = await getDeployedTestAccounts(pxeClient);
|
|
@@ -410,7 +410,7 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
410
410
|
}
|
|
411
411
|
logger.verbose('Creating a pxe...');
|
|
412
412
|
const { pxe, teardown: pxeTeardown } = await setupPXEService(aztecNode, pxeOpts, logger);
|
|
413
|
-
const cheatCodes = await CheatCodes.create(config.l1RpcUrls, pxe);
|
|
413
|
+
const cheatCodes = await CheatCodes.create(config.l1RpcUrls, pxe, aztecNode);
|
|
414
414
|
if (opts.aztecTargetCommitteeSize && opts.aztecTargetCommitteeSize > 0 || opts.initialValidators && opts.initialValidators.length > 0) {
|
|
415
415
|
// We need to advance such that the committee is set up.
|
|
416
416
|
await cheatCodes.rollup.advanceToEpoch(await cheatCodes.rollup.getEpoch() + BigInt(config.lagInEpochs + 1), {
|
|
@@ -424,7 +424,7 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
424
424
|
// Below we continue with what we described in the long comment on line 571.
|
|
425
425
|
if (numberOfAccounts === 0) {
|
|
426
426
|
logger.info('No accounts are being deployed, waiting for an empty block 1 to be mined');
|
|
427
|
-
while(await
|
|
427
|
+
while(await aztecNode.getBlockNumber() === 0){
|
|
428
428
|
await sleep(2000);
|
|
429
429
|
}
|
|
430
430
|
} else {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { AztecAddress, type AztecNode, type Logger, type PXE
|
|
1
|
+
import { AztecAddress, type AztecNode, type Logger, type PXE } from '@aztec/aztec.js';
|
|
2
2
|
import { CheatCodes } from '@aztec/aztec/testing';
|
|
3
3
|
import { type DeployL1ContractsReturnType, type ExtendedViemWalletClient } from '@aztec/ethereum';
|
|
4
|
+
import type { TestWallet } from '@aztec/test-wallet';
|
|
4
5
|
/** Objects to be returned by the uniswap setup function */
|
|
5
6
|
export type UniswapSetupContext = {
|
|
6
7
|
/** Aztec Node instance */
|
|
@@ -12,7 +13,7 @@ export type UniswapSetupContext = {
|
|
|
12
13
|
/** The L1 wallet client, extended with public actions. */
|
|
13
14
|
l1Client: ExtendedViemWalletClient;
|
|
14
15
|
/** The wallet. */
|
|
15
|
-
wallet:
|
|
16
|
+
wallet: TestWallet;
|
|
16
17
|
/** The owner address. */
|
|
17
18
|
ownerAddress: AztecAddress;
|
|
18
19
|
/** The sponsor wallet. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uniswap_l1_l2.d.ts","sourceRoot":"","sources":["../../src/shared/uniswap_l1_l2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,KAAK,SAAS,EAGd,KAAK,MAAM,EACX,KAAK,GAAG,
|
|
1
|
+
{"version":3,"file":"uniswap_l1_l2.d.ts","sourceRoot":"","sources":["../../src/shared/uniswap_l1_l2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,KAAK,SAAS,EAGd,KAAK,MAAM,EACX,KAAK,GAAG,EAGT,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EACL,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAI9B,MAAM,iBAAiB,CAAC;AAMzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAkBrD,2DAA2D;AAC3D,MAAM,MAAM,mBAAmB,GAAG;IAChC,0BAA0B;IAC1B,SAAS,EAAE,SAAS,CAAC;IACrB,+CAA+C;IAC/C,GAAG,EAAE,GAAG,CAAC;IACT,iDAAiD;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,0DAA0D;IAC1D,QAAQ,EAAE,wBAAwB,CAAC;IACnC,kBAAkB;IAClB,MAAM,EAAE,UAAU,CAAC;IACnB,yBAAyB;IACzB,YAAY,EAAE,YAAY,CAAC;IAC3B,0BAA0B;IAC1B,cAAc,EAAE,YAAY,CAAC;IAC7B,OAAO;IACP,uBAAuB,EAAE,2BAA2B,CAAC;IACrD,4BAA4B;IAC5B,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAGF,eAAO,MAAM,oBAAoB,GAC/B,OAAO,MAAM,OAAO,CAAC,mBAAmB,CAAC,EACzC,SAAS,MAAM,OAAO,CAAC,IAAI,CAAC,EAC5B,gCAAkC,SAo+BnC,CAAC"}
|
|
@@ -439,11 +439,8 @@ export const uniswapL1L2TestSuite = (setup, cleanup, expectedForkBlockNumber = 1
|
|
|
439
439
|
const nonceForWETHTransferToPublicApproval = new Fr(2n);
|
|
440
440
|
const expectedMessageHash = await computeAuthWitMessageHash({
|
|
441
441
|
caller: uniswapL2Contract.address,
|
|
442
|
-
|
|
443
|
-
},
|
|
444
|
-
chainId: new Fr(await aztecNode.getChainId()),
|
|
445
|
-
version: new Fr(await aztecNode.getVersion())
|
|
446
|
-
});
|
|
442
|
+
call: await wethCrossChainHarness.l2Token.methods.transfer_to_public(ownerAddress, uniswapL2Contract.address, wethAmountToBridge, nonceForWETHTransferToPublicApproval).getFunctionCall()
|
|
443
|
+
}, await wallet.getChainInfo());
|
|
447
444
|
await expect(uniswapL2Contract.methods.swap_private(wethCrossChainHarness.l2Token.address, wethCrossChainHarness.l2Bridge.address, wethAmountToBridge, daiCrossChainHarness.l2Bridge.address, nonceForWETHTransferToPublicApproval, uniswapFeeTier, minimumOutputAmount, Fr.random(), ownerEthAddress).simulate({
|
|
448
445
|
from: ownerAddress
|
|
449
446
|
})).rejects.toThrow(`Unknown auth witness for message hash ${expectedMessageHash.toString()}`);
|
|
@@ -478,9 +475,7 @@ export const uniswapL1L2TestSuite = (setup, cleanup, expectedForkBlockNumber = 1
|
|
|
478
475
|
caller: uniswapL2Contract.address,
|
|
479
476
|
action: wethCrossChainHarness.l2Token.methods.transfer_in_public(ownerAddress, uniswapL2Contract.address, wethAmountToBridge, nonceForWETHTransferApproval)
|
|
480
477
|
}, true);
|
|
481
|
-
await validateActionInteraction.send(
|
|
482
|
-
from: ownerAddress
|
|
483
|
-
}).wait();
|
|
478
|
+
await validateActionInteraction.send().wait();
|
|
484
479
|
// No approval to call `swap` but should work even without it:
|
|
485
480
|
const [_, secretHashForDepositingSwappedDai] = await generateClaimSecret();
|
|
486
481
|
await uniswapL2Contract.methods.swap_public(ownerAddress, wethCrossChainHarness.l2Bridge.address, wethAmountToBridge, daiCrossChainHarness.l2Bridge.address, nonceForWETHTransferApproval, uniswapFeeTier, minimumOutputAmount, ownerAddress, secretHashForDepositingSwappedDai, ownerEthAddress, Fr.ZERO).send({
|
|
@@ -500,9 +495,7 @@ export const uniswapL1L2TestSuite = (setup, cleanup, expectedForkBlockNumber = 1
|
|
|
500
495
|
caller: approvedUser,
|
|
501
496
|
action
|
|
502
497
|
}, true);
|
|
503
|
-
await validateActionInteraction.send(
|
|
504
|
-
from: ownerAddress
|
|
505
|
-
}).wait();
|
|
498
|
+
await validateActionInteraction.send().wait();
|
|
506
499
|
await expect(action.simulate({
|
|
507
500
|
from: sponsorAddress
|
|
508
501
|
})).rejects.toThrow(/unauthorized/);
|
|
@@ -514,9 +507,7 @@ export const uniswapL1L2TestSuite = (setup, cleanup, expectedForkBlockNumber = 1
|
|
|
514
507
|
caller: uniswapL2Contract.address,
|
|
515
508
|
action: wethCrossChainHarness.l2Token.methods.transfer_in_public(ownerAddress, uniswapL2Contract.address, wethAmountToBridge, nonceForWETHTransferApproval)
|
|
516
509
|
}, true);
|
|
517
|
-
await validateActionInteraction.send(
|
|
518
|
-
from: ownerAddress
|
|
519
|
-
}).wait();
|
|
510
|
+
await validateActionInteraction.send().wait();
|
|
520
511
|
await expect(uniswapL2Contract.methods.swap_public(ownerAddress, wethCrossChainHarness.l2Bridge.address, wethAmountToBridge, daiCrossChainHarness.l2Bridge.address, new Fr(420), uniswapFeeTier, minimumOutputAmount, ownerAddress, Fr.random(), ownerEthAddress, Fr.ZERO).simulate({
|
|
521
512
|
from: ownerAddress
|
|
522
513
|
})).rejects.toThrow(/unauthorized/);
|
|
@@ -622,9 +613,7 @@ export const uniswapL1L2TestSuite = (setup, cleanup, expectedForkBlockNumber = 1
|
|
|
622
613
|
caller: uniswapL2Contract.address,
|
|
623
614
|
action: wethCrossChainHarness.l2Token.methods.transfer_in_public(ownerAddress, uniswapL2Contract.address, wethAmountToBridge, nonceForWETHTransferApproval)
|
|
624
615
|
}, true);
|
|
625
|
-
await validateActionInteraction.send(
|
|
626
|
-
from: ownerAddress
|
|
627
|
-
}).wait();
|
|
616
|
+
await validateActionInteraction.send().wait();
|
|
628
617
|
// Call swap_public on L2
|
|
629
618
|
const secretHashForDepositingSwappedDai = Fr.random();
|
|
630
619
|
const withdrawReceipt = await uniswapL2Contract.methods.swap_public(ownerAddress, wethCrossChainHarness.l2Bridge.address, wethAmountToBridge, daiCrossChainHarness.l2Bridge.address, nonceForWETHTransferApproval, uniswapFeeTier, minimumOutputAmount, ownerAddress, secretHashForDepositingSwappedDai, ownerEthAddress, Fr.ZERO).send({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup_test_wallets.d.ts","sourceRoot":"","sources":["../../src/spartan/setup_test_wallets.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,YAAY,EAGjB,KAAK,gBAAgB,EAGrB,KAAK,GAAG,EAMT,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAG/D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAMhD,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,GAAG,CAAC;IACT,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,aAAa,EAAE,aAAa,CAAC;IAC7B,iBAAiB,EAAE,YAAY,CAAC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,YAAY,CAAC;IAC/B,YAAY,EAAE,YAAY,CAAC;CAC5B;AAMD,wBAAsB,2BAA2B,CAC/C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,YAAY,CAAC,CA6BvB;AAED,wBAAsB,2BAA2B,CAC/C,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,qBAAqB,SAAI,GACxB,OAAO,CAAC,YAAY,CAAC,CAqCvB;AAED,wBAAsB,4BAA4B,CAChD,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EAAE,EACnB,oBAAoB,EAAE,MAAM,EAC5B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,qBAAqB,SAAI,GACxB,OAAO,CAAC,YAAY,CAAC,
|
|
1
|
+
{"version":3,"file":"setup_test_wallets.d.ts","sourceRoot":"","sources":["../../src/spartan/setup_test_wallets.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,YAAY,EAGjB,KAAK,gBAAgB,EAGrB,KAAK,GAAG,EAMT,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAG/D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAMhD,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,GAAG,CAAC;IACT,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,aAAa,EAAE,aAAa,CAAC;IAC7B,iBAAiB,EAAE,YAAY,CAAC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,YAAY,CAAC;IAC/B,YAAY,EAAE,YAAY,CAAC;CAC5B;AAMD,wBAAsB,2BAA2B,CAC/C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,YAAY,CAAC,CA6BvB;AAED,wBAAsB,2BAA2B,CAC/C,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,qBAAqB,SAAI,GACxB,OAAO,CAAC,YAAY,CAAC,CAqCvB;AAED,wBAAsB,4BAA4B,CAChD,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EAAE,EACnB,oBAAoB,EAAE,MAAM,EAC5B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,qBAAqB,SAAI,GACxB,OAAO,CAAC,YAAY,CAAC,CAiDvB;AA+ED,wBAAsB,gBAAgB,CAAC,EACrC,YAAY,EACZ,MAAM,EACN,cAAc,EACd,MAAM,EACN,gBAAgB,GACjB,EAAE;IACD,YAAY,EAAE,YAAY,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACrC,iBAiBA;AAED,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,OAAO,EACtB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC;IAAE,GAAG,EAAE,GAAG,CAAC;IAAC,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CAAC,CAmBrD"}
|
|
@@ -67,7 +67,7 @@ export async function deployTestAccountsWithTokens(pxeUrl, nodeUrl, l1RpcUrls, m
|
|
|
67
67
|
const [recipient, ...funded] = await generateSchnorrAccounts(numberOfFundedWallets + 1);
|
|
68
68
|
const recipientAccount = await wallet.createSchnorrAccount(recipient.secret, recipient.salt);
|
|
69
69
|
const fundedAccounts = await Promise.all(funded.map((a)=>wallet.createSchnorrAccount(a.secret, a.salt)));
|
|
70
|
-
const claims = await Promise.all(fundedAccounts.map((a)=>bridgeL1FeeJuice(l1RpcUrls, mnemonicOrPrivateKey, pxe, a.getAddress(), undefined, logger)));
|
|
70
|
+
const claims = await Promise.all(fundedAccounts.map((a)=>bridgeL1FeeJuice(l1RpcUrls, mnemonicOrPrivateKey, pxe, node, a.getAddress(), undefined, logger)));
|
|
71
71
|
// Progress by 3 L2 blocks so that the l1ToL2Message added above will be available to use on L2.
|
|
72
72
|
await advanceL2Block(node);
|
|
73
73
|
await advanceL2Block(node);
|
|
@@ -95,7 +95,7 @@ export async function deployTestAccountsWithTokens(pxeUrl, nodeUrl, l1RpcUrls, m
|
|
|
95
95
|
recipientAddress: recipientAccount.getAddress()
|
|
96
96
|
};
|
|
97
97
|
}
|
|
98
|
-
async function bridgeL1FeeJuice(l1RpcUrls, mnemonicOrPrivateKey, pxe, recipient, amount, log) {
|
|
98
|
+
async function bridgeL1FeeJuice(l1RpcUrls, mnemonicOrPrivateKey, pxe, node, recipient, amount, log) {
|
|
99
99
|
const { l1ChainId } = await pxe.getNodeInfo();
|
|
100
100
|
const chain = createEthereumChain(l1RpcUrls, l1ChainId);
|
|
101
101
|
const l1Client = createExtendedL1Client(chain.rpcUrls, mnemonicOrPrivateKey, chain.chainInfo);
|
|
@@ -103,7 +103,7 @@ async function bridgeL1FeeJuice(l1RpcUrls, mnemonicOrPrivateKey, pxe, recipient,
|
|
|
103
103
|
const portal = await L1FeeJuicePortalManager.new(pxe, l1Client, log);
|
|
104
104
|
const claim = await portal.bridgeTokensPublic(recipient, amount, true);
|
|
105
105
|
// docs:end:bridge_fee_juice
|
|
106
|
-
const isSynced = async ()=>await
|
|
106
|
+
const isSynced = async ()=>await node.getL1ToL2MessageBlock(Fr.fromHexString(claim.messageHash)) !== undefined;
|
|
107
107
|
await retryUntil(isSynced, `message ${claim.messageHash} sync`, 24, 0.5);
|
|
108
108
|
log.info(`Created a claim for ${amount} L1 fee juice to ${recipient}.`, claim);
|
|
109
109
|
return claim;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/end-to-end",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.20250919",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": "./dest/index.js",
|
|
6
6
|
"inherits": [
|
|
@@ -25,42 +25,42 @@
|
|
|
25
25
|
"formatting": "run -T prettier --check ./src && run -T eslint ./src"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aztec/accounts": "3.0.0-nightly.
|
|
29
|
-
"@aztec/archiver": "3.0.0-nightly.
|
|
30
|
-
"@aztec/aztec": "3.0.0-nightly.
|
|
31
|
-
"@aztec/aztec-node": "3.0.0-nightly.
|
|
32
|
-
"@aztec/aztec.js": "3.0.0-nightly.
|
|
33
|
-
"@aztec/bb-prover": "3.0.0-nightly.
|
|
34
|
-
"@aztec/blob-lib": "3.0.0-nightly.
|
|
35
|
-
"@aztec/blob-sink": "3.0.0-nightly.
|
|
36
|
-
"@aztec/bot": "3.0.0-nightly.
|
|
37
|
-
"@aztec/cli": "3.0.0-nightly.
|
|
38
|
-
"@aztec/constants": "3.0.0-nightly.
|
|
39
|
-
"@aztec/entrypoints": "3.0.0-nightly.
|
|
40
|
-
"@aztec/epoch-cache": "3.0.0-nightly.
|
|
41
|
-
"@aztec/ethereum": "3.0.0-nightly.
|
|
42
|
-
"@aztec/foundation": "3.0.0-nightly.
|
|
43
|
-
"@aztec/kv-store": "3.0.0-nightly.
|
|
44
|
-
"@aztec/l1-artifacts": "3.0.0-nightly.
|
|
45
|
-
"@aztec/merkle-tree": "3.0.0-nightly.
|
|
46
|
-
"@aztec/node-keystore": "3.0.0-nightly.
|
|
47
|
-
"@aztec/noir-contracts.js": "3.0.0-nightly.
|
|
48
|
-
"@aztec/noir-noirc_abi": "3.0.0-nightly.
|
|
49
|
-
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.
|
|
50
|
-
"@aztec/noir-test-contracts.js": "3.0.0-nightly.
|
|
51
|
-
"@aztec/p2p": "3.0.0-nightly.
|
|
52
|
-
"@aztec/protocol-contracts": "3.0.0-nightly.
|
|
53
|
-
"@aztec/prover-client": "3.0.0-nightly.
|
|
54
|
-
"@aztec/prover-node": "3.0.0-nightly.
|
|
55
|
-
"@aztec/pxe": "3.0.0-nightly.
|
|
56
|
-
"@aztec/sequencer-client": "3.0.0-nightly.
|
|
57
|
-
"@aztec/simulator": "3.0.0-nightly.
|
|
58
|
-
"@aztec/slasher": "3.0.0-nightly.
|
|
59
|
-
"@aztec/stdlib": "3.0.0-nightly.
|
|
60
|
-
"@aztec/telemetry-client": "3.0.0-nightly.
|
|
61
|
-
"@aztec/test-wallet": "3.0.0-nightly.
|
|
62
|
-
"@aztec/validator-client": "3.0.0-nightly.
|
|
63
|
-
"@aztec/world-state": "3.0.0-nightly.
|
|
28
|
+
"@aztec/accounts": "3.0.0-nightly.20250919",
|
|
29
|
+
"@aztec/archiver": "3.0.0-nightly.20250919",
|
|
30
|
+
"@aztec/aztec": "3.0.0-nightly.20250919",
|
|
31
|
+
"@aztec/aztec-node": "3.0.0-nightly.20250919",
|
|
32
|
+
"@aztec/aztec.js": "3.0.0-nightly.20250919",
|
|
33
|
+
"@aztec/bb-prover": "3.0.0-nightly.20250919",
|
|
34
|
+
"@aztec/blob-lib": "3.0.0-nightly.20250919",
|
|
35
|
+
"@aztec/blob-sink": "3.0.0-nightly.20250919",
|
|
36
|
+
"@aztec/bot": "3.0.0-nightly.20250919",
|
|
37
|
+
"@aztec/cli": "3.0.0-nightly.20250919",
|
|
38
|
+
"@aztec/constants": "3.0.0-nightly.20250919",
|
|
39
|
+
"@aztec/entrypoints": "3.0.0-nightly.20250919",
|
|
40
|
+
"@aztec/epoch-cache": "3.0.0-nightly.20250919",
|
|
41
|
+
"@aztec/ethereum": "3.0.0-nightly.20250919",
|
|
42
|
+
"@aztec/foundation": "3.0.0-nightly.20250919",
|
|
43
|
+
"@aztec/kv-store": "3.0.0-nightly.20250919",
|
|
44
|
+
"@aztec/l1-artifacts": "3.0.0-nightly.20250919",
|
|
45
|
+
"@aztec/merkle-tree": "3.0.0-nightly.20250919",
|
|
46
|
+
"@aztec/node-keystore": "3.0.0-nightly.20250919",
|
|
47
|
+
"@aztec/noir-contracts.js": "3.0.0-nightly.20250919",
|
|
48
|
+
"@aztec/noir-noirc_abi": "3.0.0-nightly.20250919",
|
|
49
|
+
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.20250919",
|
|
50
|
+
"@aztec/noir-test-contracts.js": "3.0.0-nightly.20250919",
|
|
51
|
+
"@aztec/p2p": "3.0.0-nightly.20250919",
|
|
52
|
+
"@aztec/protocol-contracts": "3.0.0-nightly.20250919",
|
|
53
|
+
"@aztec/prover-client": "3.0.0-nightly.20250919",
|
|
54
|
+
"@aztec/prover-node": "3.0.0-nightly.20250919",
|
|
55
|
+
"@aztec/pxe": "3.0.0-nightly.20250919",
|
|
56
|
+
"@aztec/sequencer-client": "3.0.0-nightly.20250919",
|
|
57
|
+
"@aztec/simulator": "3.0.0-nightly.20250919",
|
|
58
|
+
"@aztec/slasher": "3.0.0-nightly.20250919",
|
|
59
|
+
"@aztec/stdlib": "3.0.0-nightly.20250919",
|
|
60
|
+
"@aztec/telemetry-client": "3.0.0-nightly.20250919",
|
|
61
|
+
"@aztec/test-wallet": "3.0.0-nightly.20250919",
|
|
62
|
+
"@aztec/validator-client": "3.0.0-nightly.20250919",
|
|
63
|
+
"@aztec/world-state": "3.0.0-nightly.20250919",
|
|
64
64
|
"@iarna/toml": "^2.2.5",
|
|
65
65
|
"@jest/globals": "^30.0.0",
|
|
66
66
|
"@noble/curves": "=1.0.0",
|
|
@@ -207,7 +207,7 @@ export class ClientFlowsBenchmark {
|
|
|
207
207
|
this.pxe = pxe;
|
|
208
208
|
this.adminWallet = wallet;
|
|
209
209
|
this.aztecNode = aztecNode;
|
|
210
|
-
this.cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, pxe);
|
|
210
|
+
this.cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, pxe, aztecNode);
|
|
211
211
|
|
|
212
212
|
this.adminAddress = adminAddress;
|
|
213
213
|
this.sequencerAddress = sequencerAddress;
|
|
@@ -178,7 +178,7 @@ export class BlacklistTokenContractTest {
|
|
|
178
178
|
secretHash: Fr,
|
|
179
179
|
txHash: TxHash,
|
|
180
180
|
) {
|
|
181
|
-
const txEffects = await this.
|
|
181
|
+
const txEffects = await this.aztecNode.getTxEffect(txHash);
|
|
182
182
|
await contract.methods
|
|
183
183
|
.deliver_transparent_note(
|
|
184
184
|
contract.address,
|
|
@@ -72,7 +72,7 @@ export class CrossChainMessagingTest {
|
|
|
72
72
|
this.aztecNode = this.ctx.aztecNode;
|
|
73
73
|
this.pxe = this.ctx.pxe;
|
|
74
74
|
this.aztecNodeConfig = this.ctx.aztecNodeConfig;
|
|
75
|
-
this.cheatCodes = await CheatCodes.create(this.aztecNodeConfig.l1RpcUrls, this.pxe);
|
|
75
|
+
this.cheatCodes = await CheatCodes.create(this.aztecNodeConfig.l1RpcUrls, this.pxe, this.aztecNode);
|
|
76
76
|
this.deployL1ContractsValues = this.ctx.deployL1ContractsValues;
|
|
77
77
|
this.aztecNodeAdmin = this.ctx.aztecNode;
|
|
78
78
|
}
|
|
@@ -188,7 +188,7 @@ export class FeesTest {
|
|
|
188
188
|
this.wallet = wallet;
|
|
189
189
|
this.aztecNode = aztecNode;
|
|
190
190
|
this.gasSettings = GasSettings.default({ maxFeesPerGas: (await this.aztecNode.getCurrentBaseFees()).mul(2) });
|
|
191
|
-
this.cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, pxe);
|
|
191
|
+
this.cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, pxe, aztecNode);
|
|
192
192
|
this.accounts = deployedAccounts.map(a => a.address);
|
|
193
193
|
this.accounts.forEach((a, i) => this.logger.verbose(`Account ${i} address: ${a}`));
|
|
194
194
|
[this.aliceAddress, this.bobAddress, this.sequencerAddress] = this.accounts.slice(0, 3);
|
|
@@ -318,7 +318,7 @@ export class FeesTest {
|
|
|
318
318
|
};
|
|
319
319
|
|
|
320
320
|
this.getProverFee = async (blockNumber: number) => {
|
|
321
|
-
const block = await this.
|
|
321
|
+
const block = await this.aztecNode.getBlock(blockNumber);
|
|
322
322
|
|
|
323
323
|
// @todo @lherskind As we deal with #13601
|
|
324
324
|
// Right now the value is from `FeeLib.sol`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AztecAddress, type Logger, type PXE, type Wallet, createLogger } from '@aztec/aztec.js';
|
|
1
|
+
import { AztecAddress, type AztecNode, type Logger, type PXE, type Wallet, createLogger } from '@aztec/aztec.js';
|
|
2
2
|
import { ChildContract } from '@aztec/noir-test-contracts.js/Child';
|
|
3
3
|
import { ParentContract } from '@aztec/noir-test-contracts.js/Parent';
|
|
4
4
|
|
|
@@ -18,6 +18,7 @@ export class NestedContractTest {
|
|
|
18
18
|
wallet!: Wallet;
|
|
19
19
|
defaultAccountAddress!: AztecAddress;
|
|
20
20
|
pxe!: PXE;
|
|
21
|
+
aztecNode!: AztecNode;
|
|
21
22
|
|
|
22
23
|
parentContract!: ParentContract;
|
|
23
24
|
childContract!: ChildContract;
|
|
@@ -39,10 +40,11 @@ export class NestedContractTest {
|
|
|
39
40
|
await this.snapshotManager.snapshot(
|
|
40
41
|
'accounts',
|
|
41
42
|
deployAccounts(this.numberOfAccounts, this.logger),
|
|
42
|
-
({ deployedAccounts }, { pxe, wallet }) => {
|
|
43
|
+
({ deployedAccounts }, { pxe, wallet, aztecNode }) => {
|
|
43
44
|
this.wallet = wallet;
|
|
44
45
|
[{ address: this.defaultAccountAddress }] = deployedAccounts;
|
|
45
46
|
this.pxe = pxe;
|
|
47
|
+
this.aztecNode = aztecNode;
|
|
46
48
|
return Promise.resolve();
|
|
47
49
|
},
|
|
48
50
|
);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { AztecAddress, type AztecNode, type Logger,
|
|
1
|
+
import { AztecAddress, type AztecNode, type Logger, createLogger } from '@aztec/aztec.js';
|
|
2
2
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
3
3
|
import { InvalidAccountContract } from '@aztec/noir-test-contracts.js/InvalidAccount';
|
|
4
|
+
import type { TestWallet } from '@aztec/test-wallet';
|
|
4
5
|
|
|
5
6
|
import { jest } from '@jest/globals';
|
|
6
7
|
|
|
@@ -27,7 +28,7 @@ export class TokenContractTest {
|
|
|
27
28
|
node!: AztecNode;
|
|
28
29
|
|
|
29
30
|
badAccount!: InvalidAccountContract;
|
|
30
|
-
wallet!:
|
|
31
|
+
wallet!: TestWallet;
|
|
31
32
|
adminAddress!: AztecAddress;
|
|
32
33
|
account1Address!: AztecAddress;
|
|
33
34
|
account2Address!: AztecAddress;
|
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
type ContractFunctionInteraction,
|
|
9
9
|
EthAddress,
|
|
10
10
|
type Logger,
|
|
11
|
-
type PXE,
|
|
12
11
|
type Wallet,
|
|
13
12
|
getContractClassFromArtifact,
|
|
14
13
|
waitForProven,
|
|
@@ -450,7 +449,7 @@ async function setupFromFresh(
|
|
|
450
449
|
pxeConfig.proverEnabled = !!opts.realProofs;
|
|
451
450
|
const pxe = await createPXEService(aztecNode, pxeConfig);
|
|
452
451
|
const wallet = new TestWallet(pxe);
|
|
453
|
-
const cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, pxe);
|
|
452
|
+
const cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, pxe, aztecNode);
|
|
454
453
|
|
|
455
454
|
if (statePath) {
|
|
456
455
|
writeFileSync(`${statePath}/aztec_node_config.json`, JSON.stringify(aztecNodeConfig, resolver));
|
|
@@ -579,7 +578,7 @@ async function setupFromState(statePath: string, logger: Logger): Promise<Subsys
|
|
|
579
578
|
pxeConfig.dataDirectory = statePath;
|
|
580
579
|
const pxe = await createPXEService(aztecNode, pxeConfig);
|
|
581
580
|
const wallet = new TestWallet(pxe);
|
|
582
|
-
const cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, pxe);
|
|
581
|
+
const cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, pxe, aztecNode);
|
|
583
582
|
|
|
584
583
|
return {
|
|
585
584
|
aztecNodeConfig,
|
|
@@ -641,13 +640,13 @@ export const deployAccounts =
|
|
|
641
640
|
* @param sender - Wallet to send the deployment tx.
|
|
642
641
|
* @param accountsToDeploy - Which accounts to publicly deploy.
|
|
643
642
|
* @param waitUntilProven - Whether to wait for the tx to be proven.
|
|
644
|
-
* @param
|
|
643
|
+
* @param node - AztecNode used to wait for proven tx.
|
|
645
644
|
*/
|
|
646
645
|
export async function publicDeployAccounts(
|
|
647
646
|
wallet: Wallet,
|
|
648
647
|
accountsToDeploy: AztecAddress[],
|
|
649
648
|
waitUntilProven = false,
|
|
650
|
-
|
|
649
|
+
node?: AztecNode,
|
|
651
650
|
) {
|
|
652
651
|
const instances = (await Promise.all(accountsToDeploy.map(account => wallet.getContractMetadata(account)))).map(
|
|
653
652
|
metadata => metadata.contractInstance,
|
|
@@ -665,10 +664,10 @@ export async function publicDeployAccounts(
|
|
|
665
664
|
|
|
666
665
|
const txReceipt = await batch.send({ from: accountsToDeploy[0] }).wait();
|
|
667
666
|
if (waitUntilProven) {
|
|
668
|
-
if (!
|
|
669
|
-
throw new Error('Need to provide
|
|
667
|
+
if (!node) {
|
|
668
|
+
throw new Error('Need to provide an AztecNode to wait for proven.');
|
|
670
669
|
} else {
|
|
671
|
-
await waitForProven(
|
|
670
|
+
await waitForProven(node, txReceipt);
|
|
672
671
|
}
|
|
673
672
|
}
|
|
674
673
|
}
|
package/src/fixtures/utils.ts
CHANGED
|
@@ -236,7 +236,7 @@ async function setupWithRemoteEnvironment(
|
|
|
236
236
|
rollupVersion,
|
|
237
237
|
};
|
|
238
238
|
const ethCheatCodes = new EthCheatCodes(config.l1RpcUrls);
|
|
239
|
-
const cheatCodes = await CheatCodes.create(config.l1RpcUrls, pxeClient
|
|
239
|
+
const cheatCodes = await CheatCodes.create(config.l1RpcUrls, pxeClient!, aztecNode);
|
|
240
240
|
const teardown = () => Promise.resolve();
|
|
241
241
|
|
|
242
242
|
logger.verbose('Populating wallet from already registered accounts...');
|
|
@@ -657,7 +657,7 @@ export async function setup(
|
|
|
657
657
|
logger.verbose('Creating a pxe...');
|
|
658
658
|
const { pxe, teardown: pxeTeardown } = await setupPXEService(aztecNode!, pxeOpts, logger);
|
|
659
659
|
|
|
660
|
-
const cheatCodes = await CheatCodes.create(config.l1RpcUrls, pxe
|
|
660
|
+
const cheatCodes = await CheatCodes.create(config.l1RpcUrls, pxe!, aztecNode);
|
|
661
661
|
|
|
662
662
|
if (
|
|
663
663
|
(opts.aztecTargetCommitteeSize && opts.aztecTargetCommitteeSize > 0) ||
|
|
@@ -675,7 +675,7 @@ export async function setup(
|
|
|
675
675
|
// Below we continue with what we described in the long comment on line 571.
|
|
676
676
|
if (numberOfAccounts === 0) {
|
|
677
677
|
logger.info('No accounts are being deployed, waiting for an empty block 1 to be mined');
|
|
678
|
-
while ((await
|
|
678
|
+
while ((await aztecNode.getBlockNumber()) === 0) {
|
|
679
679
|
await sleep(2000);
|
|
680
680
|
}
|
|
681
681
|
} else {
|
|
@@ -5,7 +5,6 @@ import {
|
|
|
5
5
|
Fr,
|
|
6
6
|
type Logger,
|
|
7
7
|
type PXE,
|
|
8
|
-
type Wallet,
|
|
9
8
|
computeAuthWitMessageHash,
|
|
10
9
|
generateClaimSecret,
|
|
11
10
|
} from '@aztec/aztec.js';
|
|
@@ -22,6 +21,7 @@ import { InboxAbi, UniswapPortalAbi, UniswapPortalBytecode } from '@aztec/l1-art
|
|
|
22
21
|
import { UniswapContract } from '@aztec/noir-contracts.js/Uniswap';
|
|
23
22
|
import { computeL2ToL1MessageHash } from '@aztec/stdlib/hash';
|
|
24
23
|
import { computeL2ToL1MembershipWitness } from '@aztec/stdlib/messaging';
|
|
24
|
+
import type { TestWallet } from '@aztec/test-wallet';
|
|
25
25
|
|
|
26
26
|
import { jest } from '@jest/globals';
|
|
27
27
|
import { type GetContractReturnType, getContract, parseEther, toFunctionSelector } from 'viem';
|
|
@@ -50,7 +50,7 @@ export type UniswapSetupContext = {
|
|
|
50
50
|
/** The L1 wallet client, extended with public actions. */
|
|
51
51
|
l1Client: ExtendedViemWalletClient;
|
|
52
52
|
/** The wallet. */
|
|
53
|
-
wallet:
|
|
53
|
+
wallet: TestWallet;
|
|
54
54
|
/** The owner address. */
|
|
55
55
|
ownerAddress: AztecAddress;
|
|
56
56
|
/** The sponsor wallet. */
|
|
@@ -80,7 +80,7 @@ export const uniswapL1L2TestSuite = (
|
|
|
80
80
|
|
|
81
81
|
let l1Client: ExtendedViemWalletClient;
|
|
82
82
|
|
|
83
|
-
let wallet:
|
|
83
|
+
let wallet: TestWallet;
|
|
84
84
|
let ownerAddress: AztecAddress;
|
|
85
85
|
let ownerEthAddress: EthAddress;
|
|
86
86
|
// does transactions on behalf of owner on Aztec:
|
|
@@ -614,14 +614,16 @@ export const uniswapL1L2TestSuite = (
|
|
|
614
614
|
const expectedMessageHash = await computeAuthWitMessageHash(
|
|
615
615
|
{
|
|
616
616
|
caller: uniswapL2Contract.address,
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
617
|
+
call: await wethCrossChainHarness.l2Token.methods
|
|
618
|
+
.transfer_to_public(
|
|
619
|
+
ownerAddress,
|
|
620
|
+
uniswapL2Contract.address,
|
|
621
|
+
wethAmountToBridge,
|
|
622
|
+
nonceForWETHTransferToPublicApproval,
|
|
623
|
+
)
|
|
624
|
+
.getFunctionCall(),
|
|
623
625
|
},
|
|
624
|
-
|
|
626
|
+
await wallet.getChainInfo(),
|
|
625
627
|
);
|
|
626
628
|
|
|
627
629
|
await expect(
|
|
@@ -699,7 +701,7 @@ export const uniswapL1L2TestSuite = (
|
|
|
699
701
|
},
|
|
700
702
|
true,
|
|
701
703
|
);
|
|
702
|
-
await validateActionInteraction.send(
|
|
704
|
+
await validateActionInteraction.send().wait();
|
|
703
705
|
|
|
704
706
|
// No approval to call `swap` but should work even without it:
|
|
705
707
|
const [_, secretHashForDepositingSwappedDai] = await generateClaimSecret();
|
|
@@ -749,7 +751,7 @@ export const uniswapL1L2TestSuite = (
|
|
|
749
751
|
{ caller: approvedUser, action },
|
|
750
752
|
true,
|
|
751
753
|
);
|
|
752
|
-
await validateActionInteraction.send(
|
|
754
|
+
await validateActionInteraction.send().wait();
|
|
753
755
|
|
|
754
756
|
await expect(action.simulate({ from: sponsorAddress })).rejects.toThrow(/unauthorized/);
|
|
755
757
|
});
|
|
@@ -771,7 +773,7 @@ export const uniswapL1L2TestSuite = (
|
|
|
771
773
|
},
|
|
772
774
|
true,
|
|
773
775
|
);
|
|
774
|
-
await validateActionInteraction.send(
|
|
776
|
+
await validateActionInteraction.send().wait();
|
|
775
777
|
|
|
776
778
|
await expect(
|
|
777
779
|
uniswapL2Contract.methods
|
|
@@ -942,7 +944,7 @@ export const uniswapL1L2TestSuite = (
|
|
|
942
944
|
},
|
|
943
945
|
true,
|
|
944
946
|
);
|
|
945
|
-
await validateActionInteraction.send(
|
|
947
|
+
await validateActionInteraction.send().wait();
|
|
946
948
|
|
|
947
949
|
// Call swap_public on L2
|
|
948
950
|
const secretHashForDepositingSwappedDai = Fr.random();
|
|
@@ -136,7 +136,9 @@ export async function deployTestAccountsWithTokens(
|
|
|
136
136
|
const fundedAccounts = await Promise.all(funded.map(a => wallet.createSchnorrAccount(a.secret, a.salt)));
|
|
137
137
|
|
|
138
138
|
const claims = await Promise.all(
|
|
139
|
-
fundedAccounts.map(a =>
|
|
139
|
+
fundedAccounts.map(a =>
|
|
140
|
+
bridgeL1FeeJuice(l1RpcUrls, mnemonicOrPrivateKey, pxe, node, a.getAddress(), undefined, logger),
|
|
141
|
+
),
|
|
140
142
|
);
|
|
141
143
|
|
|
142
144
|
// Progress by 3 L2 blocks so that the l1ToL2Message added above will be available to use on L2.
|
|
@@ -179,6 +181,7 @@ async function bridgeL1FeeJuice(
|
|
|
179
181
|
l1RpcUrls: string[],
|
|
180
182
|
mnemonicOrPrivateKey: string,
|
|
181
183
|
pxe: PXE,
|
|
184
|
+
node: AztecNode,
|
|
182
185
|
recipient: AztecAddress,
|
|
183
186
|
amount: bigint | undefined,
|
|
184
187
|
log: Logger,
|
|
@@ -192,7 +195,7 @@ async function bridgeL1FeeJuice(
|
|
|
192
195
|
const claim = await portal.bridgeTokensPublic(recipient, amount, true /* mint */);
|
|
193
196
|
// docs:end:bridge_fee_juice
|
|
194
197
|
|
|
195
|
-
const isSynced = async () => await
|
|
198
|
+
const isSynced = async () => (await node.getL1ToL2MessageBlock(Fr.fromHexString(claim.messageHash))) !== undefined;
|
|
196
199
|
await retryUntil(isSynced, `message ${claim.messageHash} sync`, 24, 0.5);
|
|
197
200
|
|
|
198
201
|
log.info(`Created a claim for ${amount} L1 fee juice to ${recipient}.`, claim);
|