@aztec/end-to-end 3.0.0-nightly.20250910 → 3.0.0-nightly.20250911
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/bench/client_flows/client_flows_benchmark.d.ts +14 -12
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +35 -39
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +6 -4
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +3 -6
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +1 -1
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +38 -38
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +4 -5
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +1 -1
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +16 -20
- package/dest/e2e_deploy_contract/deploy_test.d.ts +2 -2
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
- package/dest/e2e_deploy_contract/deploy_test.js +4 -7
- package/dest/e2e_fees/bridging_race.notest.js +10 -8
- package/dest/e2e_fees/fees_test.d.ts +3 -4
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +26 -21
- package/dest/e2e_nested_contract/nested_contract_test.d.ts +2 -2
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +4 -6
- package/dest/e2e_p2p/p2p_network.d.ts +3 -2
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +6 -7
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +7 -9
- package/dest/e2e_token_contract/token_contract_test.d.ts +2 -4
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/e2e_token_contract/token_contract_test.js +13 -16
- package/dest/fixtures/e2e_prover_test.d.ts +4 -3
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +22 -29
- package/dest/fixtures/snapshot_manager.d.ts +6 -4
- package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.js +22 -12
- package/dest/fixtures/token_utils.d.ts +3 -3
- package/dest/fixtures/token_utils.d.ts.map +1 -1
- package/dest/fixtures/token_utils.js +8 -10
- package/dest/fixtures/utils.d.ts +7 -7
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +29 -25
- package/dest/shared/cross_chain_test_harness.d.ts +6 -6
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +5 -6
- package/dest/shared/gas_portal_test_harness.d.ts +1 -1
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/submit-transactions.d.ts +3 -3
- package/dest/shared/submit-transactions.d.ts.map +1 -1
- package/dest/shared/submit-transactions.js +4 -5
- package/dest/shared/uniswap_l1_l2.d.ts +6 -4
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +18 -21
- package/dest/simulators/lending_simulator.js +1 -1
- package/dest/spartan/setup_test_wallets.d.ts +12 -10
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +54 -50
- package/package.json +37 -36
- package/src/bench/client_flows/client_flows_benchmark.ts +41 -52
- package/src/bench/utils.ts +6 -6
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +39 -50
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +15 -33
- package/src/e2e_deploy_contract/deploy_test.ts +6 -14
- package/src/e2e_fees/bridging_race.notest.ts +12 -9
- package/src/e2e_fees/fees_test.ts +30 -30
- package/src/e2e_nested_contract/nested_contract_test.ts +6 -8
- package/src/e2e_p2p/p2p_network.ts +10 -10
- package/src/e2e_p2p/shared.ts +7 -16
- package/src/e2e_token_contract/token_contract_test.ts +14 -17
- package/src/fixtures/e2e_prover_test.ts +26 -60
- package/src/fixtures/snapshot_manager.ts +32 -24
- package/src/fixtures/token_utils.ts +7 -15
- package/src/fixtures/utils.ts +37 -41
- package/src/shared/cross_chain_test_harness.ts +5 -7
- package/src/shared/gas_portal_test_harness.ts +1 -1
- package/src/shared/submit-transactions.ts +7 -8
- package/src/shared/uniswap_l1_l2.ts +40 -36
- package/src/simulators/lending_simulator.ts +1 -1
- package/src/spartan/setup_test_wallets.ts +82 -73
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AztecAddress, EthAddress, createLogger } from '@aztec/aztec.js';
|
|
1
|
+
import { EthAddress, createLogger } from '@aztec/aztec.js';
|
|
3
2
|
import { CheatCodes } from '@aztec/aztec/testing';
|
|
4
3
|
import { createExtendedL1Client, deployL1Contract } from '@aztec/ethereum';
|
|
5
4
|
import { InboxAbi, OutboxAbi, TestERC20Abi, TestERC20Bytecode } from '@aztec/l1-artifacts';
|
|
@@ -13,19 +12,17 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
13
12
|
export class CrossChainMessagingTest {
|
|
14
13
|
snapshotManager;
|
|
15
14
|
logger;
|
|
16
|
-
accounts = [];
|
|
17
15
|
aztecNode;
|
|
18
16
|
pxe;
|
|
19
17
|
aztecNodeConfig;
|
|
20
18
|
aztecNodeAdmin;
|
|
21
19
|
l1Client;
|
|
22
|
-
|
|
20
|
+
wallet;
|
|
21
|
+
ownerAddress;
|
|
23
22
|
user1Address;
|
|
24
|
-
user2Wallet;
|
|
25
23
|
user2Address;
|
|
26
24
|
crossChainTestHarness;
|
|
27
25
|
ethAccount;
|
|
28
|
-
ownerAddress;
|
|
29
26
|
l2Token;
|
|
30
27
|
l2Bridge;
|
|
31
28
|
inbox;
|
|
@@ -55,23 +52,23 @@ export class CrossChainMessagingTest {
|
|
|
55
52
|
async applyBaseSnapshots() {
|
|
56
53
|
// Note that we are using the same `pxe`, `aztecNodeConfig` and `aztecNode` across all snapshots.
|
|
57
54
|
// This is to not have issues with different networks.
|
|
58
|
-
await this.snapshotManager.snapshot('3_accounts', deployAccounts(3, this.logger),
|
|
59
|
-
|
|
60
|
-
this.accounts = wallets.map((w)=>w.getCompleteAddress());
|
|
61
|
-
wallets.forEach((w, i)=>this.logger.verbose(`Wallet ${i} address: ${w.getAddress()}`));
|
|
62
|
-
this.user1Wallet = wallets[0];
|
|
63
|
-
this.user1Address = this.user1Wallet.getAddress();
|
|
64
|
-
this.user2Wallet = wallets[1];
|
|
65
|
-
this.user2Address = this.user2Wallet.getAddress();
|
|
55
|
+
await this.snapshotManager.snapshot('3_accounts', deployAccounts(3, this.logger), ({ deployedAccounts }, { pxe, wallet, aztecNodeConfig, aztecNode })=>{
|
|
56
|
+
[this.ownerAddress, this.user1Address, this.user2Address] = deployedAccounts.map((a)=>a.address);
|
|
66
57
|
this.pxe = pxe;
|
|
58
|
+
this.wallet = wallet;
|
|
67
59
|
this.aztecNode = aztecNode;
|
|
68
60
|
this.aztecNodeConfig = aztecNodeConfig;
|
|
61
|
+
return Promise.resolve();
|
|
69
62
|
});
|
|
70
63
|
await this.snapshotManager.snapshot('e2e_cross_chain_messaging', async ()=>{
|
|
71
64
|
// Create the token contract state.
|
|
72
65
|
// Move this account thing to addAccounts above?
|
|
73
66
|
this.logger.verbose(`Public deploy accounts...`);
|
|
74
|
-
await publicDeployAccounts(this.
|
|
67
|
+
await publicDeployAccounts(this.wallet, [
|
|
68
|
+
this.ownerAddress,
|
|
69
|
+
this.user1Address,
|
|
70
|
+
this.user2Address
|
|
71
|
+
]);
|
|
75
72
|
this.l1Client = createExtendedL1Client(this.aztecNodeConfig.l1RpcUrls, MNEMONIC);
|
|
76
73
|
const underlyingERC20Address = await deployL1Contract(this.l1Client, TestERC20Abi, TestERC20Bytecode, [
|
|
77
74
|
'Underlying',
|
|
@@ -79,15 +76,14 @@ export class CrossChainMessagingTest {
|
|
|
79
76
|
this.l1Client.account.address
|
|
80
77
|
]).then(({ address })=>address);
|
|
81
78
|
this.logger.verbose(`Setting up cross chain harness...`);
|
|
82
|
-
this.crossChainTestHarness = await CrossChainTestHarness.new(this.aztecNode, this.pxe, this.l1Client, this.
|
|
79
|
+
this.crossChainTestHarness = await CrossChainTestHarness.new(this.aztecNode, this.pxe, this.l1Client, this.wallet, this.ownerAddress, this.logger, underlyingERC20Address);
|
|
83
80
|
this.logger.verbose(`L2 token deployed to: ${this.crossChainTestHarness.l2Token.address}`);
|
|
84
81
|
return this.crossChainTestHarness.toCrossChainContext();
|
|
85
82
|
}, async (crossChainContext)=>{
|
|
86
|
-
this.l2Token = await TokenContract.at(crossChainContext.l2Token, this.
|
|
87
|
-
this.l2Bridge = await TokenBridgeContract.at(crossChainContext.l2Bridge, this.
|
|
83
|
+
this.l2Token = await TokenContract.at(crossChainContext.l2Token, this.wallet);
|
|
84
|
+
this.l2Bridge = await TokenBridgeContract.at(crossChainContext.l2Bridge, this.wallet);
|
|
88
85
|
// There is an issue with the reviver so we are getting strings sometimes. Working around it here.
|
|
89
86
|
this.ethAccount = EthAddress.fromString(crossChainContext.ethAccount.toString());
|
|
90
|
-
this.ownerAddress = AztecAddress.fromString(crossChainContext.ownerAddress.toString());
|
|
91
87
|
const tokenPortalAddress = EthAddress.fromString(crossChainContext.tokenPortal.toString());
|
|
92
88
|
const l1Client = createExtendedL1Client(this.aztecNodeConfig.l1RpcUrls, MNEMONIC);
|
|
93
89
|
const inbox = getContract({
|
|
@@ -100,7 +96,7 @@ export class CrossChainMessagingTest {
|
|
|
100
96
|
abi: OutboxAbi,
|
|
101
97
|
client: l1Client
|
|
102
98
|
});
|
|
103
|
-
this.crossChainTestHarness = new CrossChainTestHarness(this.aztecNode, this.pxe, this.logger, this.l2Token, this.l2Bridge, this.ethAccount, tokenPortalAddress, crossChainContext.underlying, l1Client, this.aztecNodeConfig.l1Contracts, this.
|
|
99
|
+
this.crossChainTestHarness = new CrossChainTestHarness(this.aztecNode, this.pxe, this.logger, this.l2Token, this.l2Bridge, this.ethAccount, tokenPortalAddress, crossChainContext.underlying, l1Client, this.aztecNodeConfig.l1Contracts, this.wallet, this.ownerAddress);
|
|
104
100
|
this.l1Client = l1Client;
|
|
105
101
|
this.inbox = inbox;
|
|
106
102
|
this.outbox = outbox;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type AztecAddress, type AztecNode, type ContractArtifact, type ContractBase, Fr, type Logger, type PXE, type PublicKeys, type Wallet } from '@aztec/aztec.js';
|
|
2
2
|
import type { StatefulTestContract } from '@aztec/noir-test-contracts.js/StatefulTest';
|
|
3
3
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
4
4
|
export declare class DeployTest {
|
|
5
5
|
private snapshotManager;
|
|
6
6
|
logger: Logger;
|
|
7
7
|
pxe: PXE;
|
|
8
|
-
wallet:
|
|
8
|
+
wallet: Wallet;
|
|
9
9
|
defaultAccountAddress: AztecAddress;
|
|
10
10
|
aztecNode: AztecNode;
|
|
11
11
|
aztecNodeAdmin: AztecNodeAdmin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy_test.d.ts","sourceRoot":"","sources":["../../src/e2e_deploy_contract/deploy_test.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"deploy_test.d.ts","sourceRoot":"","sources":["../../src/e2e_deploy_contract/deploy_test.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,EAAE,EACF,KAAK,MAAM,EACX,KAAK,GAAG,EACR,KAAK,UAAU,EACf,KAAK,MAAM,EAGZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AACvF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAMtE,qBAAa,UAAU;IACrB,OAAO,CAAC,eAAe,CAAmB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAG,GAAG,CAAC;IACV,MAAM,EAAG,MAAM,CAAC;IAChB,qBAAqB,EAAG,YAAY,CAAC;IACrC,SAAS,EAAG,SAAS,CAAC;IACtB,cAAc,EAAG,cAAc,CAAC;gBAE3B,QAAQ,EAAE,MAAM;IAKtB,KAAK;IAQL,QAAQ;YAIA,2BAA2B;IAOnC,gBAAgB,CAAC,CAAC,SAAS,YAAY,EAC3C,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,qBAAqB,CAAC,CAAC,CAAC,EAC1C,IAAI,GAAE;QACJ,IAAI,CAAC,EAAE,EAAE,CAAC;QACV,UAAU,CAAC,EAAE,UAAU,CAAC;QACxB,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC;QACjB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,EAAE,YAAY,CAAC;KACpB,GACL,OAAO,CAAC,CAAC,CAAC;IAaP,qBAAqB,IAAI,OAAO,CAAC,YAAY,CAAC;CAIrD;AAED,MAAM,MAAM,wBAAwB,GAAG,UAAU,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC;AAElG,MAAM,MAAM,qBAAqB,CAAC,CAAC,SAAS,YAAY,IAAI;IAC1D,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACtD,QAAQ,EAAE,gBAAgB,CAAC;CAC5B,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { getSchnorrWallet } from '@aztec/accounts/schnorr';
|
|
2
1
|
import { Fr, createLogger, getContractInstanceFromInstantiationParams } from '@aztec/aztec.js';
|
|
3
2
|
import { createSnapshotManager, deployAccounts } from '../fixtures/snapshot_manager.js';
|
|
4
3
|
const { E2E_DATA_PATH: dataPath } = process.env;
|
|
@@ -17,7 +16,7 @@ export class DeployTest {
|
|
|
17
16
|
async setup() {
|
|
18
17
|
await this.applyInitialAccountSnapshot();
|
|
19
18
|
const context = await this.snapshotManager.setup();
|
|
20
|
-
({ pxe: this.pxe, aztecNode: this.aztecNode } = context);
|
|
19
|
+
({ pxe: this.pxe, aztecNode: this.aztecNode, wallet: this.wallet } = context);
|
|
21
20
|
this.aztecNodeAdmin = context.aztecNode;
|
|
22
21
|
return this;
|
|
23
22
|
}
|
|
@@ -25,11 +24,9 @@ export class DeployTest {
|
|
|
25
24
|
await this.snapshotManager.teardown();
|
|
26
25
|
}
|
|
27
26
|
async applyInitialAccountSnapshot() {
|
|
28
|
-
await this.snapshotManager.snapshot('initial_account', deployAccounts(1, this.logger),
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
this.wallet = wallets[0];
|
|
32
|
-
this.defaultAccountAddress = this.wallet.getAddress();
|
|
27
|
+
await this.snapshotManager.snapshot('initial_account', deployAccounts(1, this.logger), ({ deployedAccounts })=>{
|
|
28
|
+
this.defaultAccountAddress = deployedAccounts[0].address;
|
|
29
|
+
return Promise.resolve();
|
|
33
30
|
});
|
|
34
31
|
}
|
|
35
32
|
async registerContract(wallet, contractArtifact, opts = {}) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SchnorrAccountContract } from '@aztec/accounts/schnorr';
|
|
2
2
|
import { Fr, sleep } from '@aztec/aztec.js';
|
|
3
3
|
import { Fq } from '@aztec/foundation/fields';
|
|
4
4
|
import { jest } from '@jest/globals';
|
|
@@ -18,22 +18,24 @@ describe('e2e_fees bridging_race', ()=>{
|
|
|
18
18
|
await t.applyInitialAccountsSnapshot();
|
|
19
19
|
await t.applyPublicDeployAccountsSnapshot();
|
|
20
20
|
await t.applySetupFeeJuiceSnapshot();
|
|
21
|
-
({
|
|
21
|
+
({ wallet, logger } = await t.setup());
|
|
22
22
|
});
|
|
23
23
|
afterAll(async ()=>{
|
|
24
24
|
await t.teardown();
|
|
25
25
|
});
|
|
26
26
|
let logger;
|
|
27
|
-
let pxe;
|
|
28
27
|
let bobsAddress;
|
|
28
|
+
let wallet;
|
|
29
29
|
beforeEach(async ()=>{
|
|
30
30
|
const bobsSecretKey = Fr.random();
|
|
31
31
|
const bobsPrivateSigningKey = Fq.random();
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
const bobsSalt = Fr.random();
|
|
33
|
+
const bobsAccountManager = await wallet.createAccount({
|
|
34
|
+
secret: bobsSecretKey,
|
|
35
|
+
salt: bobsSalt,
|
|
36
|
+
contract: new SchnorrAccountContract(bobsPrivateSigningKey)
|
|
37
|
+
});
|
|
38
|
+
bobsAddress = bobsAccountManager.getAddress();
|
|
37
39
|
});
|
|
38
40
|
it('Alice bridges funds to Bob', async ()=>{
|
|
39
41
|
// Tweak the token manager so the bridging happens immediately before the end of the current L2 slot
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type AztecAddress, type AztecNode, type Logger, type PXE } from '@aztec/aztec.js';
|
|
2
2
|
import { CheatCodes } from '@aztec/aztec/testing';
|
|
3
3
|
import { type DeployL1ContractsArgs, RollupContract } from '@aztec/ethereum';
|
|
4
4
|
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
@@ -10,6 +10,7 @@ import { SponsoredFPCContract } from '@aztec/noir-contracts.js/SponsoredFPC';
|
|
|
10
10
|
import { TokenContract as BananaCoin } from '@aztec/noir-contracts.js/Token';
|
|
11
11
|
import { CounterContract } from '@aztec/noir-test-contracts.js/Counter';
|
|
12
12
|
import { GasSettings } from '@aztec/stdlib/gas';
|
|
13
|
+
import { TestWallet } from '@aztec/test-wallet';
|
|
13
14
|
import { type SubsystemsContext } from '../fixtures/snapshot_manager.js';
|
|
14
15
|
import { type BalancesFn, type SetupOptions } from '../fixtures/utils.js';
|
|
15
16
|
import { type GasBridgingTestHarness } from '../shared/gas_portal_test_harness.js';
|
|
@@ -26,15 +27,13 @@ import { type GasBridgingTestHarness } from '../shared/gas_portal_test_harness.j
|
|
|
26
27
|
export declare class FeesTest {
|
|
27
28
|
private numberOfAccounts;
|
|
28
29
|
private snapshotManager;
|
|
29
|
-
private wallets;
|
|
30
30
|
private accounts;
|
|
31
31
|
logger: Logger;
|
|
32
32
|
pxe: PXE;
|
|
33
33
|
aztecNode: AztecNode;
|
|
34
34
|
cheatCodes: CheatCodes;
|
|
35
|
-
|
|
35
|
+
wallet: TestWallet;
|
|
36
36
|
aliceAddress: AztecAddress;
|
|
37
|
-
bobWallet: AccountWallet;
|
|
38
37
|
bobAddress: AztecAddress;
|
|
39
38
|
sequencerAddress: AztecAddress;
|
|
40
39
|
coinbase: EthAddress;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fees_test.d.ts","sourceRoot":"","sources":["../../src/e2e_fees/fees_test.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"fees_test.d.ts","sourceRoot":"","sources":["../../src/e2e_fees/fees_test.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,KAAK,MAAM,EAAE,KAAK,GAAG,EAAuB,MAAM,iBAAiB,CAAC;AAChH,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,KAAK,qBAAqB,EAAE,cAAc,EAA0B,MAAM,iBAAiB,CAAC;AACrG,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,C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AiB,CAAC;IAC5B,YAAY,EAAG,YAAY,CAAC;IAE5B,kBAAkB,EAAG,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IAC3C,2BAA2B,EAAG,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IACpD,eAAe,EAAG,UAAU,CAAC;IAC7B,wBAAwB,EAAG,UAAU,CAAC;IACtC,yBAAyB,EAAG,UAAU,CAAC;IACvC,YAAY,EAAG,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAE/D,SAAgB,qBAAqB,SAAgB;IACrD,SAAgB,mBAAmB,SAAgB;IACnD,SAAgB,0BAA0B,SAAgB;gBAGxD,QAAQ,EAAE,MAAM,EACR,gBAAgB,SAAI,EAC5B,YAAY,GAAE,OAAO,CAAC,YAAY,GAAG,qBAAqB,CAAM;IAgB5D,KAAK;IASL,QAAQ;IAKd,oBAAoB,CAAC,CAAC,EAAE,OAAO;IAIzB,kBAAkB;IAOlB,eAAe;;;;IAcf,qBAAqB,CAAC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY;IASzE,sFAAsF;IAChF,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY;IAajD,kBAAkB;IAOzB,4BAA4B;IAkC5B,iCAAiC;IAMjC,0BAA0B;IA4B1B,8BAA8B;IA6BvB,qBAAqB;IAoErB,8BAA8B;IAoB9B,yBAAyB;IAczB,gCAAgC;CAS9C"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SchnorrAccountContract } from '@aztec/accounts/schnorr';
|
|
2
2
|
import { createLogger, sleep } from '@aztec/aztec.js';
|
|
3
3
|
import { CheatCodes } from '@aztec/aztec/testing';
|
|
4
4
|
import { RollupContract, createExtendedL1Client } from '@aztec/ethereum';
|
|
@@ -31,15 +31,13 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
31
31
|
*/ export class FeesTest {
|
|
32
32
|
numberOfAccounts;
|
|
33
33
|
snapshotManager;
|
|
34
|
-
wallets;
|
|
35
34
|
accounts;
|
|
36
35
|
logger;
|
|
37
36
|
pxe;
|
|
38
37
|
aztecNode;
|
|
39
38
|
cheatCodes;
|
|
40
|
-
|
|
39
|
+
wallet;
|
|
41
40
|
aliceAddress;
|
|
42
|
-
bobWallet;
|
|
43
41
|
bobAddress;
|
|
44
42
|
sequencerAddress;
|
|
45
43
|
coinbase;
|
|
@@ -66,7 +64,6 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
66
64
|
APP_SPONSORED_TX_GAS_LIMIT;
|
|
67
65
|
constructor(testName, numberOfAccounts = 3, setupOptions = {}){
|
|
68
66
|
this.numberOfAccounts = numberOfAccounts;
|
|
69
|
-
this.wallets = [];
|
|
70
67
|
this.accounts = [];
|
|
71
68
|
this.ALICE_INITIAL_BANANAS = BigInt(1e22);
|
|
72
69
|
this.SUBSCRIPTION_AMOUNT = BigInt(1e19);
|
|
@@ -125,7 +122,7 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
125
122
|
const balanceBefore = await this.bananaCoin.methods.balance_of_private(address).simulate({
|
|
126
123
|
from: this.aliceAddress
|
|
127
124
|
});
|
|
128
|
-
await mintTokensToPrivate(this.bananaCoin, this.aliceAddress,
|
|
125
|
+
await mintTokensToPrivate(this.bananaCoin, this.aliceAddress, address, amount);
|
|
129
126
|
const balanceAfter = await this.bananaCoin.methods.balance_of_private(address).simulate({
|
|
130
127
|
from: this.aliceAddress
|
|
131
128
|
});
|
|
@@ -138,45 +135,53 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
138
135
|
await this.applyDeployBananaTokenSnapshot();
|
|
139
136
|
}
|
|
140
137
|
async applyInitialAccountsSnapshot() {
|
|
141
|
-
await this.snapshotManager.snapshot('initial_accounts', deployAccounts(this.numberOfAccounts, this.logger), async ({ deployedAccounts }, { pxe, aztecNode, aztecNodeConfig })=>{
|
|
138
|
+
await this.snapshotManager.snapshot('initial_accounts', deployAccounts(this.numberOfAccounts, this.logger), async ({ deployedAccounts }, { wallet, pxe, aztecNode, aztecNodeConfig })=>{
|
|
142
139
|
this.pxe = pxe;
|
|
140
|
+
this.wallet = wallet;
|
|
143
141
|
this.aztecNode = aztecNode;
|
|
144
142
|
this.gasSettings = GasSettings.default({
|
|
145
143
|
maxFeesPerGas: (await this.aztecNode.getCurrentBaseFees()).mul(2)
|
|
146
144
|
});
|
|
147
145
|
this.cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, pxe);
|
|
148
|
-
this.
|
|
149
|
-
this.
|
|
150
|
-
this.
|
|
151
|
-
|
|
152
|
-
|
|
146
|
+
this.accounts = deployedAccounts.map((a)=>a.address);
|
|
147
|
+
this.accounts.forEach((a, i)=>this.logger.verbose(`Account ${i} address: ${a}`));
|
|
148
|
+
[this.aliceAddress, this.bobAddress, this.sequencerAddress] = this.accounts.slice(0, 3);
|
|
149
|
+
await Promise.all(deployedAccounts.map(async (acc)=>{
|
|
150
|
+
const accountData = {
|
|
151
|
+
secret: acc.secret,
|
|
152
|
+
salt: acc.salt,
|
|
153
|
+
contract: new SchnorrAccountContract(acc.signingKey)
|
|
154
|
+
};
|
|
155
|
+
const accountManager = await this.wallet.createAccount(accountData);
|
|
156
|
+
return accountManager.register();
|
|
157
|
+
}));
|
|
153
158
|
// We set Alice as the FPC admin to avoid the need for deployment of another account.
|
|
154
159
|
this.fpcAdmin = this.aliceAddress;
|
|
155
160
|
const canonicalFeeJuice = await getCanonicalFeeJuice();
|
|
156
|
-
this.feeJuiceContract = await FeeJuiceContract.at(canonicalFeeJuice.address, this.
|
|
161
|
+
this.feeJuiceContract = await FeeJuiceContract.at(canonicalFeeJuice.address, this.wallet);
|
|
157
162
|
});
|
|
158
163
|
}
|
|
159
164
|
async applyPublicDeployAccountsSnapshot() {
|
|
160
|
-
await this.snapshotManager.snapshot('public_deploy_accounts', ()=>ensureAccountContractsPublished(this.
|
|
165
|
+
await this.snapshotManager.snapshot('public_deploy_accounts', ()=>ensureAccountContractsPublished(this.wallet, this.accounts));
|
|
161
166
|
}
|
|
162
167
|
async applySetupFeeJuiceSnapshot() {
|
|
163
168
|
await this.snapshotManager.snapshot('setup_fee_juice', async ()=>{}, async (_data, context)=>{
|
|
164
169
|
this.context = context;
|
|
165
|
-
this.feeJuiceContract = await FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, this.
|
|
170
|
+
this.feeJuiceContract = await FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, this.wallet);
|
|
166
171
|
this.getGasBalanceFn = getBalancesFn('⛽', this.feeJuiceContract.methods.balance_of_public, this.aliceAddress, this.logger);
|
|
167
172
|
this.feeJuiceBridgeTestHarness = await FeeJuicePortalTestingHarnessFactory.create({
|
|
168
173
|
aztecNode: context.aztecNode,
|
|
169
174
|
aztecNodeAdmin: context.aztecNode,
|
|
170
175
|
pxeService: context.pxe,
|
|
171
176
|
l1Client: context.deployL1ContractsValues.l1Client,
|
|
172
|
-
wallet: this.
|
|
177
|
+
wallet: this.wallet,
|
|
173
178
|
logger: this.logger
|
|
174
179
|
});
|
|
175
180
|
});
|
|
176
181
|
}
|
|
177
182
|
async applyDeployBananaTokenSnapshot() {
|
|
178
183
|
await this.snapshotManager.snapshot('deploy_banana_token', async ()=>{
|
|
179
|
-
const bananaCoin = await BananaCoin.deploy(this.
|
|
184
|
+
const bananaCoin = await BananaCoin.deploy(this.wallet, this.aliceAddress, 'BC', 'BC', 18n).send({
|
|
180
185
|
from: this.aliceAddress
|
|
181
186
|
}).deployed();
|
|
182
187
|
this.logger.info(`BananaCoin deployed at ${bananaCoin.address}`);
|
|
@@ -184,7 +189,7 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
184
189
|
bananaCoinAddress: bananaCoin.address
|
|
185
190
|
};
|
|
186
191
|
}, async ({ bananaCoinAddress })=>{
|
|
187
|
-
this.bananaCoin = await BananaCoin.at(bananaCoinAddress, this.
|
|
192
|
+
this.bananaCoin = await BananaCoin.at(bananaCoinAddress, this.wallet);
|
|
188
193
|
const logger = this.logger;
|
|
189
194
|
this.getBananaPublicBalanceFn = getBalancesFn('🍌.public', this.bananaCoin.methods.balance_of_public, this.aliceAddress, logger);
|
|
190
195
|
this.getBananaPrivateBalanceFn = getBalancesFn('🍌.private', this.bananaCoin.methods.balance_of_private, this.aliceAddress, logger);
|
|
@@ -195,7 +200,7 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
195
200
|
const feeJuiceContract = this.feeJuiceBridgeTestHarness.feeJuice;
|
|
196
201
|
expect((await context.pxe.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
|
|
197
202
|
const bananaCoin = this.bananaCoin;
|
|
198
|
-
const bananaFPC = await FPCContract.deploy(this.
|
|
203
|
+
const bananaFPC = await FPCContract.deploy(this.wallet, bananaCoin.address, this.fpcAdmin).send({
|
|
199
204
|
from: this.aliceAddress
|
|
200
205
|
}).deployed();
|
|
201
206
|
this.logger.info(`BananaPay deployed at ${bananaFPC.address}`);
|
|
@@ -207,7 +212,7 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
207
212
|
rollupAddress: context.deployL1ContractsValues.l1ContractAddresses.rollupAddress
|
|
208
213
|
};
|
|
209
214
|
}, async (data, context)=>{
|
|
210
|
-
const bananaFPC = await FPCContract.at(data.bananaFPCAddress, this.
|
|
215
|
+
const bananaFPC = await FPCContract.at(data.bananaFPCAddress, this.wallet);
|
|
211
216
|
this.bananaFPC = bananaFPC;
|
|
212
217
|
this.getCoinbaseBalance = async ()=>{
|
|
213
218
|
const l1Client = createExtendedL1Client(context.aztecNodeConfig.l1RpcUrls, MNEMONIC);
|
|
@@ -248,7 +253,7 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
248
253
|
sponsoredFPCAddress: sponsoredFPC.address
|
|
249
254
|
};
|
|
250
255
|
}, async (data)=>{
|
|
251
|
-
this.sponsoredFPC = await SponsoredFPCContract.at(data.sponsoredFPCAddress, this.
|
|
256
|
+
this.sponsoredFPC = await SponsoredFPCContract.at(data.sponsoredFPCAddress, this.wallet);
|
|
252
257
|
});
|
|
253
258
|
}
|
|
254
259
|
async applyFundAliceWithBananas() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AztecAddress, type Logger, type PXE, type Wallet } from '@aztec/aztec.js';
|
|
2
2
|
import { ChildContract } from '@aztec/noir-test-contracts.js/Child';
|
|
3
3
|
import { ParentContract } from '@aztec/noir-test-contracts.js/Parent';
|
|
4
4
|
import { type SubsystemsContext } from '../fixtures/snapshot_manager.js';
|
|
@@ -6,7 +6,7 @@ export declare class NestedContractTest {
|
|
|
6
6
|
private numberOfAccounts;
|
|
7
7
|
private snapshotManager;
|
|
8
8
|
logger: Logger;
|
|
9
|
-
wallet:
|
|
9
|
+
wallet: Wallet;
|
|
10
10
|
defaultAccountAddress: AztecAddress;
|
|
11
11
|
pxe: PXE;
|
|
12
12
|
parentContract: ParentContract;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nested_contract_test.d.ts","sourceRoot":"","sources":["../../src/e2e_nested_contract/nested_contract_test.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"nested_contract_test.d.ts","sourceRoot":"","sources":["../../src/e2e_nested_contract/nested_contract_test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,MAAM,EAAE,KAAK,GAAG,EAAE,KAAK,MAAM,EAAgB,MAAM,iBAAiB,CAAC;AACjG,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAEtE,OAAO,EAEL,KAAK,iBAAiB,EAIvB,MAAM,iCAAiC,CAAC;AAIzC,qBAAa,kBAAkB;IAY3B,OAAO,CAAC,gBAAgB;IAX1B,OAAO,CAAC,eAAe,CAAmB;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAG,MAAM,CAAC;IAChB,qBAAqB,EAAG,YAAY,CAAC;IACrC,GAAG,EAAG,GAAG,CAAC;IAEV,cAAc,EAAG,cAAc,CAAC;IAChC,aAAa,EAAG,aAAa,CAAC;gBAG5B,QAAQ,EAAE,MAAM,EACR,gBAAgB,SAAI;IAM9B;;;;OAIG;IACG,kBAAkB;IAsBlB,KAAK;IAIL,QAAQ;IAId,QAAQ,GAAI,CAAC,EACX,MAAM,MAAM,EACZ,OAAO,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,CAAC,CAAC,EACjD,UAAS,CAAC,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAA2B,KAChG,OAAO,CAAC,IAAI,CAAC,CAAwD;IAElE,oBAAoB;CAkB3B"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { getSchnorrWallet } from '@aztec/accounts/schnorr';
|
|
2
1
|
import { createLogger } from '@aztec/aztec.js';
|
|
3
2
|
import { ChildContract } from '@aztec/noir-test-contracts.js/Child';
|
|
4
3
|
import { ParentContract } from '@aztec/noir-test-contracts.js/Parent';
|
|
@@ -24,12 +23,11 @@ export class NestedContractTest {
|
|
|
24
23
|
* 1. Add 3 accounts.
|
|
25
24
|
* 2. Publicly deploy accounts
|
|
26
25
|
*/ async applyBaseSnapshots() {
|
|
27
|
-
await this.snapshotManager.snapshot('accounts', deployAccounts(this.numberOfAccounts, this.logger),
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
[this.wallet] = wallets;
|
|
31
|
-
this.defaultAccountAddress = this.wallet.getAddress();
|
|
26
|
+
await this.snapshotManager.snapshot('accounts', deployAccounts(this.numberOfAccounts, this.logger), ({ deployedAccounts }, { pxe, wallet })=>{
|
|
27
|
+
this.wallet = wallet;
|
|
28
|
+
[{ address: this.defaultAccountAddress }] = deployedAccounts;
|
|
32
29
|
this.pxe = pxe;
|
|
30
|
+
return Promise.resolve();
|
|
33
31
|
});
|
|
34
32
|
await this.snapshotManager.snapshot('public_deploy', async ()=>{}, async ()=>{
|
|
35
33
|
this.logger.verbose(`Public deploy accounts...`);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { InitialAccountData } from '@aztec/accounts/testing';
|
|
2
2
|
import type { AztecNodeConfig, AztecNodeService } from '@aztec/aztec-node';
|
|
3
|
-
import {
|
|
3
|
+
import { AztecAddress } from '@aztec/aztec.js';
|
|
4
4
|
import { type EmpireSlashingProposerContract, type Operator, RollupContract, type TallySlashingProposerContract, type ViemClient } from '@aztec/ethereum';
|
|
5
5
|
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
6
6
|
import { type Logger } from '@aztec/foundation/log';
|
|
@@ -9,6 +9,7 @@ import { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
|
|
|
9
9
|
import type { BootstrapNode } from '@aztec/p2p/bootstrap';
|
|
10
10
|
import { SlashFactoryContract } from '@aztec/stdlib/l1-contracts';
|
|
11
11
|
import type { PublicDataTreeLeaf } from '@aztec/stdlib/trees';
|
|
12
|
+
import type { TestWallet } from '@aztec/test-wallet';
|
|
12
13
|
import { type GetContractReturnType } from 'viem';
|
|
13
14
|
import { type SubsystemsContext } from '../fixtures/snapshot_manager.js';
|
|
14
15
|
export declare const WAIT_FOR_TX_TIMEOUT: number;
|
|
@@ -52,7 +53,7 @@ export declare class P2PNetworkTest {
|
|
|
52
53
|
validators: Operator[];
|
|
53
54
|
deployedAccounts: InitialAccountData[];
|
|
54
55
|
prefilledPublicData: PublicDataTreeLeaf[];
|
|
55
|
-
wallet?:
|
|
56
|
+
wallet?: TestWallet;
|
|
56
57
|
defaultAccountAddress?: AztecAddress;
|
|
57
58
|
spamContract?: SpamContract;
|
|
58
59
|
bootstrapNode?: BootstrapNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p2p_network.d.ts","sourceRoot":"","sources":["../../src/e2e_p2p/p2p_network.ts"],"names":[],"mappings":"
|
|
1
|
+
{"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,CAAC,EAAE,OAAO,CAAC;KAClC;IAwBD,IAAI,aAAa,uBAKhB;IAEK,gBAAgB;IActB,aAAa;;;IAkBP,kBAAkB;IA2ElB,YAAY;IAaZ,kBAAkB;IAsBlB,iBAAiB;IAgBjB,WAAW;;;;YAIH,YAAY;IAQpB,KAAK;IAcL,SAAS,CAAC,KAAK,EAAE,gBAAgB,EAAE;IAanC,QAAQ;IAMR,YAAY,IAAI,OAAO,CAAC;QAC5B,MAAM,EAAE,cAAc,CAAC;QACvB,eAAe,EAAE,qBAAqB,CAAC,OAAO,UAAU,EAAE,UAAU,CAAC,CAAC;QACtE,gBAAgB,EAAE,8BAA8B,GAAG,6BAA6B,GAAG,SAAS,CAAC;QAC7F,YAAY,EAAE,oBAAoB,CAAC;KACpC,CAAC;CA0BH"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { getSchnorrWalletWithSecretKey } from '@aztec/accounts/schnorr';
|
|
2
1
|
import { EthAddress, Fr } from '@aztec/aztec.js';
|
|
3
2
|
import { GSEContract, MultiAdderArtifact, RollupContract, createL1TxUtilsFromViemWallet, deployL1Contract, getL1ContractsConfigEnvVars } from '@aztec/ethereum';
|
|
4
3
|
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
@@ -160,7 +159,7 @@ export class P2PNetworkTest {
|
|
|
160
159
|
abi: MultiAdderArtifact.contractAbi,
|
|
161
160
|
client: deployL1ContractsValues.l1Client
|
|
162
161
|
});
|
|
163
|
-
const stakeNeeded =
|
|
162
|
+
const stakeNeeded = await rollup.read.getActivationThreshold() * BigInt(this.numberOfValidators);
|
|
164
163
|
await Promise.all([
|
|
165
164
|
await stakingAsset.write.mint([
|
|
166
165
|
multiAdder.address,
|
|
@@ -201,11 +200,11 @@ export class P2PNetworkTest {
|
|
|
201
200
|
});
|
|
202
201
|
}
|
|
203
202
|
async setupAccount() {
|
|
204
|
-
await this.snapshotManager.snapshot('setup-account', deployAccounts(1, this.logger
|
|
203
|
+
await this.snapshotManager.snapshot('setup-account', deployAccounts(1, this.logger), ({ deployedAccounts }, { wallet })=>{
|
|
205
204
|
this.deployedAccounts = deployedAccounts;
|
|
206
|
-
|
|
207
|
-
this.wallet =
|
|
208
|
-
|
|
205
|
+
[{ address: this.defaultAccountAddress }] = deployedAccounts;
|
|
206
|
+
this.wallet = wallet;
|
|
207
|
+
return Promise.resolve();
|
|
209
208
|
});
|
|
210
209
|
}
|
|
211
210
|
async deploySpamContract() {
|
|
@@ -280,7 +279,7 @@ export class P2PNetworkTest {
|
|
|
280
279
|
}
|
|
281
280
|
const rollup = new RollupContract(this.ctx.deployL1ContractsValues.l1Client, this.ctx.deployL1ContractsValues.l1ContractAddresses.rollupAddress);
|
|
282
281
|
const slasherContract = getContract({
|
|
283
|
-
address: getAddress(await rollup.
|
|
282
|
+
address: getAddress(await rollup.getSlasherAddress()),
|
|
284
283
|
abi: SlasherAbi,
|
|
285
284
|
client: this.ctx.deployL1ContractsValues.l1Client
|
|
286
285
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/e2e_p2p/shared.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/e2e_p2p/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EACL,YAAY,EAEZ,KAAK,MAAM,EACX,QAAQ,EACR,KAAK,MAAM,EAIZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,8BAA8B,EAAE,cAAc,EAAE,6BAA6B,EAAE,MAAM,iBAAiB,CAAC;AAErH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OA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SAAS,EACT,iBAAiB,EACjB,aAAa,GACd,EAAE;IACD,SAAS,EAAE,cAAc,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;CACvB,+CAiBA;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CAAC,EACzC,MAAM,EACN,UAAU,EACV,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,MAAM,EACN,YAAY,GACb,EAAE;IACD,MAAM,EAAE,cAAc,CAAC;IACvB,UAAU,EAAE,gBAAgB,CAAC;IAC7B,SAAS,EAAE,SAAS,KAAK,MAAM,EAAE,EAAE,CAAC;IACpC,YAAY,EAAE,oBAAoB,CAAC;IACnC,gBAAgB,EAAE,8BAA8B,GAAG,6BAA6B,GAAG,SAAS,CAAC;IAC7F,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,EAAE,gBAAgB,CAAC;IAC/B,MAAM,EAAE,MAAM,CAAC;CAChB,iBAkEA"}
|
package/dest/e2e_p2p/shared.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { getSchnorrAccount } from '@aztec/accounts/schnorr';
|
|
2
1
|
import { Fr, TxStatus, getContractInstanceFromInstantiationParams, retryUntil } from '@aztec/aztec.js';
|
|
3
2
|
import { timesAsync, unique } from '@aztec/foundation/collection';
|
|
4
3
|
import { TestContract, TestContractArtifact } from '@aztec/noir-test-contracts.js/Test';
|
|
5
4
|
import { createPXEService, getPXEServiceConfig as getRpcConfig } from '@aztec/pxe/server';
|
|
6
5
|
import { getRoundForOffense } from '@aztec/slasher';
|
|
6
|
+
import { TestWallet } from '@aztec/test-wallet';
|
|
7
7
|
import { submitTxsTo } from '../shared/submit-transactions.js';
|
|
8
8
|
// submits a set of transactions to the provided Private eXecution Environment (PXE)
|
|
9
9
|
export const submitComplexTxsTo = async (logger, from, spamContract, numTxs, opts = {})=>{
|
|
@@ -33,10 +33,9 @@ export const createPXEServiceAndSubmitTransactions = async (logger, node, numTxs
|
|
|
33
33
|
const pxeService = await createPXEService(node, rpcConfig, {
|
|
34
34
|
useLogSuffix: true
|
|
35
35
|
});
|
|
36
|
-
const
|
|
37
|
-
await
|
|
38
|
-
const
|
|
39
|
-
const txs = await submitTxsTo(pxeService, numTxs, wallet, logger);
|
|
36
|
+
const wallet = new TestWallet(pxeService);
|
|
37
|
+
const fundedAccountManager = await wallet.createSchnorrAccount(fundedAccount.secret, fundedAccount.salt);
|
|
38
|
+
const txs = await submitTxsTo(wallet, fundedAccountManager.getAddress(), numTxs, logger);
|
|
40
39
|
return {
|
|
41
40
|
txs,
|
|
42
41
|
pxeService,
|
|
@@ -49,9 +48,8 @@ export async function createPXEServiceAndPrepareTransactions(logger, node, numTx
|
|
|
49
48
|
const pxe = await createPXEService(node, rpcConfig, {
|
|
50
49
|
useLogSuffix: true
|
|
51
50
|
});
|
|
52
|
-
const
|
|
53
|
-
await
|
|
54
|
-
const wallet = await account.getWallet();
|
|
51
|
+
const wallet = new TestWallet(pxe);
|
|
52
|
+
const fundedAccountManager = await wallet.createSchnorrAccount(fundedAccount.secret, fundedAccount.salt);
|
|
55
53
|
const testContractInstance = await getContractInstanceFromInstantiationParams(TestContractArtifact, {});
|
|
56
54
|
await wallet.registerContract({
|
|
57
55
|
instance: testContractInstance,
|
|
@@ -60,7 +58,7 @@ export async function createPXEServiceAndPrepareTransactions(logger, node, numTx
|
|
|
60
58
|
const contract = await TestContract.at(testContractInstance.address, wallet);
|
|
61
59
|
const txs = await timesAsync(numTxs, async ()=>{
|
|
62
60
|
const tx = await contract.methods.emit_nullifier(Fr.random()).prove({
|
|
63
|
-
from:
|
|
61
|
+
from: fundedAccountManager.getAddress()
|
|
64
62
|
});
|
|
65
63
|
const txHash = tx.getTxHash();
|
|
66
64
|
logger.info(`Tx prepared with hash ${txHash}`);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AztecAddress, type AztecNode, type Logger, type Wallet } 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
4
|
import { type SubsystemsContext } from '../fixtures/snapshot_manager.js';
|
|
@@ -13,11 +13,9 @@ export declare class TokenContractTest {
|
|
|
13
13
|
tokenSim: TokenSimulator;
|
|
14
14
|
node: AztecNode;
|
|
15
15
|
badAccount: InvalidAccountContract;
|
|
16
|
-
|
|
16
|
+
wallet: Wallet;
|
|
17
17
|
adminAddress: AztecAddress;
|
|
18
|
-
account1: AccountWallet;
|
|
19
18
|
account1Address: AztecAddress;
|
|
20
|
-
account2: AccountWallet;
|
|
21
19
|
account2Address: AztecAddress;
|
|
22
20
|
constructor(testName: string);
|
|
23
21
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token_contract_test.d.ts","sourceRoot":"","sources":["../../src/e2e_token_contract/token_contract_test.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"token_contract_test.d.ts","sourceRoot":"","sources":["../../src/e2e_token_contract/token_contract_test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,SAAS,EAAE,KAAK,MAAM,EAAE,KAAK,MAAM,EAAgB,MAAM,iBAAiB,CAAC;AACvG,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,8CAA8C,CAAC;AAItF,OAAO,EAEL,KAAK,iBAAiB,EAIvB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAIlE,qBAAa,iBAAiB;IAC5B,MAAM,CAAC,UAAU,SAAU;IAC3B,MAAM,CAAC,YAAY,SAAS;IAC5B,MAAM,CAAC,cAAc,SAAO;IAC5B,OAAO,CAAC,eAAe,CAAmB;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAG,aAAa,CAAC;IACtB,QAAQ,EAAG,cAAc,CAAC;IAC1B,IAAI,EAAG,SAAS,CAAC;IAEjB,UAAU,EAAG,sBAAsB,CAAC;IACpC,MAAM,EAAG,MAAM,CAAC;IAChB,YAAY,EAAG,YAAY,CAAC;IAC5B,eAAe,EAAG,YAAY,CAAC;IAC/B,eAAe,EAAG,YAAY,CAAC;gBAEnB,QAAQ,EAAE,MAAM;IAO5B;;;;OAIG;IACG,kBAAkB;IAkElB,KAAK;IAIX,QAAQ,GAAI,CAAC,EACX,MAAM,MAAM,EACZ,OAAO,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,CAAC,CAAC,EACjD,UAAS,CAAC,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAA2B,KAChG,OAAO,CAAC,IAAI,CAAC,CAAwD;IAElE,QAAQ;IAIR,iBAAiB;CAqCxB"}
|