@aztec/end-to-end 3.0.0-nightly.20250924 → 3.0.0-nightly.20250926
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 +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +4 -7
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +1 -1
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +1 -1
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +1 -1
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +1 -1
- package/dest/e2e_deploy_contract/deploy_test.d.ts +1 -1
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.d.ts +1 -1
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.d.ts +1 -1
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.d.ts +2 -8
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +15 -21
- package/dest/e2e_token_contract/token_contract_test.d.ts +1 -1
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.d.ts +1 -1
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.d.ts +4 -7
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +37 -20
- package/dest/fixtures/snapshot_manager.d.ts +1 -1
- package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.js +4 -6
- package/dest/fixtures/utils.d.ts +1 -1
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +16 -28
- package/dest/fixtures/web3signer.d.ts +5 -0
- package/dest/fixtures/web3signer.d.ts.map +1 -0
- package/dest/fixtures/web3signer.js +42 -0
- package/dest/shared/submit-transactions.d.ts +1 -1
- package/dest/shared/submit-transactions.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.d.ts +1 -1
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.d.ts +3 -3
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +17 -19
- package/package.json +37 -37
- package/src/bench/client_flows/client_flows_benchmark.ts +3 -6
- 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_deploy_contract/deploy_test.ts +1 -1
- package/src/e2e_fees/bridging_race.notest.ts +1 -1
- package/src/e2e_fees/fees_test.ts +1 -1
- package/src/e2e_p2p/p2p_network.ts +1 -1
- package/src/e2e_p2p/shared.ts +19 -17
- package/src/e2e_token_contract/token_contract_test.ts +1 -1
- package/src/fixtures/e2e_prover_test.ts +1 -1
- package/src/fixtures/setup_p2p_test.ts +53 -24
- package/src/fixtures/snapshot_manager.ts +4 -6
- package/src/fixtures/utils.ts +17 -30
- package/src/fixtures/web3signer.ts +46 -0
- package/src/shared/submit-transactions.ts +1 -1
- package/src/shared/uniswap_l1_l2.ts +1 -1
- package/src/spartan/setup_test_wallets.ts +17 -26
package/dest/fixtures/utils.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SchnorrAccountContractArtifact } from '@aztec/accounts/schnorr';
|
|
2
|
-
import { generateSchnorrAccounts,
|
|
2
|
+
import { generateSchnorrAccounts, getInitialTestAccountsData } from '@aztec/accounts/testing';
|
|
3
3
|
import { createArchiver } from '@aztec/archiver';
|
|
4
4
|
import { AztecNodeService, getConfigEnvVars } from '@aztec/aztec-node';
|
|
5
|
-
import { BatchCall, createAztecNodeClient, createLogger,
|
|
5
|
+
import { BatchCall, createAztecNodeClient, createLogger, sleep, waitForNode } from '@aztec/aztec.js';
|
|
6
6
|
import { publishContractClass, publishInstance } from '@aztec/aztec.js/deployment';
|
|
7
7
|
import { AnvilTestWatcher, CheatCodes } from '@aztec/aztec/testing';
|
|
8
8
|
import { createBlobSinkClient } from '@aztec/blob-sink/client';
|
|
@@ -23,14 +23,12 @@ import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
|
|
|
23
23
|
import { MockGossipSubNetwork, getMockPubSubP2PServiceFactory } from '@aztec/p2p/test-helpers';
|
|
24
24
|
import { protocolContractTreeRoot } from '@aztec/protocol-contracts';
|
|
25
25
|
import { createProverNode } from '@aztec/prover-node';
|
|
26
|
-
import {
|
|
27
|
-
import { MemoryCircuitRecorder, SimulatorRecorderWrapper, WASMSimulator } from '@aztec/simulator/client';
|
|
28
|
-
import { FileCircuitRecorder } from '@aztec/simulator/testing';
|
|
26
|
+
import { getPXEServiceConfig } from '@aztec/pxe/server';
|
|
29
27
|
import { getContractClassFromArtifact, getContractInstanceFromInstantiationParams } from '@aztec/stdlib/contract';
|
|
30
28
|
import { tryStop } from '@aztec/stdlib/interfaces/server';
|
|
31
29
|
import { getConfigEnvVars as getTelemetryConfig, initTelemetryClient } from '@aztec/telemetry-client';
|
|
32
30
|
import { BenchmarkTelemetryClient } from '@aztec/telemetry-client/bench';
|
|
33
|
-
import { TestWallet, deployFundedSchnorrAccounts } from '@aztec/test-wallet';
|
|
31
|
+
import { TestWallet, deployFundedSchnorrAccounts } from '@aztec/test-wallet/server';
|
|
34
32
|
import { getGenesisValues } from '@aztec/world-state/testing';
|
|
35
33
|
import fs from 'fs/promises';
|
|
36
34
|
import getPort from 'get-port';
|
|
@@ -45,8 +43,8 @@ import { getBBConfig } from './get_bb_config.js';
|
|
|
45
43
|
import { isMetricsLoggingRequested, setupMetricsLogger } from './logging.js';
|
|
46
44
|
export { deployAndInitializeTokenAndBridgeContracts } from '../shared/cross_chain_test_harness.js';
|
|
47
45
|
export { startAnvil };
|
|
48
|
-
const {
|
|
49
|
-
const getAztecUrl = ()=>
|
|
46
|
+
const { AZTEC_NODE_URL = '' } = process.env;
|
|
47
|
+
const getAztecUrl = ()=>AZTEC_NODE_URL;
|
|
50
48
|
let telemetry = undefined;
|
|
51
49
|
function getTelemetryClient(partialConfig = {}) {
|
|
52
50
|
if (!telemetry) {
|
|
@@ -102,14 +100,10 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
102
100
|
if (!configuredDataDirectory) {
|
|
103
101
|
pxeServiceConfig.dataDirectory = path.join(tmpdir(), randomBytes(8).toString('hex'));
|
|
104
102
|
}
|
|
105
|
-
const
|
|
106
|
-
const
|
|
107
|
-
const simulatorWithRecorder = new SimulatorRecorderWrapper(simulator, recorder);
|
|
108
|
-
const pxe = await createPXEServiceWithSimulator(aztecNode, simulatorWithRecorder, pxeServiceConfig, {
|
|
103
|
+
const teardown = configuredDataDirectory ? ()=>Promise.resolve() : ()=>tryRmDir(pxeServiceConfig.dataDirectory);
|
|
104
|
+
const wallet = await TestWallet.create(aztecNode, pxeServiceConfig, {
|
|
109
105
|
useLogSuffix
|
|
110
106
|
});
|
|
111
|
-
const teardown = configuredDataDirectory ? ()=>Promise.resolve() : ()=>tryRmDir(pxeServiceConfig.dataDirectory);
|
|
112
|
-
const wallet = new TestWallet(pxe, aztecNode);
|
|
113
107
|
return {
|
|
114
108
|
wallet,
|
|
115
109
|
logger,
|
|
@@ -129,15 +123,9 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
129
123
|
const aztecNodeUrl = getAztecUrl();
|
|
130
124
|
logger.verbose(`Creating Aztec Node client to remote host ${aztecNodeUrl}`);
|
|
131
125
|
const aztecNode = createAztecNodeClient(aztecNodeUrl);
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
2,
|
|
136
|
-
3
|
|
137
|
-
], true));
|
|
138
|
-
await waitForPXE(pxeClient, logger);
|
|
139
|
-
logger.verbose('JSON RPC client connected to PXE');
|
|
140
|
-
logger.verbose(`Retrieving contract addresses from ${PXE_URL}`);
|
|
126
|
+
await waitForNode(aztecNode, logger);
|
|
127
|
+
logger.verbose('JSON RPC client connected to Aztec Node');
|
|
128
|
+
logger.verbose(`Retrieving contract addresses from ${aztecNodeUrl}`);
|
|
141
129
|
const { l1ContractAddresses, rollupVersion } = await aztecNode.getNodeInfo();
|
|
142
130
|
const l1Client = createExtendedL1Client(config.l1RpcUrls, account, foundry);
|
|
143
131
|
const deployL1ContractsValues = {
|
|
@@ -146,11 +134,11 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
146
134
|
rollupVersion
|
|
147
135
|
};
|
|
148
136
|
const ethCheatCodes = new EthCheatCodes(config.l1RpcUrls, new DateProvider());
|
|
149
|
-
const wallet =
|
|
137
|
+
const wallet = await TestWallet.create(aztecNode);
|
|
150
138
|
const cheatCodes = await CheatCodes.create(config.l1RpcUrls, wallet, aztecNode, new DateProvider());
|
|
151
139
|
const teardown = ()=>Promise.resolve();
|
|
152
140
|
logger.verbose('Populating wallet from already registered accounts...');
|
|
153
|
-
const initialFundedAccounts = await
|
|
141
|
+
const initialFundedAccounts = await getInitialTestAccountsData();
|
|
154
142
|
if (initialFundedAccounts.length < numberOfAccounts) {
|
|
155
143
|
throw new Error(`Required ${numberOfAccounts} accounts. Found ${initialFundedAccounts.length}.`);
|
|
156
144
|
// Deploy new accounts if there's a test that requires more funded accounts in the remote environment.
|
|
@@ -215,8 +203,8 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
215
203
|
if (!isAnvilTestChain(chain.id)) {
|
|
216
204
|
throw new Error(`No ETHEREUM_HOSTS set but non anvil chain requested`);
|
|
217
205
|
}
|
|
218
|
-
if (
|
|
219
|
-
throw new Error(`
|
|
206
|
+
if (AZTEC_NODE_URL) {
|
|
207
|
+
throw new Error(`AZTEC_NODE_URL provided but no ETHEREUM_HOSTS set. Refusing to run, please set both variables so tests can deploy L1 contracts to the same Anvil instance`);
|
|
220
208
|
}
|
|
221
209
|
const res = await startAnvil({
|
|
222
210
|
l1BlockTime: opts.ethereumSlotDuration,
|
|
@@ -263,7 +251,7 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
263
251
|
];
|
|
264
252
|
}
|
|
265
253
|
config.coinbase = EthAddress.fromString(publisherHdAccount.address);
|
|
266
|
-
if (
|
|
254
|
+
if (AZTEC_NODE_URL) {
|
|
267
255
|
// we are setting up against a remote environment, l1 contracts are assumed to already be deployed
|
|
268
256
|
return await setupWithRemoteEnvironment(publisherHdAccount, config, logger, numberOfAccounts);
|
|
269
257
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function createWeb3SignerKeystore(dir: string, ...privateKeys: string[]): Promise<void>;
|
|
2
|
+
export declare function refreshWeb3Signer(url: string): Promise<void>;
|
|
3
|
+
export declare function getWeb3SignerTestKeystoreDir(): string;
|
|
4
|
+
export declare function getWeb3SignerUrl(): string;
|
|
5
|
+
//# sourceMappingURL=web3signer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web3signer.d.ts","sourceRoot":"","sources":["../../src/fixtures/web3signer.ts"],"names":[],"mappings":"AAOA,wBAAsB,wBAAwB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,WAAW,EAAE,MAAM,EAAE,iBAcnF;AAED,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,MAAM,iBAKlD;AAED,wBAAgB,4BAA4B,IAAI,MAAM,CAOrD;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CAMzC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { sleep } from '@aztec/aztec.js';
|
|
2
|
+
import { randomBytes } from '@aztec/foundation/crypto';
|
|
3
|
+
import { mkdirSync } from 'node:fs';
|
|
4
|
+
import { writeFile } from 'node:fs/promises';
|
|
5
|
+
import { join } from 'node:path';
|
|
6
|
+
export async function createWeb3SignerKeystore(dir, ...privateKeys) {
|
|
7
|
+
const yaml = privateKeys.map((pk)=>`\
|
|
8
|
+
type: file-raw
|
|
9
|
+
keyType: SECP256K1
|
|
10
|
+
privateKey: ${pk}`).join('\n---\n');
|
|
11
|
+
// NOTE: nodejs stdlib can only create temp directories, not temp files!
|
|
12
|
+
// this write uses wx (write-exclusive) so it'll throw if the file already exists
|
|
13
|
+
const path = join(dir, `keystore-${randomBytes(4).toString('hex')}.yaml`);
|
|
14
|
+
await writeFile(path, yaml, {
|
|
15
|
+
flag: 'wx'
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
export async function refreshWeb3Signer(url) {
|
|
19
|
+
await fetch(new URL('reload', url), {
|
|
20
|
+
method: 'POST'
|
|
21
|
+
});
|
|
22
|
+
// give the service a chance to load up the new files
|
|
23
|
+
// 1s might not be enough if there are a lot of files to scan
|
|
24
|
+
await sleep(1000);
|
|
25
|
+
}
|
|
26
|
+
export function getWeb3SignerTestKeystoreDir() {
|
|
27
|
+
if (process.env.WEB3_SIGNER_TEST_KEYSTORE_DIR) {
|
|
28
|
+
mkdirSync(process.env.WEB3_SIGNER_TEST_KEYSTORE_DIR, {
|
|
29
|
+
recursive: true
|
|
30
|
+
});
|
|
31
|
+
return process.env.WEB3_SIGNER_TEST_KEYSTORE_DIR;
|
|
32
|
+
} else {
|
|
33
|
+
throw new Error('Web3signer not running');
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export function getWeb3SignerUrl() {
|
|
37
|
+
if (process.env.WEB3_SIGNER_URL) {
|
|
38
|
+
return process.env.WEB3_SIGNER_URL;
|
|
39
|
+
} else {
|
|
40
|
+
throw new Error('Web3signer not running');
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { AztecAddress, type Logger, type SentTx } from '@aztec/aztec.js';
|
|
2
|
-
import type { TestWallet } from '@aztec/test-wallet';
|
|
2
|
+
import type { TestWallet } from '@aztec/test-wallet/server';
|
|
3
3
|
export declare const submitTxsTo: (wallet: TestWallet, submitter: AztecAddress, numTxs: number, logger: Logger) => Promise<SentTx[]>;
|
|
4
4
|
//# sourceMappingURL=submit-transactions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"submit-transactions.d.ts","sourceRoot":"","sources":["../../src/shared/submit-transactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAsB,KAAK,MAAM,EAAE,KAAK,MAAM,EAAY,MAAM,iBAAiB,CAAC;AAEvG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"submit-transactions.d.ts","sourceRoot":"","sources":["../../src/shared/submit-transactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAsB,KAAK,MAAM,EAAE,KAAK,MAAM,EAAY,MAAM,iBAAiB,CAAC;AAEvG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAG5D,eAAO,MAAM,WAAW,GACtB,QAAQ,UAAU,EAClB,WAAW,YAAY,EACvB,QAAQ,MAAM,EACd,QAAQ,MAAM,KACb,OAAO,CAAC,MAAM,EAAE,CAqBlB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
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
|
-
import type { TestWallet } from '@aztec/test-wallet';
|
|
4
|
+
import type { TestWallet } from '@aztec/test-wallet/server';
|
|
5
5
|
/** Objects to be returned by the uniswap setup function */
|
|
6
6
|
export type UniswapSetupContext = {
|
|
7
7
|
/** Aztec Node instance */
|
|
@@ -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,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,
|
|
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,2BAA2B,CAAC;AAkB5D,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"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
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
|
-
import { TestWallet } from '@aztec/test-wallet';
|
|
4
|
+
import { TestWallet } from '@aztec/test-wallet/server';
|
|
5
5
|
export interface TestAccounts {
|
|
6
6
|
aztecNode: AztecNode;
|
|
7
7
|
wallet: TestWallet;
|
|
@@ -12,9 +12,9 @@ export interface TestAccounts {
|
|
|
12
12
|
recipientAddress: AztecAddress;
|
|
13
13
|
tokenAddress: AztecAddress;
|
|
14
14
|
}
|
|
15
|
-
export declare function setupTestAccountsWithTokens(
|
|
15
|
+
export declare function setupTestAccountsWithTokens(nodeUrl: string, mintAmount: bigint, logger: Logger): Promise<TestAccounts>;
|
|
16
16
|
export declare function deploySponsoredTestAccounts(wallet: TestWallet, aztecNode: AztecNode, mintAmount: bigint, logger: Logger, numberOfFundedWallets?: number): Promise<TestAccounts>;
|
|
17
|
-
export declare function deployTestAccountsWithTokens(
|
|
17
|
+
export declare function deployTestAccountsWithTokens(nodeUrl: string, l1RpcUrls: string[], mnemonicOrPrivateKey: string, mintAmount: bigint, logger: Logger, numberOfFundedWallets?: number): Promise<TestAccounts>;
|
|
18
18
|
export declare function performTransfers({ testAccounts, rounds, transferAmount, logger, feePaymentMethod, }: {
|
|
19
19
|
testAccounts: TestAccounts;
|
|
20
20
|
rounds: number;
|
|
@@ -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,EAOtB,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,2BAA2B,CAAC;AAMvD,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,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,YAAY,CAAC,CAyBvB;AAED,wBAAsB,2BAA2B,CAC/C,MAAM,EAAE,UAAU,EAClB,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,qBAAqB,SAAI,GACxB,OAAO,CAAC,YAAY,CAAC,CAqCvB;AAED,wBAAsB,4BAA4B,CAChD,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,CAgDvB;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,8BAA8B,CAClD,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,OAAO,EACtB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,SAAS,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CAAC,CAqBrF"}
|
|
@@ -1,33 +1,32 @@
|
|
|
1
|
-
import { generateSchnorrAccounts
|
|
2
|
-
import { FeeJuicePaymentMethodWithClaim, Fr, L1FeeJuicePortalManager, SponsoredFeePaymentMethod, createAztecNodeClient,
|
|
1
|
+
import { generateSchnorrAccounts } from '@aztec/accounts/testing';
|
|
2
|
+
import { FeeJuicePaymentMethodWithClaim, Fr, L1FeeJuicePortalManager, SponsoredFeePaymentMethod, createAztecNodeClient, retryUntil } from '@aztec/aztec.js';
|
|
3
3
|
import { createEthereumChain, createExtendedL1Client } from '@aztec/ethereum';
|
|
4
4
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
5
|
-
import {
|
|
6
|
-
import { TestWallet } from '@aztec/test-wallet';
|
|
5
|
+
import { registerInitialSandboxAccountsInWallet } from '@aztec/test-wallet';
|
|
6
|
+
import { TestWallet } from '@aztec/test-wallet/server';
|
|
7
7
|
import { getACVMConfig } from '../fixtures/get_acvm_config.js';
|
|
8
8
|
import { getBBConfig } from '../fixtures/get_bb_config.js';
|
|
9
9
|
import { getSponsoredFPCAddress, registerSponsoredFPC } from '../fixtures/utils.js';
|
|
10
10
|
const TOKEN_NAME = 'USDC';
|
|
11
11
|
const TOKEN_SYMBOL = 'USD';
|
|
12
12
|
const TOKEN_DECIMALS = 18n;
|
|
13
|
-
export async function setupTestAccountsWithTokens(
|
|
13
|
+
export async function setupTestAccountsWithTokens(nodeUrl, mintAmount, logger) {
|
|
14
14
|
const ACCOUNT_COUNT = 1; // TODO fix this to allow for 16 wallets again
|
|
15
|
-
const pxe = await createCompatibleClient(pxeUrl, logger);
|
|
16
15
|
const aztecNode = createAztecNodeClient(nodeUrl);
|
|
17
|
-
const wallet =
|
|
18
|
-
const [recipientAccount, ...accounts] = (await
|
|
16
|
+
const wallet = await TestWallet.create(aztecNode);
|
|
17
|
+
const [recipientAccount, ...accounts] = (await registerInitialSandboxAccountsInWallet(wallet)).slice(0, ACCOUNT_COUNT + 1);
|
|
19
18
|
const tokenAdmin = accounts[0];
|
|
20
|
-
const tokenAddress = await deployTokenAndMint(wallet, accounts
|
|
19
|
+
const tokenAddress = await deployTokenAndMint(wallet, accounts, tokenAdmin, mintAmount, undefined, logger);
|
|
21
20
|
const tokenContract = await TokenContract.at(tokenAddress, wallet);
|
|
22
21
|
return {
|
|
23
22
|
aztecNode,
|
|
24
|
-
accounts
|
|
23
|
+
accounts,
|
|
25
24
|
wallet,
|
|
26
|
-
tokenAdminAddress: tokenAdmin
|
|
25
|
+
tokenAdminAddress: tokenAdmin,
|
|
27
26
|
tokenName: TOKEN_NAME,
|
|
28
27
|
tokenAddress,
|
|
29
28
|
tokenContract,
|
|
30
|
-
recipientAddress: recipientAccount
|
|
29
|
+
recipientAddress: recipientAccount
|
|
31
30
|
};
|
|
32
31
|
}
|
|
33
32
|
export async function deploySponsoredTestAccounts(wallet, aztecNode, mintAmount, logger, numberOfFundedWallets = 1) {
|
|
@@ -67,10 +66,9 @@ export async function deploySponsoredTestAccounts(wallet, aztecNode, mintAmount,
|
|
|
67
66
|
recipientAddress: recipientAccount.getAddress()
|
|
68
67
|
};
|
|
69
68
|
}
|
|
70
|
-
export async function deployTestAccountsWithTokens(
|
|
71
|
-
const pxe = await createCompatibleClient(pxeUrl, logger);
|
|
69
|
+
export async function deployTestAccountsWithTokens(nodeUrl, l1RpcUrls, mnemonicOrPrivateKey, mintAmount, logger, numberOfFundedWallets = 1) {
|
|
72
70
|
const aztecNode = createAztecNodeClient(nodeUrl);
|
|
73
|
-
const wallet =
|
|
71
|
+
const wallet = await TestWallet.create(aztecNode);
|
|
74
72
|
const [recipient, ...funded] = await generateSchnorrAccounts(numberOfFundedWallets + 1);
|
|
75
73
|
const recipientAccount = await wallet.createSchnorrAccount(recipient.secret, recipient.salt);
|
|
76
74
|
const fundedAccounts = await Promise.all(funded.map((a)=>wallet.createSchnorrAccount(a.secret, a.salt)));
|
|
@@ -178,19 +176,19 @@ export async function createWalletAndAztecNodeClient(nodeUrl, proverEnabled, log
|
|
|
178
176
|
getBBConfig(logger),
|
|
179
177
|
getACVMConfig(logger)
|
|
180
178
|
]);
|
|
181
|
-
const
|
|
179
|
+
const pxeConfig = {
|
|
182
180
|
dataDirectory: undefined,
|
|
183
181
|
dataStoreMapSizeKB: 1024 * 1024,
|
|
184
182
|
...bbConfig,
|
|
185
183
|
...acvmConfig,
|
|
186
184
|
proverEnabled
|
|
187
|
-
}
|
|
188
|
-
const wallet =
|
|
185
|
+
};
|
|
186
|
+
const wallet = await TestWallet.create(aztecNode, pxeConfig);
|
|
189
187
|
return {
|
|
190
188
|
wallet,
|
|
191
189
|
aztecNode,
|
|
192
190
|
async cleanup () {
|
|
193
|
-
await
|
|
191
|
+
await wallet.stop();
|
|
194
192
|
await bbConfig?.cleanup();
|
|
195
193
|
await acvmConfig?.cleanup();
|
|
196
194
|
}
|
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.20250926",
|
|
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.20250926",
|
|
29
|
+
"@aztec/archiver": "3.0.0-nightly.20250926",
|
|
30
|
+
"@aztec/aztec": "3.0.0-nightly.20250926",
|
|
31
|
+
"@aztec/aztec-node": "3.0.0-nightly.20250926",
|
|
32
|
+
"@aztec/aztec.js": "3.0.0-nightly.20250926",
|
|
33
|
+
"@aztec/bb-prover": "3.0.0-nightly.20250926",
|
|
34
|
+
"@aztec/blob-lib": "3.0.0-nightly.20250926",
|
|
35
|
+
"@aztec/blob-sink": "3.0.0-nightly.20250926",
|
|
36
|
+
"@aztec/bot": "3.0.0-nightly.20250926",
|
|
37
|
+
"@aztec/cli": "3.0.0-nightly.20250926",
|
|
38
|
+
"@aztec/constants": "3.0.0-nightly.20250926",
|
|
39
|
+
"@aztec/entrypoints": "3.0.0-nightly.20250926",
|
|
40
|
+
"@aztec/epoch-cache": "3.0.0-nightly.20250926",
|
|
41
|
+
"@aztec/ethereum": "3.0.0-nightly.20250926",
|
|
42
|
+
"@aztec/foundation": "3.0.0-nightly.20250926",
|
|
43
|
+
"@aztec/kv-store": "3.0.0-nightly.20250926",
|
|
44
|
+
"@aztec/l1-artifacts": "3.0.0-nightly.20250926",
|
|
45
|
+
"@aztec/merkle-tree": "3.0.0-nightly.20250926",
|
|
46
|
+
"@aztec/node-keystore": "3.0.0-nightly.20250926",
|
|
47
|
+
"@aztec/noir-contracts.js": "3.0.0-nightly.20250926",
|
|
48
|
+
"@aztec/noir-noirc_abi": "3.0.0-nightly.20250926",
|
|
49
|
+
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.20250926",
|
|
50
|
+
"@aztec/noir-test-contracts.js": "3.0.0-nightly.20250926",
|
|
51
|
+
"@aztec/p2p": "3.0.0-nightly.20250926",
|
|
52
|
+
"@aztec/protocol-contracts": "3.0.0-nightly.20250926",
|
|
53
|
+
"@aztec/prover-client": "3.0.0-nightly.20250926",
|
|
54
|
+
"@aztec/prover-node": "3.0.0-nightly.20250926",
|
|
55
|
+
"@aztec/pxe": "3.0.0-nightly.20250926",
|
|
56
|
+
"@aztec/sequencer-client": "3.0.0-nightly.20250926",
|
|
57
|
+
"@aztec/simulator": "3.0.0-nightly.20250926",
|
|
58
|
+
"@aztec/slasher": "3.0.0-nightly.20250926",
|
|
59
|
+
"@aztec/stdlib": "3.0.0-nightly.20250926",
|
|
60
|
+
"@aztec/telemetry-client": "3.0.0-nightly.20250926",
|
|
61
|
+
"@aztec/test-wallet": "3.0.0-nightly.20250926",
|
|
62
|
+
"@aztec/validator-client": "3.0.0-nightly.20250926",
|
|
63
|
+
"@aztec/world-state": "3.0.0-nightly.20250926",
|
|
64
64
|
"@iarna/toml": "^2.2.5",
|
|
65
65
|
"@jest/globals": "^30.0.0",
|
|
66
66
|
"@noble/curves": "=1.0.0",
|
|
@@ -26,9 +26,9 @@ import { SponsoredFPCContract } from '@aztec/noir-contracts.js/SponsoredFPC';
|
|
|
26
26
|
import { TokenContract as BananaCoin, TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
27
27
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
28
28
|
import { getCanonicalFeeJuice } from '@aztec/protocol-contracts/fee-juice';
|
|
29
|
-
import { type PXEServiceConfig,
|
|
29
|
+
import { type PXEServiceConfig, getPXEServiceConfig } from '@aztec/pxe/server';
|
|
30
30
|
import { deriveSigningKey } from '@aztec/stdlib/keys';
|
|
31
|
-
import { TestWallet } from '@aztec/test-wallet';
|
|
31
|
+
import { TestWallet } from '@aztec/test-wallet/server';
|
|
32
32
|
|
|
33
33
|
import { MNEMONIC } from '../../fixtures/fixtures.js';
|
|
34
34
|
import {
|
|
@@ -215,19 +215,16 @@ export class ClientFlowsBenchmark {
|
|
|
215
215
|
this.coinbase = EthAddress.random();
|
|
216
216
|
|
|
217
217
|
const userPXEConfig = getPXEServiceConfig();
|
|
218
|
-
const l1Contracts = await aztecNode.getL1ContractAddresses();
|
|
219
218
|
const userPXEConfigWithContracts = {
|
|
220
219
|
...userPXEConfig,
|
|
221
220
|
proverEnabled: this.realProofs,
|
|
222
|
-
l1Contracts,
|
|
223
221
|
} as PXEServiceConfig;
|
|
224
222
|
|
|
225
|
-
this.
|
|
223
|
+
this.userWallet = await TestWallet.create(this.aztecNode, userPXEConfigWithContracts, {
|
|
226
224
|
loggers: {
|
|
227
225
|
prover: this.proxyLogger.createLogger('pxe:bb:wasm:bundle:proxied'),
|
|
228
226
|
},
|
|
229
227
|
});
|
|
230
|
-
this.userWallet = new TestWallet(this.userPXE, this.aztecNode);
|
|
231
228
|
},
|
|
232
229
|
);
|
|
233
230
|
}
|
|
@@ -12,7 +12,7 @@ import type { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
|
12
12
|
import { TokenBlacklistContract } from '@aztec/noir-contracts.js/TokenBlacklist';
|
|
13
13
|
import { InvalidAccountContract } from '@aztec/noir-test-contracts.js/InvalidAccount';
|
|
14
14
|
import type { SequencerClient } from '@aztec/sequencer-client';
|
|
15
|
-
import type { TestWallet } from '@aztec/test-wallet';
|
|
15
|
+
import type { TestWallet } from '@aztec/test-wallet/server';
|
|
16
16
|
|
|
17
17
|
import { jest } from '@jest/globals';
|
|
18
18
|
|
|
@@ -12,7 +12,7 @@ import { InboxAbi, OutboxAbi, TestERC20Abi, TestERC20Bytecode } from '@aztec/l1-
|
|
|
12
12
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
13
13
|
import { TokenBridgeContract } from '@aztec/noir-contracts.js/TokenBridge';
|
|
14
14
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
15
|
-
import type { TestWallet } from '@aztec/test-wallet';
|
|
15
|
+
import type { TestWallet } from '@aztec/test-wallet/server';
|
|
16
16
|
|
|
17
17
|
import { getContract } from 'viem';
|
|
18
18
|
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from '@aztec/aztec.js';
|
|
13
13
|
import type { StatefulTestContract } from '@aztec/noir-test-contracts.js/StatefulTest';
|
|
14
14
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
15
|
-
import type { TestWallet } from '@aztec/test-wallet';
|
|
15
|
+
import type { TestWallet } from '@aztec/test-wallet/server';
|
|
16
16
|
|
|
17
17
|
import { type ISnapshotManager, createSnapshotManager, deployAccounts } from '../fixtures/snapshot_manager.js';
|
|
18
18
|
|
|
@@ -2,7 +2,7 @@ import { SchnorrAccountContract } from '@aztec/accounts/schnorr';
|
|
|
2
2
|
import { Fr, type Logger, sleep } from '@aztec/aztec.js';
|
|
3
3
|
import { Fq } from '@aztec/foundation/fields';
|
|
4
4
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
|
-
import type { TestWallet } from '@aztec/test-wallet';
|
|
5
|
+
import type { TestWallet } from '@aztec/test-wallet/server';
|
|
6
6
|
|
|
7
7
|
import { jest } from '@jest/globals';
|
|
8
8
|
import type { Hex } from 'viem';
|
|
@@ -14,7 +14,7 @@ import { CounterContract } from '@aztec/noir-test-contracts.js/Counter';
|
|
|
14
14
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
15
15
|
import { getCanonicalFeeJuice } from '@aztec/protocol-contracts/fee-juice';
|
|
16
16
|
import { GasSettings } from '@aztec/stdlib/gas';
|
|
17
|
-
import { TestWallet } from '@aztec/test-wallet';
|
|
17
|
+
import { TestWallet } from '@aztec/test-wallet/server';
|
|
18
18
|
|
|
19
19
|
import { getContract } from 'viem';
|
|
20
20
|
|
|
@@ -25,7 +25,7 @@ import { tryStop } from '@aztec/stdlib/interfaces/server';
|
|
|
25
25
|
import { SlashFactoryContract } from '@aztec/stdlib/l1-contracts';
|
|
26
26
|
import type { PublicDataTreeLeaf } from '@aztec/stdlib/trees';
|
|
27
27
|
import { ZkPassportProofParams } from '@aztec/stdlib/zkpassport';
|
|
28
|
-
import type { TestWallet } from '@aztec/test-wallet';
|
|
28
|
+
import type { TestWallet } from '@aztec/test-wallet/server';
|
|
29
29
|
import { getGenesisValues } from '@aztec/world-state/testing';
|
|
30
30
|
|
|
31
31
|
import getPort from 'get-port';
|
package/src/e2e_p2p/shared.ts
CHANGED
|
@@ -16,13 +16,12 @@ import { timesAsync, unique } from '@aztec/foundation/collection';
|
|
|
16
16
|
import { pluralize } from '@aztec/foundation/string';
|
|
17
17
|
import type { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
|
|
18
18
|
import { TestContract, TestContractArtifact } from '@aztec/noir-test-contracts.js/Test';
|
|
19
|
-
import {
|
|
19
|
+
import { getPXEServiceConfig, getPXEServiceConfig as getRpcConfig } from '@aztec/pxe/server';
|
|
20
20
|
import { getRoundForOffense } from '@aztec/slasher';
|
|
21
21
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
22
22
|
import type { SlashFactoryContract } from '@aztec/stdlib/l1-contracts';
|
|
23
|
-
import { TestWallet } from '@aztec/test-wallet';
|
|
23
|
+
import { TestWallet } from '@aztec/test-wallet/server';
|
|
24
24
|
|
|
25
|
-
import type { NodeContext } from '../fixtures/setup_p2p_test.js';
|
|
26
25
|
import { submitTxsTo } from '../shared/submit-transactions.js';
|
|
27
26
|
|
|
28
27
|
// submits a set of transactions to the provided Private eXecution Environment (PXE)
|
|
@@ -55,33 +54,38 @@ export const submitComplexTxsTo = async (
|
|
|
55
54
|
return txs;
|
|
56
55
|
};
|
|
57
56
|
|
|
58
|
-
// creates
|
|
59
|
-
export const
|
|
57
|
+
// creates a wallet and submit a given number of transactions through it.
|
|
58
|
+
export const submitTransactions = async (
|
|
60
59
|
logger: Logger,
|
|
61
60
|
node: AztecNodeService,
|
|
62
61
|
numTxs: number,
|
|
63
62
|
fundedAccount: InitialAccountData,
|
|
64
|
-
): Promise<
|
|
63
|
+
): Promise<SentTx[]> => {
|
|
65
64
|
const rpcConfig = getRpcConfig();
|
|
66
65
|
rpcConfig.proverEnabled = false;
|
|
67
|
-
const
|
|
68
|
-
|
|
66
|
+
const wallet = await TestWallet.create(
|
|
67
|
+
node,
|
|
68
|
+
{ ...getPXEServiceConfig(), proverEnabled: false },
|
|
69
|
+
{ useLogSuffix: true },
|
|
70
|
+
);
|
|
69
71
|
const fundedAccountManager = await wallet.createSchnorrAccount(fundedAccount.secret, fundedAccount.salt);
|
|
70
|
-
|
|
71
|
-
return { txs, pxeService, node };
|
|
72
|
+
return submitTxsTo(wallet, fundedAccountManager.getAddress(), numTxs, logger);
|
|
72
73
|
};
|
|
73
74
|
|
|
74
|
-
export async function
|
|
75
|
+
export async function prepareTransactions(
|
|
75
76
|
logger: Logger,
|
|
76
77
|
node: AztecNodeService,
|
|
77
78
|
numTxs: number,
|
|
78
79
|
fundedAccount: InitialAccountData,
|
|
79
|
-
): Promise<
|
|
80
|
+
): Promise<ProvenTx[]> {
|
|
80
81
|
const rpcConfig = getRpcConfig();
|
|
81
82
|
rpcConfig.proverEnabled = false;
|
|
82
|
-
const pxe = await createPXEService(node, rpcConfig, { useLogSuffix: true });
|
|
83
83
|
|
|
84
|
-
const wallet =
|
|
84
|
+
const wallet = await TestWallet.create(
|
|
85
|
+
node,
|
|
86
|
+
{ ...getPXEServiceConfig(), proverEnabled: false },
|
|
87
|
+
{ useLogSuffix: true },
|
|
88
|
+
);
|
|
85
89
|
const fundedAccountManager = await wallet.createSchnorrAccount(fundedAccount.secret, fundedAccount.salt);
|
|
86
90
|
|
|
87
91
|
const testContractInstance = await getContractInstanceFromInstantiationParams(TestContractArtifact, {
|
|
@@ -90,14 +94,12 @@ export async function createPXEServiceAndPrepareTransactions(
|
|
|
90
94
|
await wallet.registerContract(testContractInstance, TestContractArtifact);
|
|
91
95
|
const contract = await TestContract.at(testContractInstance.address, wallet);
|
|
92
96
|
|
|
93
|
-
|
|
97
|
+
return timesAsync(numTxs, async () => {
|
|
94
98
|
const tx = await contract.methods.emit_nullifier(Fr.random()).prove({ from: fundedAccountManager.getAddress() });
|
|
95
99
|
const txHash = tx.getTxHash();
|
|
96
100
|
logger.info(`Tx prepared with hash ${txHash}`);
|
|
97
101
|
return tx;
|
|
98
102
|
});
|
|
99
|
-
|
|
100
|
-
return { txs, pxeService: pxe, node };
|
|
101
103
|
}
|
|
102
104
|
|
|
103
105
|
export function awaitProposalExecution(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
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
|
+
import type { TestWallet } from '@aztec/test-wallet/server';
|
|
5
5
|
|
|
6
6
|
import { jest } from '@jest/globals';
|
|
7
7
|
|
|
@@ -17,7 +17,7 @@ import { FeeAssetHandlerAbi } from '@aztec/l1-artifacts';
|
|
|
17
17
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
18
18
|
import { type ProverNode, type ProverNodeConfig, createProverNode } from '@aztec/prover-node';
|
|
19
19
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
20
|
-
import { TestWallet } from '@aztec/test-wallet';
|
|
20
|
+
import { TestWallet } from '@aztec/test-wallet/server';
|
|
21
21
|
import { getGenesisValues } from '@aztec/world-state/testing';
|
|
22
22
|
|
|
23
23
|
import { type Hex, getContract } from 'viem';
|