@aztec/end-to-end 3.0.0-nightly.20250922 → 3.0.0-nightly.20250923
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 +0 -1
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +5 -8
- package/dest/bench/utils.d.ts +1 -10
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +0 -25
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +1 -2
- 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 +1 -3
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +1 -2
- 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 +6 -8
- package/dest/e2e_deploy_contract/deploy_test.d.ts +3 -3
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
- package/dest/e2e_deploy_contract/deploy_test.js +2 -3
- package/dest/e2e_fees/fees_test.d.ts +1 -2
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +5 -8
- package/dest/e2e_nested_contract/nested_contract_test.d.ts +1 -2
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +1 -3
- package/dest/e2e_p2p/shared.d.ts +2 -1
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +5 -3
- package/dest/fixtures/e2e_prover_test.d.ts +0 -2
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +6 -9
- package/dest/fixtures/snapshot_manager.d.ts +0 -2
- package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.js +2 -4
- package/dest/fixtures/utils.d.ts +12 -14
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +17 -19
- package/dest/shared/cross_chain_test_harness.d.ts +2 -6
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +3 -5
- package/dest/shared/gas_portal_test_harness.d.ts +5 -6
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.js +5 -5
- package/dest/shared/uniswap_l1_l2.d.ts +1 -3
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +3 -4
- package/dest/spartan/setup_test_wallets.d.ts +5 -5
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +10 -12
- package/package.json +37 -37
- package/src/bench/client_flows/client_flows_benchmark.ts +4 -8
- package/src/bench/utils.ts +1 -28
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +1 -4
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +5 -9
- package/src/e2e_deploy_contract/deploy_test.ts +4 -5
- package/src/e2e_fees/fees_test.ts +6 -9
- package/src/e2e_nested_contract/nested_contract_test.ts +2 -4
- package/src/e2e_p2p/shared.ts +6 -2
- package/src/fixtures/e2e_prover_test.ts +7 -12
- package/src/fixtures/snapshot_manager.ts +3 -6
- package/src/fixtures/utils.ts +21 -30
- package/src/shared/cross_chain_test_harness.ts +0 -5
- package/src/shared/gas_portal_test_harness.ts +4 -6
- package/src/shared/uniswap_l1_l2.ts +1 -7
- package/src/spartan/setup_test_wallets.ts +10 -15
|
@@ -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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0BlB;;OAEG;IACU,QAAQ;CAKtB;AAqVD;;;GAGG;AACH,eAAO,MAAM,cAAc,GACxB,kBAAkB,MAAM,EAAE,QAAQ,MAAM,MAClC,mCAAmC;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,qBAAqB,EAAE,kBAAkB,EAAE,CAAA;CAAE;;EAsB5G,CAAC;AAEJ;;;;;;;GAOG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,YAAY,EAAE,EAChC,eAAe,UAAQ,EACvB,IAAI,CAAC,EAAE,SAAS,iBAwBjB"}
|
|
@@ -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, aztecNode);
|
|
335
|
-
const cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls,
|
|
335
|
+
const cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, wallet, 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));
|
|
@@ -341,7 +341,6 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
341
341
|
aztecNodeConfig,
|
|
342
342
|
anvil,
|
|
343
343
|
aztecNode,
|
|
344
|
-
pxe,
|
|
345
344
|
wallet,
|
|
346
345
|
sequencer: aztecNode.getSequencer(),
|
|
347
346
|
acvmConfig,
|
|
@@ -431,12 +430,11 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
431
430
|
pxeConfig.dataDirectory = statePath;
|
|
432
431
|
const pxe = await createPXEService(aztecNode, pxeConfig);
|
|
433
432
|
const wallet = new TestWallet(pxe, aztecNode);
|
|
434
|
-
const cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls,
|
|
433
|
+
const cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, wallet, aztecNode);
|
|
435
434
|
return {
|
|
436
435
|
aztecNodeConfig,
|
|
437
436
|
anvil,
|
|
438
437
|
aztecNode,
|
|
439
|
-
pxe,
|
|
440
438
|
wallet,
|
|
441
439
|
sequencer: aztecNode.getSequencer(),
|
|
442
440
|
acvmConfig,
|
package/dest/fixtures/utils.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type InitialAccountData } from '@aztec/accounts/testing';
|
|
2
2
|
import { type AztecNodeConfig } from '@aztec/aztec-node';
|
|
3
|
-
import { AztecAddress, type AztecNode, type ContractMethod, type Logger, type
|
|
3
|
+
import { AztecAddress, type AztecNode, type ContractMethod, 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, type Operator } from '@aztec/ethereum';
|
|
@@ -11,7 +11,7 @@ import { TestDateProvider } from '@aztec/foundation/timer';
|
|
|
11
11
|
import type { DataStoreConfig } from '@aztec/kv-store/config';
|
|
12
12
|
import { MockGossipSubNetwork } from '@aztec/p2p/test-helpers';
|
|
13
13
|
import { type ProverNode, type ProverNodeConfig, type ProverNodeDeps } from '@aztec/prover-node';
|
|
14
|
-
import { type
|
|
14
|
+
import { type PXEServiceConfig } from '@aztec/pxe/server';
|
|
15
15
|
import type { SequencerClient } from '@aztec/sequencer-client';
|
|
16
16
|
import { type ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
17
17
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
@@ -24,18 +24,18 @@ export { startAnvil };
|
|
|
24
24
|
export declare const getPrivateKeyFromIndex: (index: number) => Buffer | null;
|
|
25
25
|
export declare const setupL1Contracts: (l1RpcUrls: string[], account: HDAccount | PrivateKeyAccount, logger: Logger, args?: Partial<DeployL1ContractsArgs>, chain?: Chain) => Promise<DeployL1ContractsReturnType>;
|
|
26
26
|
/**
|
|
27
|
-
* Sets up Private eXecution Environment (PXE).
|
|
27
|
+
* Sets up Private eXecution Environment (PXE) and returns the corresponding test wallet.
|
|
28
28
|
* @param aztecNode - An instance of Aztec Node.
|
|
29
29
|
* @param opts - Partial configuration for the PXE service.
|
|
30
30
|
* @param logger - The logger to be used.
|
|
31
31
|
* @param useLogSuffix - Whether to add a randomly generated suffix to the PXE debug logs.
|
|
32
|
-
* @returns
|
|
32
|
+
* @returns A test wallet, logger and teardown function.
|
|
33
33
|
*/
|
|
34
|
-
export declare function
|
|
34
|
+
export declare function setupPXEServiceAndGetWallet(aztecNode: AztecNode, opts?: Partial<PXEServiceConfig>, logger?: Logger, useLogSuffix?: boolean): Promise<{
|
|
35
35
|
/**
|
|
36
|
-
* The
|
|
36
|
+
* The wallet instance.
|
|
37
37
|
*/
|
|
38
|
-
|
|
38
|
+
wallet: TestWallet;
|
|
39
39
|
/**
|
|
40
40
|
* Logger instance named as the current test.
|
|
41
41
|
*/
|
|
@@ -106,8 +106,6 @@ export type EndToEndContext = {
|
|
|
106
106
|
proverNode: ProverNode | undefined;
|
|
107
107
|
/** A client to the sequencer service (undefined if connected to remote environment) */
|
|
108
108
|
sequencer: SequencerClient | undefined;
|
|
109
|
-
/** The Private eXecution Environment (PXE). */
|
|
110
|
-
pxe: PXE;
|
|
111
109
|
/** Return values from deployL1Contracts function. */
|
|
112
110
|
deployL1ContractsValues: DeployL1ContractsReturnType;
|
|
113
111
|
/** The Aztec Node configuration. */
|
|
@@ -171,13 +169,13 @@ export declare function getBalancesFn(symbol: string, method: ContractMethod, fr
|
|
|
171
169
|
export declare function expectMapping<K, V>(fn: (...k: K[]) => Promise<V[]>, inputs: K[], expectedOutputs: V[]): Promise<void>;
|
|
172
170
|
export declare function expectMappingDelta<K, V extends number | bigint>(initialValues: V[], fn: (...k: K[]) => Promise<V[]>, inputs: K[], expectedDiffs: V[]): Promise<void>;
|
|
173
171
|
/**
|
|
174
|
-
* Computes the address of the "canonical"
|
|
172
|
+
* Computes the address of the "canonical" SponsoredFPCContract. This is not a protocol contract
|
|
175
173
|
* but by conventions its address is computed with a salt of 0.
|
|
176
174
|
* @returns The address of the sponsored FPC contract
|
|
177
175
|
*/
|
|
178
176
|
export declare function getSponsoredFPCInstance(): Promise<ContractInstanceWithAddress>;
|
|
179
177
|
/**
|
|
180
|
-
* Computes the address of the "canonical"
|
|
178
|
+
* Computes the address of the "canonical" SponsoredFPCContract. This is not a protocol contract
|
|
181
179
|
* but by conventions its address is computed with a salt of 0.
|
|
182
180
|
* @returns The address of the sponsored FPC contract
|
|
183
181
|
*/
|
|
@@ -185,12 +183,12 @@ export declare function getSponsoredFPCAddress(): Promise<AztecAddress>;
|
|
|
185
183
|
/**
|
|
186
184
|
* Deploy a sponsored FPC contract to a running instance.
|
|
187
185
|
*/
|
|
188
|
-
export declare function setupSponsoredFPC(
|
|
186
|
+
export declare function setupSponsoredFPC(wallet: Wallet): Promise<ContractInstanceWithAddress>;
|
|
189
187
|
/**
|
|
190
188
|
* Registers the SponsoredFPC in this PXE instance
|
|
191
|
-
* @param
|
|
189
|
+
* @param wallet - The wallet
|
|
192
190
|
*/
|
|
193
|
-
export declare function registerSponsoredFPC(
|
|
191
|
+
export declare function registerSponsoredFPC(wallet: Wallet): Promise<void>;
|
|
194
192
|
export declare function waitForProvenChain(node: AztecNode, targetBlock?: number, timeoutSec?: number, intervalSec?: number): Promise<void>;
|
|
195
193
|
export declare function createAndSyncProverNode(proverNodePrivateKey: `0x${string}`, aztecNodeConfig: AztecNodeConfig, proverNodeConfig: Partial<ProverNodeConfig> & Pick<DataStoreConfig, 'dataDirectory'>, aztecNode: AztecNode | undefined, prefilledPublicData?: PublicDataTreeLeaf[], proverNodeDeps?: ProverNodeDeps): Promise<ProverNode>;
|
|
196
194
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/fixtures/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,kBAAkB,EAAoD,MAAM,yBAAyB,CAAC;AAEpH,OAAO,EAAE,KAAK,eAAe,EAAsC,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EACL,YAAY,EACZ,KAAK,SAAS,EAEd,KAAK,cAAc,EACnB,KAAK,MAAM,EACX,KAAK,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/fixtures/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,kBAAkB,EAAoD,MAAM,yBAAyB,CAAC;AAEpH,OAAO,EAAE,KAAK,eAAe,EAAsC,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EACL,YAAY,EACZ,KAAK,SAAS,EAEd,KAAK,cAAc,EACnB,KAAK,MAAM,EACX,KAAK,MAAM,EAOZ,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEpE,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,yBAAyB,CAAC;AAEpF,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAGhC,KAAK,QAAQ,EAOd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAEL,aAAa,EAGb,UAAU,EACX,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAI9C,OAAO,EAAgB,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAI9D,OAAO,EAAE,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,GAAG,MAAM,EACnE,aAAa,EAAE,CAAC,EAAE,EAClB,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,KAAK,OAAO,CAAC,CAAC,EAAE,CAAC,EAC/B,MAAM,EAAE,CAAC,EAAE,EACX,aAAa,EAAE,CAAC,EAAE,GACjB,OAAO,CAAC,IAAI,CAAC,CAOf;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,IAAI,OAAO,CAAC,2BAA2B,CAAC,CAM9E;AAED;;;;GAIG;AACH,wBAAsB,sBAAsB,0BAG3C;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,MAAM,wCAQrD;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAExE;AAED,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,SAAS,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,UAAU,SAAK,EAAE,WAAW,SAAI,iBAS/G;AAED,wBAAgB,uBAAuB,CACrC,oBAAoB,EAAE,KAAK,MAAM,EAAE,EACnC,eAAe,EAAE,eAAe,EAChC,gBAAgB,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC,eAAe,EAAE,eAAe,CAAC,EACpF,SAAS,EAAE,SAAS,GAAG,SAAS,EAChC,mBAAmB,GAAE,kBAAkB,EAAO,EAC9C,cAAc,GAAE,cAAmB,uBAqDpC"}
|
package/dest/fixtures/utils.js
CHANGED
|
@@ -84,13 +84,13 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
84
84
|
return l1Data;
|
|
85
85
|
};
|
|
86
86
|
/**
|
|
87
|
-
* Sets up Private eXecution Environment (PXE).
|
|
87
|
+
* Sets up Private eXecution Environment (PXE) and returns the corresponding test wallet.
|
|
88
88
|
* @param aztecNode - An instance of Aztec Node.
|
|
89
89
|
* @param opts - Partial configuration for the PXE service.
|
|
90
90
|
* @param logger - The logger to be used.
|
|
91
91
|
* @param useLogSuffix - Whether to add a randomly generated suffix to the PXE debug logs.
|
|
92
|
-
* @returns
|
|
93
|
-
*/ export async function
|
|
92
|
+
* @returns A test wallet, logger and teardown function.
|
|
93
|
+
*/ export async function setupPXEServiceAndGetWallet(aztecNode, opts = {}, logger = getLogger(), useLogSuffix = false) {
|
|
94
94
|
const pxeServiceConfig = {
|
|
95
95
|
...getPXEServiceConfig(),
|
|
96
96
|
...opts
|
|
@@ -109,8 +109,9 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
109
109
|
useLogSuffix
|
|
110
110
|
});
|
|
111
111
|
const teardown = configuredDataDirectory ? ()=>Promise.resolve() : ()=>tryRmDir(pxeServiceConfig.dataDirectory);
|
|
112
|
+
const wallet = new TestWallet(pxe, aztecNode);
|
|
112
113
|
return {
|
|
113
|
-
|
|
114
|
+
wallet,
|
|
114
115
|
logger,
|
|
115
116
|
teardown
|
|
116
117
|
};
|
|
@@ -145,11 +146,11 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
145
146
|
rollupVersion
|
|
146
147
|
};
|
|
147
148
|
const ethCheatCodes = new EthCheatCodes(config.l1RpcUrls);
|
|
148
|
-
const
|
|
149
|
+
const wallet = new TestWallet(pxeClient, aztecNode);
|
|
150
|
+
const cheatCodes = await CheatCodes.create(config.l1RpcUrls, wallet, aztecNode);
|
|
149
151
|
const teardown = ()=>Promise.resolve();
|
|
150
152
|
logger.verbose('Populating wallet from already registered accounts...');
|
|
151
|
-
const initialFundedAccounts = await getDeployedTestAccounts(
|
|
152
|
-
const wallet = new TestWallet(pxeClient, aztecNode);
|
|
153
|
+
const initialFundedAccounts = await getDeployedTestAccounts(wallet);
|
|
153
154
|
if (initialFundedAccounts.length < numberOfAccounts) {
|
|
154
155
|
throw new Error(`Required ${numberOfAccounts} accounts. Found ${initialFundedAccounts.length}.`);
|
|
155
156
|
// Deploy new accounts if there's a test that requires more funded accounts in the remote environment.
|
|
@@ -163,7 +164,6 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
163
164
|
aztecNodeAdmin: undefined,
|
|
164
165
|
sequencer: undefined,
|
|
165
166
|
proverNode: undefined,
|
|
166
|
-
pxe: pxeClient,
|
|
167
167
|
deployL1ContractsValues,
|
|
168
168
|
config,
|
|
169
169
|
initialFundedAccounts,
|
|
@@ -409,8 +409,8 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
409
409
|
proverNode = await createAndSyncProverNode(proverNodePrivateKeyHex, config, proverNodeConfig, aztecNode, prefilledPublicData);
|
|
410
410
|
}
|
|
411
411
|
logger.verbose('Creating a pxe...');
|
|
412
|
-
const {
|
|
413
|
-
const cheatCodes = await CheatCodes.create(config.l1RpcUrls,
|
|
412
|
+
const { wallet, teardown: pxeTeardown } = await setupPXEServiceAndGetWallet(aztecNode, pxeOpts, logger);
|
|
413
|
+
const cheatCodes = await CheatCodes.create(config.l1RpcUrls, wallet, 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), {
|
|
@@ -419,7 +419,6 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
419
419
|
await cheatCodes.rollup.setupEpoch();
|
|
420
420
|
await cheatCodes.rollup.debugRollup();
|
|
421
421
|
}
|
|
422
|
-
const wallet = new TestWallet(pxe, aztecNode);
|
|
423
422
|
let accounts = [];
|
|
424
423
|
// Below we continue with what we described in the long comment on line 571.
|
|
425
424
|
if (numberOfAccounts === 0) {
|
|
@@ -474,7 +473,6 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
474
473
|
mockGossipSubNetwork,
|
|
475
474
|
prefilledPublicData,
|
|
476
475
|
proverNode,
|
|
477
|
-
pxe,
|
|
478
476
|
sequencer: sequencerClient,
|
|
479
477
|
teardown,
|
|
480
478
|
telemetryClient: telemetry,
|
|
@@ -569,7 +567,7 @@ export async function expectMappingDelta(initialValues, fn, inputs, expectedDiff
|
|
|
569
567
|
expect(diffs).toEqual(expectedDiffs);
|
|
570
568
|
}
|
|
571
569
|
/**
|
|
572
|
-
* Computes the address of the "canonical"
|
|
570
|
+
* Computes the address of the "canonical" SponsoredFPCContract. This is not a protocol contract
|
|
573
571
|
* but by conventions its address is computed with a salt of 0.
|
|
574
572
|
* @returns The address of the sponsored FPC contract
|
|
575
573
|
*/ export function getSponsoredFPCInstance() {
|
|
@@ -578,7 +576,7 @@ export async function expectMappingDelta(initialValues, fn, inputs, expectedDiff
|
|
|
578
576
|
}));
|
|
579
577
|
}
|
|
580
578
|
/**
|
|
581
|
-
* Computes the address of the "canonical"
|
|
579
|
+
* Computes the address of the "canonical" SponsoredFPCContract. This is not a protocol contract
|
|
582
580
|
* but by conventions its address is computed with a salt of 0.
|
|
583
581
|
* @returns The address of the sponsored FPC contract
|
|
584
582
|
*/ export async function getSponsoredFPCAddress() {
|
|
@@ -587,11 +585,11 @@ export async function expectMappingDelta(initialValues, fn, inputs, expectedDiff
|
|
|
587
585
|
}
|
|
588
586
|
/**
|
|
589
587
|
* Deploy a sponsored FPC contract to a running instance.
|
|
590
|
-
*/ export async function setupSponsoredFPC(
|
|
588
|
+
*/ export async function setupSponsoredFPC(wallet) {
|
|
591
589
|
const instance = await getContractInstanceFromInstantiationParams(SponsoredFPCContract.artifact, {
|
|
592
590
|
salt: new Fr(SPONSORED_FPC_SALT)
|
|
593
591
|
});
|
|
594
|
-
await
|
|
592
|
+
await wallet.registerContract({
|
|
595
593
|
instance,
|
|
596
594
|
artifact: SponsoredFPCContract.artifact
|
|
597
595
|
});
|
|
@@ -600,9 +598,9 @@ export async function expectMappingDelta(initialValues, fn, inputs, expectedDiff
|
|
|
600
598
|
}
|
|
601
599
|
/**
|
|
602
600
|
* Registers the SponsoredFPC in this PXE instance
|
|
603
|
-
* @param
|
|
604
|
-
*/ export async function registerSponsoredFPC(
|
|
605
|
-
await
|
|
601
|
+
* @param wallet - The wallet
|
|
602
|
+
*/ export async function registerSponsoredFPC(wallet) {
|
|
603
|
+
await wallet.registerContract({
|
|
606
604
|
instance: await getSponsoredFPCInstance(),
|
|
607
605
|
artifact: SponsoredFPCContract.artifact
|
|
608
606
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AuthWitness, type AztecAddress, type AztecNode, EthAddress, type FieldsOf, Fr, type L2AmountClaim, type L2AmountClaimWithRecipient, type Logger, type
|
|
1
|
+
import { AuthWitness, type AztecAddress, type AztecNode, EthAddress, type FieldsOf, Fr, type L2AmountClaim, type L2AmountClaimWithRecipient, type Logger, type SiblingPath, type TxReceipt, type Wallet } from '@aztec/aztec.js';
|
|
2
2
|
import { type ExtendedViemWalletClient, type L1ContractAddresses } from '@aztec/ethereum';
|
|
3
3
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
4
4
|
import { TokenBridgeContract } from '@aztec/noir-contracts.js/TokenBridge';
|
|
@@ -52,8 +52,6 @@ export type CrossChainContext = {
|
|
|
52
52
|
export declare class CrossChainTestHarness {
|
|
53
53
|
/** Aztec node instance. */
|
|
54
54
|
aztecNode: AztecNode;
|
|
55
|
-
/** Private eXecution Environment (PXE). */
|
|
56
|
-
pxeService: PXE;
|
|
57
55
|
/** Logger. */
|
|
58
56
|
logger: Logger;
|
|
59
57
|
/** L2 Token contract. */
|
|
@@ -74,14 +72,12 @@ export declare class CrossChainTestHarness {
|
|
|
74
72
|
readonly wallet: Wallet;
|
|
75
73
|
/** Owner of the l2 token and bridge */
|
|
76
74
|
readonly ownerAddress: AztecAddress;
|
|
77
|
-
static new(aztecNode: AztecNode,
|
|
75
|
+
static new(aztecNode: AztecNode, l1Client: ExtendedViemWalletClient, wallet: Wallet, ownerAddress: AztecAddress, logger: Logger, underlyingERC20Address: EthAddress): Promise<CrossChainTestHarness>;
|
|
78
76
|
private readonly l1TokenManager;
|
|
79
77
|
private readonly l1TokenPortalManager;
|
|
80
78
|
constructor(
|
|
81
79
|
/** Aztec node instance. */
|
|
82
80
|
aztecNode: AztecNode,
|
|
83
|
-
/** Private eXecution Environment (PXE). */
|
|
84
|
-
pxeService: PXE,
|
|
85
81
|
/** Logger. */
|
|
86
82
|
logger: Logger,
|
|
87
83
|
/** L2 Token contract. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cross_chain_test_harness.d.ts","sourceRoot":"","sources":["../../src/shared/cross_chain_test_harness.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,UAAU,EACV,KAAK,QAAQ,EACb,EAAE,EAGF,KAAK,aAAa,EAClB,KAAK,0BAA0B,EAC/B,KAAK,MAAM,EACX,KAAK,
|
|
1
|
+
{"version":3,"file":"cross_chain_test_harness.d.ts","sourceRoot":"","sources":["../../src/shared/cross_chain_test_harness.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,UAAU,EACV,KAAK,QAAQ,EACb,EAAE,EAGF,KAAK,aAAa,EAClB,KAAK,0BAA0B,EAC/B,KAAK,MAAM,EACX,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,MAAM,EAEZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,KAAK,wBAAwB,EAAE,KAAK,mBAAmB,EAAoB,MAAM,iBAAiB,CAAC;AAE5G,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAE3E,OAAO,EAAE,KAAK,GAAG,EAAe,MAAM,MAAM,CAAC;AAK7C;;;;;;;;;GASG;AACH,wBAAsB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cAAc,EAAE,MAAM,EACtB,YAAY,EAAE,EAAE,YAAU,EAC1B,WAAW,EAAE,WAAW,GACvB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IASzB,2BAA2B,CAAC,cAAc,EAAE,MAAM,EAAE,YAAY,GAAE,EAAY,GAAG,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IAS7G,qBAAqB,CAAC,KAAK,EAAE,YAAY;IAIzC,wBAAwB,CAAC,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM;IAMrE,oBAAoB,CAAC,KAAK,EAAE,YAAY;IAIxC,uBAAuB,CAAC,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM;IAKpE,oBAAoB,CAAC,cAAc,EAAE,MAAM,EAAE,UAAU,GAAE,UAA4B,GAAG,OAAO,CAAC,EAAE,CAAC;IASzG,2BAA2B,CACzB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAAG,MAAM,EAC5B,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC;IAW5B,qBAAqB,CAAC,YAAY,EAAE,MAAM;IAQ1C,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,KAAU;IAQjE;;;;;;OAMG;IACG,qBAAqB,CAAC,OAAO,EAAE,EAAE,GAAG,GAAG;IAS7C,mBAAmB,IAAI,iBAAiB;CAYzC"}
|
|
@@ -75,7 +75,6 @@ import { mintTokensToPrivate } from '../fixtures/token_utils.js';
|
|
|
75
75
|
* shared between cross chain tests.
|
|
76
76
|
*/ export class CrossChainTestHarness {
|
|
77
77
|
aztecNode;
|
|
78
|
-
pxeService;
|
|
79
78
|
logger;
|
|
80
79
|
l2Token;
|
|
81
80
|
l2Bridge;
|
|
@@ -86,20 +85,19 @@ import { mintTokensToPrivate } from '../fixtures/token_utils.js';
|
|
|
86
85
|
l1ContractAddresses;
|
|
87
86
|
wallet;
|
|
88
87
|
ownerAddress;
|
|
89
|
-
static async new(aztecNode,
|
|
88
|
+
static async new(aztecNode, l1Client, wallet, ownerAddress, logger, underlyingERC20Address) {
|
|
90
89
|
const ethAccount = EthAddress.fromString((await l1Client.getAddresses())[0]);
|
|
91
90
|
const l1ContractAddresses = (await aztecNode.getNodeInfo()).l1ContractAddresses;
|
|
92
91
|
// Deploy and initialize all required contracts
|
|
93
92
|
logger.info('Deploying and initializing token, portal and its bridge...');
|
|
94
93
|
const { token, bridge, tokenPortalAddress, underlyingERC20 } = await deployAndInitializeTokenAndBridgeContracts(wallet, l1Client, l1ContractAddresses.registryAddress, ownerAddress, underlyingERC20Address);
|
|
95
94
|
logger.info('Deployed and initialized token, portal and its bridge.');
|
|
96
|
-
return new CrossChainTestHarness(aztecNode,
|
|
95
|
+
return new CrossChainTestHarness(aztecNode, logger, token, bridge, ethAccount, tokenPortalAddress, underlyingERC20.address, l1Client, l1ContractAddresses, wallet, ownerAddress);
|
|
97
96
|
}
|
|
98
97
|
l1TokenManager;
|
|
99
98
|
l1TokenPortalManager;
|
|
100
|
-
constructor(/** Aztec node instance. */ aztecNode, /**
|
|
99
|
+
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){
|
|
101
100
|
this.aztecNode = aztecNode;
|
|
102
|
-
this.pxeService = pxeService;
|
|
103
101
|
this.logger = logger;
|
|
104
102
|
this.l2Token = l2Token;
|
|
105
103
|
this.l2Bridge = l2Bridge;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AztecAddress, type AztecNode, EthAddress, L1FeeJuicePortalManager, type L1TokenManager, type L2AmountClaim, type Logger, type
|
|
1
|
+
import { AztecAddress, type AztecNode, EthAddress, L1FeeJuicePortalManager, type L1TokenManager, type L2AmountClaim, type Logger, type Wallet } from '@aztec/aztec.js';
|
|
2
2
|
import type { ExtendedViemWalletClient } from '@aztec/ethereum';
|
|
3
3
|
import { FeeJuiceContract } from '@aztec/noir-contracts.js/FeeJuice';
|
|
4
4
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
@@ -12,7 +12,6 @@ export interface IGasBridgingTestHarness {
|
|
|
12
12
|
export interface FeeJuicePortalTestingHarnessFactoryConfig {
|
|
13
13
|
aztecNode: AztecNode;
|
|
14
14
|
aztecNodeAdmin?: AztecNodeAdmin;
|
|
15
|
-
pxeService: PXE;
|
|
16
15
|
l1Client: ExtendedViemWalletClient;
|
|
17
16
|
wallet: Wallet;
|
|
18
17
|
logger: Logger;
|
|
@@ -33,8 +32,8 @@ export declare class GasBridgingTestHarness implements IGasBridgingTestHarness {
|
|
|
33
32
|
aztecNode: AztecNode;
|
|
34
33
|
/** Aztec node admin interface */
|
|
35
34
|
aztecNodeAdmin: AztecNodeAdmin | undefined;
|
|
36
|
-
/**
|
|
37
|
-
|
|
35
|
+
/** Wallet. */
|
|
36
|
+
wallet: Wallet;
|
|
38
37
|
/** Logger. */
|
|
39
38
|
logger: Logger;
|
|
40
39
|
/** L2 Token/Bridge contract. */
|
|
@@ -56,8 +55,8 @@ export declare class GasBridgingTestHarness implements IGasBridgingTestHarness {
|
|
|
56
55
|
aztecNode: AztecNode,
|
|
57
56
|
/** Aztec node admin interface */
|
|
58
57
|
aztecNodeAdmin: AztecNodeAdmin | undefined,
|
|
59
|
-
/**
|
|
60
|
-
|
|
58
|
+
/** Wallet. */
|
|
59
|
+
wallet: Wallet,
|
|
61
60
|
/** Logger. */
|
|
62
61
|
logger: Logger,
|
|
63
62
|
/** L2 Token/Bridge contract. */
|
|
@@ -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,EACL,YAAY,EACZ,KAAK,SAAS,EACd,UAAU,EAEV,uBAAuB,EACvB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,MAAM,EACX,KAAK,
|
|
1
|
+
{"version":3,"file":"gas_portal_test_harness.d.ts","sourceRoot":"","sources":["../../src/shared/gas_portal_test_harness.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,KAAK,SAAS,EACd,UAAU,EAEV,uBAAuB,EACvB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,MAAM,EACX,KAAK,MAAM,EAEZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAErE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEtE,MAAM,WAAW,uBAAuB;IACtC,oBAAoB,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC3D,iBAAiB,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IAC/D,gBAAgB,CAAC,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5E,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,iBAAiB,EAAE,UAAU,CAAC;CAC/B;AAED,MAAM,WAAW,yCAAyC;IACxD,SAAS,EAAE,SAAS,CAAC;IACrB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,QAAQ,EAAE,wBAAwB,CAAC;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,qBAAa,mCAAmC;IAC1B,OAAO,CAAC,MAAM;IA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,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,aAAa;IAMvG,oBAAoB,CAAC,KAAK,EAAE,YAAY;IAIxC,uBAAuB,CAAC,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM;IAKpE,iBAAiB,CAAC,KAAK,EAAE,YAAY;IAerC,gBAAgB,CAAC,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY;YAQnD,cAAc;CAe7B"}
|
|
@@ -7,7 +7,7 @@ export class FeeJuicePortalTestingHarnessFactory {
|
|
|
7
7
|
this.config = config;
|
|
8
8
|
}
|
|
9
9
|
async createReal() {
|
|
10
|
-
const { aztecNode, aztecNodeAdmin,
|
|
10
|
+
const { aztecNode, aztecNodeAdmin, l1Client, wallet, logger } = this.config;
|
|
11
11
|
const ethAccount = EthAddress.fromString((await l1Client.getAddresses())[0]);
|
|
12
12
|
const l1ContractAddresses = (await aztecNode.getNodeInfo()).l1ContractAddresses;
|
|
13
13
|
const feeJuiceAddress = l1ContractAddresses.feeJuiceAddress;
|
|
@@ -16,7 +16,7 @@ export class FeeJuicePortalTestingHarnessFactory {
|
|
|
16
16
|
throw new Error('Fee Juice portal not deployed on L1');
|
|
17
17
|
}
|
|
18
18
|
const gasL2 = await FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, wallet);
|
|
19
|
-
return new GasBridgingTestHarness(aztecNode, aztecNodeAdmin,
|
|
19
|
+
return new GasBridgingTestHarness(aztecNode, aztecNodeAdmin, wallet, logger, gasL2, ethAccount, feeJuicePortalAddress, feeJuiceAddress, l1ContractAddresses.feeAssetHandlerAddress, l1Client);
|
|
20
20
|
}
|
|
21
21
|
static create(config) {
|
|
22
22
|
const factory = new FeeJuicePortalTestingHarnessFactory(config);
|
|
@@ -29,7 +29,7 @@ export class FeeJuicePortalTestingHarnessFactory {
|
|
|
29
29
|
*/ export class GasBridgingTestHarness {
|
|
30
30
|
aztecNode;
|
|
31
31
|
aztecNodeAdmin;
|
|
32
|
-
|
|
32
|
+
wallet;
|
|
33
33
|
logger;
|
|
34
34
|
feeJuice;
|
|
35
35
|
ethAccount;
|
|
@@ -39,10 +39,10 @@ export class FeeJuicePortalTestingHarnessFactory {
|
|
|
39
39
|
l1Client;
|
|
40
40
|
l1TokenManager;
|
|
41
41
|
feeJuicePortalManager;
|
|
42
|
-
constructor(/** Aztec node */ aztecNode, /** Aztec node admin interface */ aztecNodeAdmin, /**
|
|
42
|
+
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){
|
|
43
43
|
this.aztecNode = aztecNode;
|
|
44
44
|
this.aztecNodeAdmin = aztecNodeAdmin;
|
|
45
|
-
this.
|
|
45
|
+
this.wallet = wallet;
|
|
46
46
|
this.logger = logger;
|
|
47
47
|
this.feeJuice = feeJuice;
|
|
48
48
|
this.ethAccount = ethAccount;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AztecAddress, type AztecNode, type Logger
|
|
1
|
+
import { AztecAddress, type AztecNode, type Logger } from '@aztec/aztec.js';
|
|
2
2
|
import { CheatCodes } from '@aztec/aztec/testing';
|
|
3
3
|
import { type DeployL1ContractsReturnType, type ExtendedViemWalletClient } from '@aztec/ethereum';
|
|
4
4
|
import type { TestWallet } from '@aztec/test-wallet';
|
|
@@ -6,8 +6,6 @@ import type { TestWallet } from '@aztec/test-wallet';
|
|
|
6
6
|
export type UniswapSetupContext = {
|
|
7
7
|
/** Aztec Node instance */
|
|
8
8
|
aztecNode: AztecNode;
|
|
9
|
-
/** The Private eXecution Environment (PXE). */
|
|
10
|
-
pxe: PXE;
|
|
11
9
|
/** Logger instance named as the current test. */
|
|
12
10
|
logger: Logger;
|
|
13
11
|
/** The L1 wallet client, extended with public actions. */
|
|
@@ -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,
|
|
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,EAGZ,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,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,SAi+BnC,CAAC"}
|
|
@@ -25,7 +25,6 @@ export const uniswapL1L2TestSuite = (setup, cleanup, expectedForkBlockNumber = 1
|
|
|
25
25
|
const WETH9_ADDRESS = EthAddress.fromString('0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2');
|
|
26
26
|
const DAI_ADDRESS = EthAddress.fromString('0x6B175474E89094C44Da98b954EedeAC495271d0F');
|
|
27
27
|
let aztecNode;
|
|
28
|
-
let pxe;
|
|
29
28
|
let logger;
|
|
30
29
|
let l1Client;
|
|
31
30
|
let wallet;
|
|
@@ -46,7 +45,7 @@ export const uniswapL1L2TestSuite = (setup, cleanup, expectedForkBlockNumber = 1
|
|
|
46
45
|
let cheatCodes;
|
|
47
46
|
let version;
|
|
48
47
|
beforeAll(async ()=>{
|
|
49
|
-
({ aztecNode,
|
|
48
|
+
({ aztecNode, logger, l1Client, wallet, ownerAddress, sponsorAddress, deployL1ContractsValues, cheatCodes } = await setup());
|
|
50
49
|
if (Number(await l1Client.getBlockNumber()) < expectedForkBlockNumber) {
|
|
51
50
|
throw new Error('This test must be run on a fork of mainnet with the expected fork block');
|
|
52
51
|
}
|
|
@@ -58,9 +57,9 @@ export const uniswapL1L2TestSuite = (setup, cleanup, expectedForkBlockNumber = 1
|
|
|
58
57
|
sponsorAddress
|
|
59
58
|
]);
|
|
60
59
|
logger.info('Deploying DAI Portal, initializing and deploying l2 contract...');
|
|
61
|
-
daiCrossChainHarness = await CrossChainTestHarness.new(aztecNode,
|
|
60
|
+
daiCrossChainHarness = await CrossChainTestHarness.new(aztecNode, deployL1ContractsValues.l1Client, wallet, ownerAddress, logger, DAI_ADDRESS);
|
|
62
61
|
logger.info('Deploying WETH Portal, initializing and deploying l2 contract...');
|
|
63
|
-
wethCrossChainHarness = await CrossChainTestHarness.new(aztecNode,
|
|
62
|
+
wethCrossChainHarness = await CrossChainTestHarness.new(aztecNode, l1Client, wallet, ownerAddress, logger, WETH9_ADDRESS);
|
|
64
63
|
logger.info('Deploy Uniswap portal on L1 and L2...');
|
|
65
64
|
uniswapPortalAddress = await deployL1Contract(l1Client, UniswapPortalAbi, UniswapPortalBytecode).then(({ address })=>address);
|
|
66
65
|
uniswapPortal = getContract({
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { type AztecAddress, type AztecNode, type FeePaymentMethod
|
|
1
|
+
import { type AztecAddress, type AztecNode, type FeePaymentMethod } from '@aztec/aztec.js';
|
|
2
2
|
import type { Logger } from '@aztec/foundation/log';
|
|
3
3
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
4
4
|
import { TestWallet } from '@aztec/test-wallet';
|
|
5
5
|
export interface TestAccounts {
|
|
6
|
-
pxe: PXE;
|
|
7
6
|
aztecNode: AztecNode;
|
|
8
7
|
wallet: TestWallet;
|
|
9
8
|
accounts: AztecAddress[];
|
|
@@ -14,7 +13,7 @@ export interface TestAccounts {
|
|
|
14
13
|
tokenAddress: AztecAddress;
|
|
15
14
|
}
|
|
16
15
|
export declare function setupTestAccountsWithTokens(pxeUrl: string, nodeUrl: string, mintAmount: bigint, logger: Logger): Promise<TestAccounts>;
|
|
17
|
-
export declare function deploySponsoredTestAccounts(
|
|
16
|
+
export declare function deploySponsoredTestAccounts(wallet: TestWallet, aztecNode: AztecNode, mintAmount: bigint, logger: Logger, numberOfFundedWallets?: number): Promise<TestAccounts>;
|
|
18
17
|
export declare function deployTestAccountsWithTokens(pxeUrl: string, nodeUrl: string, l1RpcUrls: string[], mnemonicOrPrivateKey: string, mintAmount: bigint, logger: Logger, numberOfFundedWallets?: number): Promise<TestAccounts>;
|
|
19
18
|
export declare function performTransfers({ testAccounts, rounds, transferAmount, logger, feePaymentMethod, }: {
|
|
20
19
|
testAccounts: TestAccounts;
|
|
@@ -23,8 +22,9 @@ export declare function performTransfers({ testAccounts, rounds, transferAmount,
|
|
|
23
22
|
logger: Logger;
|
|
24
23
|
feePaymentMethod?: FeePaymentMethod;
|
|
25
24
|
}): Promise<void>;
|
|
26
|
-
export declare function
|
|
27
|
-
|
|
25
|
+
export declare function createWalletAndAztecNodeClient(nodeUrl: string, proverEnabled: boolean, logger: Logger): Promise<{
|
|
26
|
+
wallet: TestWallet;
|
|
27
|
+
aztecNode: AztecNode;
|
|
28
28
|
cleanup: () => Promise<void>;
|
|
29
29
|
}>;
|
|
30
30
|
//# sourceMappingURL=setup_test_wallets.d.ts.map
|
|
@@ -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,EACjB,KAAK,SAAS,EAEd,KAAK,gBAAgB,
|
|
1
|
+
{"version":3,"file":"setup_test_wallets.d.ts","sourceRoot":"","sources":["../../src/spartan/setup_test_wallets.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,SAAS,EAEd,KAAK,gBAAgB,EAQtB,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,SAAS,EAAE,SAAS,CAAC;IACrB,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,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,YAAY,CAAC,CA8BvB;AAED,wBAAsB,2BAA2B,CAC/C,MAAM,EAAE,UAAU,EAClB,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,MAAM,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