@aztec/end-to-end 0.84.0-nightly.20250408 → 0.84.0-nightly.20250410
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/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +2 -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 +3 -3
- package/dest/e2e_p2p/shared.d.ts +7 -1
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +30 -1
- package/dest/e2e_token_contract/token_contract_test.d.ts +2 -2
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/e2e_token_contract/token_contract_test.js +3 -3
- package/dest/fixtures/snapshot_manager.js +2 -2
- package/dest/fixtures/utils.js +1 -1
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +2 -1
- package/package.json +32 -32
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +4 -4
- package/src/e2e_p2p/shared.ts +33 -7
- package/src/e2e_token_contract/token_contract_test.ts +4 -4
- package/src/fixtures/snapshot_manager.ts +2 -2
- package/src/fixtures/utils.ts +1 -1
- package/src/spartan/setup_test_wallets.ts +2 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type AccountWallet, AztecAddress, type CompleteAddress, Fr, type Logger, type PXE, type TxHash } from '@aztec/aztec.js';
|
|
2
|
-
import {
|
|
2
|
+
import { InvalidAccountContract } from '@aztec/noir-contracts.js/InvalidAccount';
|
|
3
3
|
import { TokenBlacklistContract } from '@aztec/noir-contracts.js/TokenBlacklist';
|
|
4
4
|
import { type SubsystemsContext } from '../fixtures/snapshot_manager.js';
|
|
5
5
|
import { TokenSimulator } from '../simulators/token_simulator.js';
|
|
@@ -26,7 +26,7 @@ export declare class BlacklistTokenContractTest {
|
|
|
26
26
|
accounts: CompleteAddress[];
|
|
27
27
|
asset: TokenBlacklistContract;
|
|
28
28
|
tokenSim: TokenSimulator;
|
|
29
|
-
badAccount:
|
|
29
|
+
badAccount: InvalidAccountContract;
|
|
30
30
|
admin: AccountWallet;
|
|
31
31
|
other: AccountWallet;
|
|
32
32
|
blacklisted: AccountWallet;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blacklist_token_contract_test.d.ts","sourceRoot":"","sources":["../../src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAClB,YAAY,EACZ,KAAK,eAAe,EACpB,EAAE,EACF,KAAK,MAAM,EACX,KAAK,GAAG,EACR,KAAK,MAAM,EAGZ,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"blacklist_token_contract_test.d.ts","sourceRoot":"","sources":["../../src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAClB,YAAY,EACZ,KAAK,eAAe,EACpB,EAAE,EACF,KAAK,MAAM,EACX,KAAK,GAAG,EACR,KAAK,MAAM,EAGZ,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAEjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAIjF,OAAO,EAEL,KAAK,iBAAiB,EAIvB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAIlE,qBAAa,IAAI;IACf,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,aAAa,CAAS;IAE9B,SAAS;IAKT,UAAU;IAKV,eAAe;IAKf,YAAY;;;;;CAKb;AAED,qBAAa,0BAA0B;;IAGrC,MAAM,CAAC,KAAK,SAAK;IAEjB,OAAO,CAAC,eAAe,CAAmB;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,aAAa,EAAE,CAAM;IAC9B,GAAG,EAAG,GAAG,CAAC;IACV,QAAQ,EAAE,eAAe,EAAE,CAAM;IACjC,KAAK,EAAG,sBAAsB,CAAC;IAC/B,QAAQ,EAAG,cAAc,CAAC;IAC1B,UAAU,EAAG,sBAAsB,CAAC;IAEpC,KAAK,EAAG,aAAa,CAAC;IACtB,KAAK,EAAG,aAAa,CAAC;IACtB,WAAW,EAAG,aAAa,CAAC;gBAEhB,QAAQ,EAAE,MAAM;IAKtB,UAAU,CAAC,MAAM,GAAE,MAAyC;IAMlE;;;;OAIG;IACG,kBAAkB;IA2DlB,KAAK;IAIX,QAAQ,YACA,MAAM,SACL,CAAC,OAAO,EAAE,iBAAiB,KAAK,QAAQ,CAAC,CAAC,YACxC,CAAC,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,iBAAiB,KAAK,QAAQ,IAAI,CAAC,KACtE,QAAQ,IAAI,CAAC,CAAwD;IAElE,QAAQ;IAQR,yBAAyB,CAC7B,QAAQ,EAAE,sBAAsB,EAChC,SAAS,EAAE,YAAY,EACvB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,EAAE,EACd,MAAM,EAAE,MAAM;IAgBV,iBAAiB;CAmExB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getSchnorrWallet } from '@aztec/accounts/schnorr';
|
|
2
2
|
import { Fr, computeSecretHash, createLogger } from '@aztec/aztec.js';
|
|
3
3
|
import { MAX_NOTE_HASHES_PER_TX } from '@aztec/constants';
|
|
4
|
-
import {
|
|
4
|
+
import { InvalidAccountContract } from '@aztec/noir-contracts.js/InvalidAccount';
|
|
5
5
|
import { TokenBlacklistContract } from '@aztec/noir-contracts.js/TokenBlacklist';
|
|
6
6
|
import { jest } from '@jest/globals';
|
|
7
7
|
import { createSnapshotManager, deployAccounts, publicDeployAccounts } from '../fixtures/snapshot_manager.js';
|
|
@@ -81,7 +81,7 @@ export class BlacklistTokenContractTest {
|
|
|
81
81
|
this.asset = await TokenBlacklistContract.deploy(this.admin, this.admin.getAddress()).send().deployed();
|
|
82
82
|
this.logger.verbose(`Token deployed to ${this.asset.address}`);
|
|
83
83
|
this.logger.verbose(`Deploying bad account...`);
|
|
84
|
-
this.badAccount = await
|
|
84
|
+
this.badAccount = await InvalidAccountContract.deploy(this.wallets[0]).send().deployed();
|
|
85
85
|
this.logger.verbose(`Deployed to ${this.badAccount.address}.`);
|
|
86
86
|
await this.mineBlocks();
|
|
87
87
|
return {
|
|
@@ -93,7 +93,7 @@ export class BlacklistTokenContractTest {
|
|
|
93
93
|
this.asset = await TokenBlacklistContract.at(tokenContractAddress, this.wallets[0]);
|
|
94
94
|
this.logger.verbose(`Token contract address: ${this.asset.address}`);
|
|
95
95
|
this.tokenSim = new TokenSimulator(this.asset, this.wallets[0], this.logger, this.accounts.map((a)=>a.address));
|
|
96
|
-
this.badAccount = await
|
|
96
|
+
this.badAccount = await InvalidAccountContract.at(badAccountAddress, this.wallets[0]);
|
|
97
97
|
this.logger.verbose(`Bad account address: ${this.badAccount.address}`);
|
|
98
98
|
expect(await this.asset.methods.get_roles(this.admin.getAddress()).simulate()).toEqual(new Role().withAdmin().toNoirStruct());
|
|
99
99
|
});
|
package/dest/e2e_p2p/shared.d.ts
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import type { InitialAccountData } from '@aztec/accounts/testing';
|
|
2
2
|
import type { AztecNodeService } from '@aztec/aztec-node';
|
|
3
|
-
import { type Logger, type SentTx } from '@aztec/aztec.js';
|
|
3
|
+
import { type Logger, ProvenTx, type SentTx } from '@aztec/aztec.js';
|
|
4
4
|
import type { SpamContract } from '@aztec/noir-contracts.js/Spam';
|
|
5
|
+
import { PXEService } from '@aztec/pxe/server';
|
|
5
6
|
import type { NodeContext } from '../fixtures/setup_p2p_test.js';
|
|
6
7
|
export declare const submitComplexTxsTo: (logger: Logger, spamContract: SpamContract, numTxs: number, opts?: {
|
|
7
8
|
callPublic?: boolean;
|
|
8
9
|
}) => Promise<SentTx[]>;
|
|
9
10
|
export declare const createPXEServiceAndSubmitTransactions: (logger: Logger, node: AztecNodeService, numTxs: number, fundedAccount: InitialAccountData) => Promise<NodeContext>;
|
|
11
|
+
export declare function createPXEServiceAndPrepareTransactions(logger: Logger, node: AztecNodeService, numTxs: number, fundedAccount: InitialAccountData): Promise<{
|
|
12
|
+
pxeService: PXEService;
|
|
13
|
+
txs: ProvenTx[];
|
|
14
|
+
node: AztecNodeService;
|
|
15
|
+
}>;
|
|
10
16
|
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/e2e_p2p/shared.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/e2e_p2p/shared.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAM,KAAK,MAAM,EAAE,QAAQ,EAAE,KAAK,MAAM,EAAiD,MAAM,iBAAiB,CAAC;AAExH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,EAAE,UAAU,EAAyD,MAAM,mBAAmB,CAAC;AAEtG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAIjE,eAAO,MAAM,kBAAkB,WACrB,MAAM,gBACA,YAAY,UAClB,MAAM,SACR;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,sBAwB/B,CAAC;AAGF,eAAO,MAAM,qCAAqC,WACxC,MAAM,QACR,gBAAgB,UACd,MAAM,iBACC,kBAAkB,KAChC,QAAQ,WAAW,CAgBrB,CAAC;AAEF,wBAAsB,sCAAsC,CAC1D,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,gBAAgB,EACtB,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,kBAAkB,GAChC,OAAO,CAAC;IAAE,UAAU,EAAE,UAAU,CAAC;IAAC,GAAG,EAAE,QAAQ,EAAE,CAAC;IAAC,IAAI,EAAE,gBAAgB,CAAA;CAAE,CAAC,CAqB9E"}
|
package/dest/e2e_p2p/shared.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { getSchnorrAccount } from '@aztec/accounts/schnorr';
|
|
2
|
-
import { TxStatus } from '@aztec/aztec.js';
|
|
2
|
+
import { Fr, TxStatus, getContractInstanceFromDeployParams } from '@aztec/aztec.js';
|
|
3
|
+
import { timesAsync } from '@aztec/foundation/collection';
|
|
4
|
+
import { TestContract, TestContractArtifact } from '@aztec/noir-contracts.js/Test';
|
|
3
5
|
import { createPXEService, getPXEServiceConfig as getRpcConfig } from '@aztec/pxe/server';
|
|
4
6
|
import { submitTxsTo } from '../shared/submit-transactions.js';
|
|
5
7
|
// submits a set of transactions to the provided Private eXecution Environment (PXE)
|
|
@@ -38,3 +40,30 @@ export const createPXEServiceAndSubmitTransactions = async (logger, node, numTxs
|
|
|
38
40
|
node
|
|
39
41
|
};
|
|
40
42
|
};
|
|
43
|
+
export async function createPXEServiceAndPrepareTransactions(logger, node, numTxs, fundedAccount) {
|
|
44
|
+
const rpcConfig = getRpcConfig();
|
|
45
|
+
rpcConfig.proverEnabled = false;
|
|
46
|
+
const pxe = await createPXEService(node, rpcConfig, true);
|
|
47
|
+
const account = await getSchnorrAccount(pxe, fundedAccount.secret, fundedAccount.signingKey, fundedAccount.salt);
|
|
48
|
+
await account.register();
|
|
49
|
+
const wallet = await account.getWallet();
|
|
50
|
+
const testContractInstance = await getContractInstanceFromDeployParams(TestContractArtifact, {});
|
|
51
|
+
await wallet.registerContract({
|
|
52
|
+
instance: testContractInstance,
|
|
53
|
+
artifact: TestContractArtifact
|
|
54
|
+
});
|
|
55
|
+
const contract = await TestContract.at(testContractInstance.address, wallet);
|
|
56
|
+
const txs = await timesAsync(numTxs, async ()=>{
|
|
57
|
+
const tx = await contract.methods.emit_nullifier(Fr.random()).prove({
|
|
58
|
+
skipPublicSimulation: true
|
|
59
|
+
});
|
|
60
|
+
const txHash = await tx.getTxHash();
|
|
61
|
+
logger.info(`Tx prepared with hash ${txHash}`);
|
|
62
|
+
return tx;
|
|
63
|
+
});
|
|
64
|
+
return {
|
|
65
|
+
txs,
|
|
66
|
+
pxeService: pxe,
|
|
67
|
+
node
|
|
68
|
+
};
|
|
69
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type AccountWallet, type AztecNode, type CompleteAddress, type Logger } from '@aztec/aztec.js';
|
|
2
|
-
import {
|
|
2
|
+
import { InvalidAccountContract } from '@aztec/noir-contracts.js/InvalidAccount';
|
|
3
3
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
4
4
|
import { type SubsystemsContext } from '../fixtures/snapshot_manager.js';
|
|
5
5
|
import { TokenSimulator } from '../simulators/token_simulator.js';
|
|
@@ -13,7 +13,7 @@ export declare class TokenContractTest {
|
|
|
13
13
|
accounts: CompleteAddress[];
|
|
14
14
|
asset: TokenContract;
|
|
15
15
|
tokenSim: TokenSimulator;
|
|
16
|
-
badAccount:
|
|
16
|
+
badAccount: InvalidAccountContract;
|
|
17
17
|
node: AztecNode;
|
|
18
18
|
constructor(testName: string);
|
|
19
19
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token_contract_test.d.ts","sourceRoot":"","sources":["../../src/e2e_token_contract/token_contract_test.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,KAAK,eAAe,EAAE,KAAK,MAAM,EAAgB,MAAM,iBAAiB,CAAC;AACtH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"token_contract_test.d.ts","sourceRoot":"","sources":["../../src/e2e_token_contract/token_contract_test.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,KAAK,eAAe,EAAE,KAAK,MAAM,EAAgB,MAAM,iBAAiB,CAAC;AACtH,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAI/D,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,OAAO,EAAE,aAAa,EAAE,CAAM;IAC9B,QAAQ,EAAE,eAAe,EAAE,CAAM;IACjC,KAAK,EAAG,aAAa,CAAC;IACtB,QAAQ,EAAG,cAAc,CAAC;IAC1B,UAAU,EAAG,sBAAsB,CAAC;IACpC,IAAI,EAAG,SAAS,CAAC;gBAEL,QAAQ,EAAE,MAAM;IAO5B;;;;OAIG;IACG,kBAAkB;IAiElB,KAAK;IAIX,QAAQ,YACA,MAAM,SACL,CAAC,OAAO,EAAE,iBAAiB,KAAK,QAAQ,CAAC,CAAC,YACxC,CAAC,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,iBAAiB,KAAK,QAAQ,IAAI,CAAC,KACtE,QAAQ,IAAI,CAAC,CAAwD;IAElE,QAAQ;IAIR,iBAAiB;CAyCxB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getSchnorrWallet } from '@aztec/accounts/schnorr';
|
|
2
2
|
import { createLogger } from '@aztec/aztec.js';
|
|
3
|
-
import {
|
|
3
|
+
import { InvalidAccountContract } from '@aztec/noir-contracts.js/InvalidAccount';
|
|
4
4
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
5
5
|
import { jest } from '@jest/globals';
|
|
6
6
|
import { createSnapshotManager, deployAccounts, publicDeployAccounts } from '../fixtures/snapshot_manager.js';
|
|
@@ -46,7 +46,7 @@ export class TokenContractTest {
|
|
|
46
46
|
const asset = await TokenContract.deploy(this.wallets[0], this.accounts[0], TokenContractTest.TOKEN_NAME, TokenContractTest.TOKEN_SYMBOL, TokenContractTest.TOKEN_DECIMALS).send().deployed();
|
|
47
47
|
this.logger.verbose(`Token deployed to ${asset.address}`);
|
|
48
48
|
this.logger.verbose(`Deploying bad account...`);
|
|
49
|
-
this.badAccount = await
|
|
49
|
+
this.badAccount = await InvalidAccountContract.deploy(this.wallets[0]).send().deployed();
|
|
50
50
|
this.logger.verbose(`Deployed to ${this.badAccount.address}.`);
|
|
51
51
|
return {
|
|
52
52
|
tokenContractAddress: asset.address,
|
|
@@ -57,7 +57,7 @@ export class TokenContractTest {
|
|
|
57
57
|
this.asset = await TokenContract.at(tokenContractAddress, this.wallets[0]);
|
|
58
58
|
this.logger.verbose(`Token contract address: ${this.asset.address}`);
|
|
59
59
|
this.tokenSim = new TokenSimulator(this.asset, this.wallets[0], this.logger, this.accounts.map((a)=>a.address));
|
|
60
|
-
this.badAccount = await
|
|
60
|
+
this.badAccount = await InvalidAccountContract.at(badAccountAddress, this.wallets[0]);
|
|
61
61
|
this.logger.verbose(`Bad account address: ${this.badAccount.address}`);
|
|
62
62
|
expect(await this.asset.methods.get_admin().simulate()).toBe(this.accounts[0].address.toBigInt());
|
|
63
63
|
});
|
|
@@ -311,7 +311,7 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
311
311
|
const blobSink = await createBlobSinkServer({
|
|
312
312
|
l1ChainId: aztecNodeConfig.l1ChainId,
|
|
313
313
|
l1RpcUrls: aztecNodeConfig.l1RpcUrls,
|
|
314
|
-
|
|
314
|
+
l1Contracts: aztecNodeConfig.l1Contracts,
|
|
315
315
|
port: blobSinkPort,
|
|
316
316
|
dataDirectory: aztecNodeConfig.dataDirectory,
|
|
317
317
|
dataStoreMapSizeKB: aztecNodeConfig.dataStoreMapSizeKB
|
|
@@ -404,7 +404,7 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
404
404
|
const blobSink = await createBlobSinkServer({
|
|
405
405
|
l1ChainId: aztecNodeConfig.l1ChainId,
|
|
406
406
|
l1RpcUrls: aztecNodeConfig.l1RpcUrls,
|
|
407
|
-
|
|
407
|
+
l1Contracts: aztecNodeConfig.l1Contracts,
|
|
408
408
|
port: blobSinkPort,
|
|
409
409
|
dataDirectory: statePath,
|
|
410
410
|
dataStoreMapSizeKB: aztecNodeConfig.dataStoreMapSizeKB
|
package/dest/fixtures/utils.js
CHANGED
|
@@ -300,7 +300,7 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
300
300
|
const blobSink = await createBlobSinkServer({
|
|
301
301
|
l1ChainId: config.l1ChainId,
|
|
302
302
|
l1RpcUrls: config.l1RpcUrls,
|
|
303
|
-
|
|
303
|
+
l1Contracts: config.l1Contracts,
|
|
304
304
|
port: blobSinkPort,
|
|
305
305
|
dataDirectory: config.dataDirectory,
|
|
306
306
|
dataStoreMapSizeKB: config.dataStoreMapSizeKB
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup_test_wallets.d.ts","sourceRoot":"","sources":["../../src/spartan/setup_test_wallets.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,YAAY,EAKjB,KAAK,GAAG,EAIT,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAG/D,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,GAAG,CAAC;IACT,OAAO,EAAE,0BAA0B,EAAE,CAAC;IACtC,gBAAgB,EAAE,aAAa,CAAC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,0BAA0B,CAAC;IAC5C,YAAY,EAAE,YAAY,CAAC;CAC5B;AAMD,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,WAAW,CAAC,CAYtB;AAED,wBAAsB,0BAA0B,CAC9C,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,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"setup_test_wallets.d.ts","sourceRoot":"","sources":["../../src/spartan/setup_test_wallets.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,YAAY,EAKjB,KAAK,GAAG,EAIT,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAG/D,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,GAAG,CAAC;IACT,OAAO,EAAE,0BAA0B,EAAE,CAAC;IACtC,gBAAgB,EAAE,aAAa,CAAC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,0BAA0B,CAAC;IAC5C,YAAY,EAAE,YAAY,CAAC;CAC5B;AAMD,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,WAAW,CAAC,CAYtB;AAED,wBAAsB,0BAA0B,CAC9C,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,WAAW,CAAC,CAqCtB;AA6DD,wBAAsB,gBAAgB,CAAC,EACrC,WAAW,EACX,MAAM,EACN,cAAc,EACd,MAAM,GACP,EAAE;IACD,WAAW,EAAE,WAAW,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;CAChB,iBAkBA"}
|
|
@@ -29,7 +29,8 @@ export async function deployTestWalletWithTokens(pxeUrl, nodeUrl, l1RpcUrls, mne
|
|
|
29
29
|
const recipientWallet = await getSchnorrWalletWithSecretKey(pxe, recipient.secret, recipient.signingKey, recipient.salt);
|
|
30
30
|
const fundedAccounts = await Promise.all(funded.map((a)=>getSchnorrAccount(pxe, a.secret, a.signingKey, a.salt)));
|
|
31
31
|
const claims = await Promise.all(fundedAccounts.map((a)=>bridgeL1FeeJuice(l1RpcUrls, mnemonicOrPrivateKey, pxe, a.getAddress(), undefined, logger)));
|
|
32
|
-
// Progress by
|
|
32
|
+
// Progress by 3 L2 blocks so that the l1ToL2Message added above will be available to use on L2.
|
|
33
|
+
await advanceL2Block(node);
|
|
33
34
|
await advanceL2Block(node);
|
|
34
35
|
await advanceL2Block(node);
|
|
35
36
|
const wallets = await Promise.all(fundedAccounts.map(async (a, i)=>{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/end-to-end",
|
|
3
|
-
"version": "0.84.0-nightly.
|
|
3
|
+
"version": "0.84.0-nightly.20250410",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": "./dest/index.js",
|
|
6
6
|
"inherits": [
|
|
@@ -26,37 +26,37 @@
|
|
|
26
26
|
"formatting": "run -T prettier --check ./src && run -T eslint ./src"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@aztec/accounts": "0.84.0-nightly.
|
|
30
|
-
"@aztec/archiver": "0.84.0-nightly.
|
|
31
|
-
"@aztec/aztec": "0.84.0-nightly.
|
|
32
|
-
"@aztec/aztec-node": "0.84.0-nightly.
|
|
33
|
-
"@aztec/aztec.js": "0.84.0-nightly.
|
|
34
|
-
"@aztec/bb-prover": "0.84.0-nightly.
|
|
35
|
-
"@aztec/blob-lib": "0.84.0-nightly.
|
|
36
|
-
"@aztec/blob-sink": "0.84.0-nightly.
|
|
37
|
-
"@aztec/bot": "0.84.0-nightly.
|
|
38
|
-
"@aztec/constants": "0.84.0-nightly.
|
|
39
|
-
"@aztec/entrypoints": "0.84.0-nightly.
|
|
40
|
-
"@aztec/epoch-cache": "0.84.0-nightly.
|
|
41
|
-
"@aztec/ethereum": "0.84.0-nightly.
|
|
42
|
-
"@aztec/foundation": "0.84.0-nightly.
|
|
43
|
-
"@aztec/kv-store": "0.84.0-nightly.
|
|
44
|
-
"@aztec/l1-artifacts": "0.84.0-nightly.
|
|
45
|
-
"@aztec/merkle-tree": "0.84.0-nightly.
|
|
46
|
-
"@aztec/noir-contracts.js": "0.84.0-nightly.
|
|
47
|
-
"@aztec/noir-noirc_abi": "0.84.0-nightly.
|
|
48
|
-
"@aztec/noir-protocol-circuits-types": "0.84.0-nightly.
|
|
49
|
-
"@aztec/p2p": "0.84.0-nightly.
|
|
50
|
-
"@aztec/protocol-contracts": "0.84.0-nightly.
|
|
51
|
-
"@aztec/prover-client": "0.84.0-nightly.
|
|
52
|
-
"@aztec/prover-node": "0.84.0-nightly.
|
|
53
|
-
"@aztec/pxe": "0.84.0-nightly.
|
|
54
|
-
"@aztec/sequencer-client": "0.84.0-nightly.
|
|
55
|
-
"@aztec/simulator": "0.84.0-nightly.
|
|
56
|
-
"@aztec/stdlib": "0.84.0-nightly.
|
|
57
|
-
"@aztec/telemetry-client": "0.84.0-nightly.
|
|
58
|
-
"@aztec/validator-client": "0.84.0-nightly.
|
|
59
|
-
"@aztec/world-state": "0.84.0-nightly.
|
|
29
|
+
"@aztec/accounts": "0.84.0-nightly.20250410",
|
|
30
|
+
"@aztec/archiver": "0.84.0-nightly.20250410",
|
|
31
|
+
"@aztec/aztec": "0.84.0-nightly.20250410",
|
|
32
|
+
"@aztec/aztec-node": "0.84.0-nightly.20250410",
|
|
33
|
+
"@aztec/aztec.js": "0.84.0-nightly.20250410",
|
|
34
|
+
"@aztec/bb-prover": "0.84.0-nightly.20250410",
|
|
35
|
+
"@aztec/blob-lib": "0.84.0-nightly.20250410",
|
|
36
|
+
"@aztec/blob-sink": "0.84.0-nightly.20250410",
|
|
37
|
+
"@aztec/bot": "0.84.0-nightly.20250410",
|
|
38
|
+
"@aztec/constants": "0.84.0-nightly.20250410",
|
|
39
|
+
"@aztec/entrypoints": "0.84.0-nightly.20250410",
|
|
40
|
+
"@aztec/epoch-cache": "0.84.0-nightly.20250410",
|
|
41
|
+
"@aztec/ethereum": "0.84.0-nightly.20250410",
|
|
42
|
+
"@aztec/foundation": "0.84.0-nightly.20250410",
|
|
43
|
+
"@aztec/kv-store": "0.84.0-nightly.20250410",
|
|
44
|
+
"@aztec/l1-artifacts": "0.84.0-nightly.20250410",
|
|
45
|
+
"@aztec/merkle-tree": "0.84.0-nightly.20250410",
|
|
46
|
+
"@aztec/noir-contracts.js": "0.84.0-nightly.20250410",
|
|
47
|
+
"@aztec/noir-noirc_abi": "0.84.0-nightly.20250410",
|
|
48
|
+
"@aztec/noir-protocol-circuits-types": "0.84.0-nightly.20250410",
|
|
49
|
+
"@aztec/p2p": "0.84.0-nightly.20250410",
|
|
50
|
+
"@aztec/protocol-contracts": "0.84.0-nightly.20250410",
|
|
51
|
+
"@aztec/prover-client": "0.84.0-nightly.20250410",
|
|
52
|
+
"@aztec/prover-node": "0.84.0-nightly.20250410",
|
|
53
|
+
"@aztec/pxe": "0.84.0-nightly.20250410",
|
|
54
|
+
"@aztec/sequencer-client": "0.84.0-nightly.20250410",
|
|
55
|
+
"@aztec/simulator": "0.84.0-nightly.20250410",
|
|
56
|
+
"@aztec/stdlib": "0.84.0-nightly.20250410",
|
|
57
|
+
"@aztec/telemetry-client": "0.84.0-nightly.20250410",
|
|
58
|
+
"@aztec/validator-client": "0.84.0-nightly.20250410",
|
|
59
|
+
"@aztec/world-state": "0.84.0-nightly.20250410",
|
|
60
60
|
"@iarna/toml": "^2.2.5",
|
|
61
61
|
"@jest/globals": "^29.5.0",
|
|
62
62
|
"@msgpack/msgpack": "^3.0.0-beta2",
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
createLogger,
|
|
12
12
|
} from '@aztec/aztec.js';
|
|
13
13
|
import { MAX_NOTE_HASHES_PER_TX } from '@aztec/constants';
|
|
14
|
-
import {
|
|
14
|
+
import { InvalidAccountContract } from '@aztec/noir-contracts.js/InvalidAccount';
|
|
15
15
|
import type { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
16
16
|
import { TokenBlacklistContract } from '@aztec/noir-contracts.js/TokenBlacklist';
|
|
17
17
|
|
|
@@ -67,7 +67,7 @@ export class BlacklistTokenContractTest {
|
|
|
67
67
|
accounts: CompleteAddress[] = [];
|
|
68
68
|
asset!: TokenBlacklistContract;
|
|
69
69
|
tokenSim!: TokenSimulator;
|
|
70
|
-
badAccount!:
|
|
70
|
+
badAccount!: InvalidAccountContract;
|
|
71
71
|
|
|
72
72
|
admin!: AccountWallet;
|
|
73
73
|
other!: AccountWallet;
|
|
@@ -119,7 +119,7 @@ export class BlacklistTokenContractTest {
|
|
|
119
119
|
this.logger.verbose(`Token deployed to ${this.asset.address}`);
|
|
120
120
|
|
|
121
121
|
this.logger.verbose(`Deploying bad account...`);
|
|
122
|
-
this.badAccount = await
|
|
122
|
+
this.badAccount = await InvalidAccountContract.deploy(this.wallets[0]).send().deployed();
|
|
123
123
|
this.logger.verbose(`Deployed to ${this.badAccount.address}.`);
|
|
124
124
|
|
|
125
125
|
await this.mineBlocks();
|
|
@@ -138,7 +138,7 @@ export class BlacklistTokenContractTest {
|
|
|
138
138
|
this.accounts.map(a => a.address),
|
|
139
139
|
);
|
|
140
140
|
|
|
141
|
-
this.badAccount = await
|
|
141
|
+
this.badAccount = await InvalidAccountContract.at(badAccountAddress, this.wallets[0]);
|
|
142
142
|
this.logger.verbose(`Bad account address: ${this.badAccount.address}`);
|
|
143
143
|
|
|
144
144
|
expect(await this.asset.methods.get_roles(this.admin.getAddress()).simulate()).toEqual(
|
package/src/e2e_p2p/shared.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { getSchnorrAccount } from '@aztec/accounts/schnorr';
|
|
2
2
|
import type { InitialAccountData } from '@aztec/accounts/testing';
|
|
3
3
|
import type { AztecNodeService } from '@aztec/aztec-node';
|
|
4
|
-
import { type Logger, type SentTx, TxStatus } from '@aztec/aztec.js';
|
|
4
|
+
import { Fr, type Logger, ProvenTx, type SentTx, TxStatus, getContractInstanceFromDeployParams } from '@aztec/aztec.js';
|
|
5
|
+
import { timesAsync } from '@aztec/foundation/collection';
|
|
5
6
|
import type { SpamContract } from '@aztec/noir-contracts.js/Spam';
|
|
6
|
-
import {
|
|
7
|
+
import { TestContract, TestContractArtifact } from '@aztec/noir-contracts.js/Test';
|
|
8
|
+
import { PXEService, createPXEService, getPXEServiceConfig as getRpcConfig } from '@aztec/pxe/server';
|
|
7
9
|
|
|
8
10
|
import type { NodeContext } from '../fixtures/setup_p2p_test.js';
|
|
9
11
|
import { submitTxsTo } from '../shared/submit-transactions.js';
|
|
@@ -60,9 +62,33 @@ export const createPXEServiceAndSubmitTransactions = async (
|
|
|
60
62
|
const wallet = await account.getWallet();
|
|
61
63
|
|
|
62
64
|
const txs = await submitTxsTo(pxeService, numTxs, wallet, logger);
|
|
63
|
-
return {
|
|
64
|
-
txs,
|
|
65
|
-
pxeService,
|
|
66
|
-
node,
|
|
67
|
-
};
|
|
65
|
+
return { txs, pxeService, node };
|
|
68
66
|
};
|
|
67
|
+
|
|
68
|
+
export async function createPXEServiceAndPrepareTransactions(
|
|
69
|
+
logger: Logger,
|
|
70
|
+
node: AztecNodeService,
|
|
71
|
+
numTxs: number,
|
|
72
|
+
fundedAccount: InitialAccountData,
|
|
73
|
+
): Promise<{ pxeService: PXEService; txs: ProvenTx[]; node: AztecNodeService }> {
|
|
74
|
+
const rpcConfig = getRpcConfig();
|
|
75
|
+
rpcConfig.proverEnabled = false;
|
|
76
|
+
const pxe = await createPXEService(node, rpcConfig, true);
|
|
77
|
+
|
|
78
|
+
const account = await getSchnorrAccount(pxe, fundedAccount.secret, fundedAccount.signingKey, fundedAccount.salt);
|
|
79
|
+
await account.register();
|
|
80
|
+
const wallet = await account.getWallet();
|
|
81
|
+
|
|
82
|
+
const testContractInstance = await getContractInstanceFromDeployParams(TestContractArtifact, {});
|
|
83
|
+
await wallet.registerContract({ instance: testContractInstance, artifact: TestContractArtifact });
|
|
84
|
+
const contract = await TestContract.at(testContractInstance.address, wallet);
|
|
85
|
+
|
|
86
|
+
const txs = await timesAsync(numTxs, async () => {
|
|
87
|
+
const tx = await contract.methods.emit_nullifier(Fr.random()).prove({ skipPublicSimulation: true });
|
|
88
|
+
const txHash = await tx.getTxHash();
|
|
89
|
+
logger.info(`Tx prepared with hash ${txHash}`);
|
|
90
|
+
return tx;
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
return { txs, pxeService: pxe, node };
|
|
94
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getSchnorrWallet } from '@aztec/accounts/schnorr';
|
|
2
2
|
import { type AccountWallet, type AztecNode, type CompleteAddress, type Logger, createLogger } from '@aztec/aztec.js';
|
|
3
|
-
import {
|
|
3
|
+
import { InvalidAccountContract } from '@aztec/noir-contracts.js/InvalidAccount';
|
|
4
4
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
5
5
|
|
|
6
6
|
import { jest } from '@jest/globals';
|
|
@@ -27,7 +27,7 @@ export class TokenContractTest {
|
|
|
27
27
|
accounts: CompleteAddress[] = [];
|
|
28
28
|
asset!: TokenContract;
|
|
29
29
|
tokenSim!: TokenSimulator;
|
|
30
|
-
badAccount!:
|
|
30
|
+
badAccount!: InvalidAccountContract;
|
|
31
31
|
node!: AztecNode;
|
|
32
32
|
|
|
33
33
|
constructor(testName: string) {
|
|
@@ -77,7 +77,7 @@ export class TokenContractTest {
|
|
|
77
77
|
this.logger.verbose(`Token deployed to ${asset.address}`);
|
|
78
78
|
|
|
79
79
|
this.logger.verbose(`Deploying bad account...`);
|
|
80
|
-
this.badAccount = await
|
|
80
|
+
this.badAccount = await InvalidAccountContract.deploy(this.wallets[0]).send().deployed();
|
|
81
81
|
this.logger.verbose(`Deployed to ${this.badAccount.address}.`);
|
|
82
82
|
|
|
83
83
|
return { tokenContractAddress: asset.address, badAccountAddress: this.badAccount.address };
|
|
@@ -94,7 +94,7 @@ export class TokenContractTest {
|
|
|
94
94
|
this.accounts.map(a => a.address),
|
|
95
95
|
);
|
|
96
96
|
|
|
97
|
-
this.badAccount = await
|
|
97
|
+
this.badAccount = await InvalidAccountContract.at(badAccountAddress, this.wallets[0]);
|
|
98
98
|
this.logger.verbose(`Bad account address: ${this.badAccount.address}`);
|
|
99
99
|
|
|
100
100
|
expect(await this.asset.methods.get_admin().simulate()).toBe(this.accounts[0].address.toBigInt());
|
|
@@ -414,7 +414,7 @@ async function setupFromFresh(
|
|
|
414
414
|
{
|
|
415
415
|
l1ChainId: aztecNodeConfig.l1ChainId,
|
|
416
416
|
l1RpcUrls: aztecNodeConfig.l1RpcUrls,
|
|
417
|
-
|
|
417
|
+
l1Contracts: aztecNodeConfig.l1Contracts,
|
|
418
418
|
port: blobSinkPort,
|
|
419
419
|
dataDirectory: aztecNodeConfig.dataDirectory,
|
|
420
420
|
dataStoreMapSizeKB: aztecNodeConfig.dataStoreMapSizeKB,
|
|
@@ -537,7 +537,7 @@ async function setupFromState(statePath: string, logger: Logger): Promise<Subsys
|
|
|
537
537
|
{
|
|
538
538
|
l1ChainId: aztecNodeConfig.l1ChainId,
|
|
539
539
|
l1RpcUrls: aztecNodeConfig.l1RpcUrls,
|
|
540
|
-
|
|
540
|
+
l1Contracts: aztecNodeConfig.l1Contracts,
|
|
541
541
|
port: blobSinkPort,
|
|
542
542
|
dataDirectory: statePath,
|
|
543
543
|
dataStoreMapSizeKB: aztecNodeConfig.dataStoreMapSizeKB,
|
package/src/fixtures/utils.ts
CHANGED
|
@@ -491,7 +491,7 @@ export async function setup(
|
|
|
491
491
|
{
|
|
492
492
|
l1ChainId: config.l1ChainId,
|
|
493
493
|
l1RpcUrls: config.l1RpcUrls,
|
|
494
|
-
|
|
494
|
+
l1Contracts: config.l1Contracts,
|
|
495
495
|
port: blobSinkPort,
|
|
496
496
|
dataDirectory: config.dataDirectory,
|
|
497
497
|
dataStoreMapSizeKB: config.dataStoreMapSizeKB,
|
|
@@ -73,7 +73,8 @@ export async function deployTestWalletWithTokens(
|
|
|
73
73
|
fundedAccounts.map(a => bridgeL1FeeJuice(l1RpcUrls, mnemonicOrPrivateKey, pxe, a.getAddress(), undefined, logger)),
|
|
74
74
|
);
|
|
75
75
|
|
|
76
|
-
// Progress by
|
|
76
|
+
// Progress by 3 L2 blocks so that the l1ToL2Message added above will be available to use on L2.
|
|
77
|
+
await advanceL2Block(node);
|
|
77
78
|
await advanceL2Block(node);
|
|
78
79
|
await advanceL2Block(node);
|
|
79
80
|
|