@aztec/end-to-end 3.0.0-nightly.20250910 → 3.0.0-nightly.20250912
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_epochs/epochs_test.d.ts +2 -0
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +5 -0
- 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 +7 -11
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +10 -18
- 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 +31 -28
- 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_epochs/epochs_test.ts +3 -0
- 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 +16 -15
- package/src/e2e_p2p/shared.ts +14 -21
- 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 +41 -44
- 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,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AztecAddress, type AztecNode, FeeJuicePaymentMethod, FeeJuicePaymentMethodWithClaim, type FeePaymentMethod, type Logger, PrivateFeePaymentMethod, SponsoredFeePaymentMethod, type Wallet } from '@aztec/aztec.js';
|
|
2
2
|
import { CheatCodes } from '@aztec/aztec/testing';
|
|
3
3
|
import { type DeployL1ContractsArgs } from '@aztec/ethereum';
|
|
4
4
|
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
@@ -8,24 +8,25 @@ import { FPCContract } from '@aztec/noir-contracts.js/FPC';
|
|
|
8
8
|
import { FeeJuiceContract } from '@aztec/noir-contracts.js/FeeJuice';
|
|
9
9
|
import { SponsoredFPCContract } from '@aztec/noir-contracts.js/SponsoredFPC';
|
|
10
10
|
import { TokenContract as BananaCoin, TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
11
|
+
import { TestWallet } from '@aztec/test-wallet';
|
|
11
12
|
import { type SubsystemsContext } from '../../fixtures/snapshot_manager.js';
|
|
12
13
|
import { type SetupOptions } from '../../fixtures/utils.js';
|
|
13
14
|
import { CrossChainTestHarness } from '../../shared/cross_chain_test_harness.js';
|
|
14
15
|
import { type GasBridgingTestHarness } from '../../shared/gas_portal_test_harness.js';
|
|
15
16
|
import { type ClientFlowsConfig } from './config.js';
|
|
16
17
|
export type AccountType = 'ecdsar1' | 'schnorr';
|
|
17
|
-
export type FeePaymentMethodGetter = (wallet: Wallet) => Promise<FeePaymentMethod>;
|
|
18
|
+
export type FeePaymentMethodGetter = (wallet: Wallet, sender: AztecAddress) => Promise<FeePaymentMethod>;
|
|
18
19
|
export type BenchmarkingFeePaymentMethod = 'bridged_fee_juice' | 'private_fpc' | 'sponsored_fpc' | 'fee_juice';
|
|
19
20
|
export declare class ClientFlowsBenchmark {
|
|
20
21
|
private snapshotManager;
|
|
21
22
|
logger: Logger;
|
|
22
|
-
pxe
|
|
23
|
+
private pxe;
|
|
23
24
|
aztecNode: AztecNode;
|
|
24
25
|
cheatCodes: CheatCodes;
|
|
25
26
|
context: SubsystemsContext;
|
|
26
27
|
chainMonitor: ChainMonitor;
|
|
27
28
|
feeJuiceBridgeTestHarness: GasBridgingTestHarness;
|
|
28
|
-
adminWallet:
|
|
29
|
+
adminWallet: TestWallet;
|
|
29
30
|
adminAddress: AztecAddress;
|
|
30
31
|
sequencerAddress: AztecAddress;
|
|
31
32
|
coinbase: EthAddress;
|
|
@@ -36,7 +37,8 @@ export declare class ClientFlowsBenchmark {
|
|
|
36
37
|
amm: AMMContract;
|
|
37
38
|
liquidityToken: TokenContract;
|
|
38
39
|
sponsoredFPC: SponsoredFPCContract;
|
|
39
|
-
|
|
40
|
+
userWallet: TestWallet;
|
|
41
|
+
private userPXE;
|
|
40
42
|
realProofs: boolean;
|
|
41
43
|
paymentMethods: Record<BenchmarkingFeePaymentMethod, {
|
|
42
44
|
forWallet: FeePaymentMethodGetter;
|
|
@@ -50,7 +52,7 @@ export declare class ClientFlowsBenchmark {
|
|
|
50
52
|
mintAndBridgeFeeJuice(address: AztecAddress): Promise<void>;
|
|
51
53
|
/** Admin mints bananaCoin tokens privately to the target address and redeems them. */
|
|
52
54
|
mintPrivateBananas(amount: bigint, address: AztecAddress): Promise<void>;
|
|
53
|
-
createBenchmarkingAccountManager(
|
|
55
|
+
createBenchmarkingAccountManager(wallet: TestWallet, type: 'ecdsar1' | 'schnorr'): Promise<import("@aztec/aztec.js").AccountManager>;
|
|
54
56
|
applyBaseSnapshots(): Promise<void>;
|
|
55
57
|
applyInitialAccountsSnapshot(): Promise<void>;
|
|
56
58
|
applySetupFeeJuiceSnapshot(): Promise<void>;
|
|
@@ -58,12 +60,12 @@ export declare class ClientFlowsBenchmark {
|
|
|
58
60
|
applyDeployCandyBarTokenSnapshot(): Promise<void>;
|
|
59
61
|
applyFPCSetupSnapshot(): Promise<void>;
|
|
60
62
|
applyDeploySponsoredFPCSnapshot(): Promise<void>;
|
|
61
|
-
createCrossChainTestHarness(owner:
|
|
62
|
-
|
|
63
|
+
createCrossChainTestHarness(owner: AztecAddress): Promise<CrossChainTestHarness>;
|
|
64
|
+
createAndFundBenchmarkingAccountOnUserWallet(accountType: AccountType): Promise<AztecAddress>;
|
|
63
65
|
applyDeployAmmSnapshot(): Promise<void>;
|
|
64
|
-
getBridgedFeeJuicePaymentMethodForWallet(
|
|
65
|
-
getPrivateFPCPaymentMethodForWallet(wallet: Wallet): Promise<PrivateFeePaymentMethod>;
|
|
66
|
-
getSponsoredFPCPaymentMethodForWallet(_wallet: Wallet): Promise<SponsoredFeePaymentMethod>;
|
|
67
|
-
getFeeJuicePaymentMethodForWallet(
|
|
66
|
+
getBridgedFeeJuicePaymentMethodForWallet(_wallet: Wallet, sender: AztecAddress): Promise<FeeJuicePaymentMethodWithClaim>;
|
|
67
|
+
getPrivateFPCPaymentMethodForWallet(wallet: Wallet, sender: AztecAddress): Promise<PrivateFeePaymentMethod>;
|
|
68
|
+
getSponsoredFPCPaymentMethodForWallet(_wallet: Wallet, _sender: AztecAddress): Promise<SponsoredFeePaymentMethod>;
|
|
69
|
+
getFeeJuicePaymentMethodForWallet(_wallet: Wallet, sender: AztecAddress): Promise<FeeJuicePaymentMethod>;
|
|
68
70
|
}
|
|
69
71
|
//# sourceMappingURL=client_flows_benchmark.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client_flows_benchmark.d.ts","sourceRoot":"","sources":["../../../src/bench/client_flows/client_flows_benchmark.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client_flows_benchmark.d.ts","sourceRoot":"","sources":["../../../src/bench/client_flows/client_flows_benchmark.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,KAAK,SAAS,EACd,qBAAqB,EACrB,8BAA8B,EAC9B,KAAK,gBAAgB,EACrB,KAAK,MAAM,EAEX,uBAAuB,EACvB,yBAAyB,EACzB,KAAK,MAAM,EAEZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,KAAK,qBAAqB,EAA4D,MAAM,iBAAiB,CAAC;AACvH,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAI3D,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,aAAa,IAAI,UAAU,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAK5F,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,OAAO,EAEL,KAAK,iBAAiB,EAGvB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,KAAK,YAAY,EAAqB,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAE,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,CAAC,CA0BhH;IAEG,MAAM,EAAE,iBAAiB,CAAC;IAEjC,OAAO,CAAC,WAAW,CAAc;gBAErB,QAAQ,CAAC,EAAE,MAAM,EAAE,YAAY,GAAE,OAAO,CAAC,YAAY,GAAG,qBAAqB,CAAM;IAazF,KAAK;IAUL,QAAQ;IAKR,qBAAqB,CAAC,OAAO,EAAE,YAAY;IASjD,sFAAsF;IAChF,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY;IAa9D,gCAAgC,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,GAAG,SAAS;IAgBnE,kBAAkB;IAKzB,4BAA4B;IAsC5B,0BAA0B;IAqB1B,8BAA8B;IAgB9B,gCAAgC;IAgBzB,qBAAqB;IAwB5B,+BAA+B;IAcxB,2BAA2B,CAAC,KAAK,EAAE,YAAY;IAyB/C,4CAA4C,CAAC,WAAW,EAAE,WAAW;IAgBrE,sBAAsB;IA0BtB,wCAAwC,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY;IAKpF,mCAAmC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY;IAIxE,qCAAqC,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY;IAI5E,iCAAiC,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY;CAG/E"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { SchnorrAccountContractArtifact, getSchnorrAccount, getSchnorrWallet } from '@aztec/accounts/schnorr';
|
|
3
|
-
import { AccountWalletWithSecretKey, FeeJuicePaymentMethod, FeeJuicePaymentMethodWithClaim, PrivateFeePaymentMethod, SponsoredFeePaymentMethod, createLogger } from '@aztec/aztec.js';
|
|
1
|
+
import { FeeJuicePaymentMethod, FeeJuicePaymentMethodWithClaim, PrivateFeePaymentMethod, SponsoredFeePaymentMethod, createLogger } from '@aztec/aztec.js';
|
|
4
2
|
import { CheatCodes } from '@aztec/aztec/testing';
|
|
5
3
|
import { RollupContract, createExtendedL1Client, deployL1Contract } from '@aztec/ethereum';
|
|
6
4
|
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
@@ -18,6 +16,7 @@ import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
|
18
16
|
import { getCanonicalFeeJuice } from '@aztec/protocol-contracts/fee-juice';
|
|
19
17
|
import { createPXEService, getPXEServiceConfig } from '@aztec/pxe/server';
|
|
20
18
|
import { deriveSigningKey } from '@aztec/stdlib/keys';
|
|
19
|
+
import { TestWallet } from '@aztec/test-wallet';
|
|
21
20
|
import { MNEMONIC } from '../../fixtures/fixtures.js';
|
|
22
21
|
import { createSnapshotManager, deployAccounts } from '../../fixtures/snapshot_manager.js';
|
|
23
22
|
import { mintTokensToPrivate } from '../../fixtures/token_utils.js';
|
|
@@ -36,8 +35,8 @@ export class ClientFlowsBenchmark {
|
|
|
36
35
|
context;
|
|
37
36
|
chainMonitor;
|
|
38
37
|
feeJuiceBridgeTestHarness;
|
|
39
|
-
// The admin that aids in the setup of the test
|
|
40
38
|
adminWallet;
|
|
39
|
+
// The admin that aids in the setup of the test
|
|
41
40
|
adminAddress;
|
|
42
41
|
// Aztec Node config
|
|
43
42
|
sequencerAddress;
|
|
@@ -55,7 +54,8 @@ export class ClientFlowsBenchmark {
|
|
|
55
54
|
liquidityToken;
|
|
56
55
|
// Sponsored FPC contract
|
|
57
56
|
sponsoredFPC;
|
|
58
|
-
// PXE used by the benchmarking user. It can be set up with client-side proving enabled
|
|
57
|
+
// PXE and Wallet used by the benchmarking user. It can be set up with client-side proving enabled
|
|
58
|
+
userWallet;
|
|
59
59
|
userPXE;
|
|
60
60
|
realProofs = [
|
|
61
61
|
'true',
|
|
@@ -125,42 +125,38 @@ export class ClientFlowsBenchmark {
|
|
|
125
125
|
const balanceBefore = await this.bananaCoin.methods.balance_of_private(address).simulate({
|
|
126
126
|
from: this.adminAddress
|
|
127
127
|
});
|
|
128
|
-
await mintTokensToPrivate(this.bananaCoin, this.adminAddress,
|
|
128
|
+
await mintTokensToPrivate(this.bananaCoin, this.adminAddress, address, amount);
|
|
129
129
|
const balanceAfter = await this.bananaCoin.methods.balance_of_private(address).simulate({
|
|
130
130
|
from: this.adminAddress
|
|
131
131
|
});
|
|
132
132
|
expect(balanceAfter).toEqual(balanceBefore + amount);
|
|
133
133
|
}
|
|
134
|
-
|
|
135
|
-
const
|
|
134
|
+
createBenchmarkingAccountManager(wallet, type) {
|
|
135
|
+
const benchysSecret = Fr.random();
|
|
136
136
|
const salt = Fr.random();
|
|
137
137
|
let benchysPrivateSigningKey;
|
|
138
|
-
let benchysAccountManager;
|
|
139
138
|
if (type === 'schnorr') {
|
|
140
|
-
benchysPrivateSigningKey = deriveSigningKey(
|
|
141
|
-
|
|
139
|
+
benchysPrivateSigningKey = deriveSigningKey(benchysSecret);
|
|
140
|
+
return wallet.createSchnorrAccount(benchysSecret, salt, benchysPrivateSigningKey);
|
|
142
141
|
} else if (type === 'ecdsar1') {
|
|
143
142
|
benchysPrivateSigningKey = randomBytes(32);
|
|
144
|
-
|
|
143
|
+
return wallet.createECDSARAccount(benchysSecret, salt, benchysPrivateSigningKey);
|
|
145
144
|
} else {
|
|
146
145
|
throw new Error(`Unknown account type: ${type}`);
|
|
147
146
|
}
|
|
148
|
-
await benchysAccountManager.register();
|
|
149
|
-
return benchysAccountManager;
|
|
150
147
|
}
|
|
151
148
|
async applyBaseSnapshots() {
|
|
152
149
|
await this.applyInitialAccountsSnapshot();
|
|
153
150
|
await this.applySetupFeeJuiceSnapshot();
|
|
154
151
|
}
|
|
155
152
|
async applyInitialAccountsSnapshot() {
|
|
156
|
-
await this.snapshotManager.snapshot('initial_accounts', deployAccounts(2, this.logger), async ({ deployedAccounts }, { pxe, aztecNode, aztecNodeConfig })=>{
|
|
153
|
+
await this.snapshotManager.snapshot('initial_accounts', deployAccounts(2, this.logger), async ({ deployedAccounts: [{ address: adminAddress }, { address: sequencerAddress }] }, { wallet, pxe, aztecNode, aztecNodeConfig })=>{
|
|
157
154
|
this.pxe = pxe;
|
|
155
|
+
this.adminWallet = wallet;
|
|
158
156
|
this.aztecNode = aztecNode;
|
|
159
157
|
this.cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, pxe);
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
this.adminAddress = this.adminWallet.getAddress();
|
|
163
|
-
this.sequencerAddress = deployedWallets[1].getAddress();
|
|
158
|
+
this.adminAddress = adminAddress;
|
|
159
|
+
this.sequencerAddress = sequencerAddress;
|
|
164
160
|
const canonicalFeeJuice = await getCanonicalFeeJuice();
|
|
165
161
|
this.feeJuiceContract = await FeeJuiceContract.at(canonicalFeeJuice.address, this.adminWallet);
|
|
166
162
|
this.coinbase = EthAddress.random();
|
|
@@ -176,6 +172,7 @@ export class ClientFlowsBenchmark {
|
|
|
176
172
|
prover: this.proxyLogger.createLogger('pxe:bb:wasm:bundle:proxied')
|
|
177
173
|
}
|
|
178
174
|
});
|
|
175
|
+
this.userWallet = new TestWallet(this.userPXE);
|
|
179
176
|
});
|
|
180
177
|
}
|
|
181
178
|
async applySetupFeeJuiceSnapshot() {
|
|
@@ -254,29 +251,28 @@ export class ClientFlowsBenchmark {
|
|
|
254
251
|
l1Client.account.address
|
|
255
252
|
]).then(({ address })=>address);
|
|
256
253
|
this.logger.verbose(`Setting up cross chain harness...`);
|
|
257
|
-
const crossChainTestHarness = await CrossChainTestHarness.new(this.aztecNode, this.pxe, l1Client,
|
|
254
|
+
const crossChainTestHarness = await CrossChainTestHarness.new(this.aztecNode, this.pxe, l1Client, this.adminWallet, owner, this.logger, underlyingERC20Address);
|
|
258
255
|
this.logger.verbose(`L2 token deployed to: ${crossChainTestHarness.l2Token.address}`);
|
|
259
256
|
return crossChainTestHarness;
|
|
260
257
|
}
|
|
261
|
-
async
|
|
262
|
-
const benchysAccountManager = await this.createBenchmarkingAccountManager(this.
|
|
263
|
-
const
|
|
258
|
+
async createAndFundBenchmarkingAccountOnUserWallet(accountType) {
|
|
259
|
+
const benchysAccountManager = await this.createBenchmarkingAccountManager(this.adminWallet, accountType);
|
|
260
|
+
const benchysAccount = await benchysAccountManager.getAccount();
|
|
264
261
|
const benchysAddress = benchysAccountManager.getAddress();
|
|
265
262
|
const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(benchysAddress);
|
|
266
|
-
const paymentMethod = new FeeJuicePaymentMethodWithClaim(
|
|
263
|
+
const paymentMethod = new FeeJuicePaymentMethodWithClaim(benchysAddress, claim);
|
|
267
264
|
await benchysAccountManager.deploy({
|
|
268
265
|
fee: {
|
|
269
266
|
paymentMethod
|
|
270
267
|
}
|
|
271
268
|
}).wait();
|
|
272
|
-
// Register benchy on the user's
|
|
273
|
-
await this.
|
|
274
|
-
|
|
275
|
-
|
|
269
|
+
// Register benchy on the user's Wallet, where we're going to be interacting from
|
|
270
|
+
const accountManager = await this.userWallet.createAccount({
|
|
271
|
+
secret: benchysAccount.getSecretKey(),
|
|
272
|
+
salt: new Fr(benchysAccount.salt),
|
|
273
|
+
contract: benchysAccountManager.getAccountContract()
|
|
276
274
|
});
|
|
277
|
-
|
|
278
|
-
const entrypoint = await benchysAccountManager.getAccount();
|
|
279
|
-
return new AccountWalletWithSecretKey(this.userPXE, entrypoint, benchysWallet.getSecretKey(), benchysAccountManager.salt);
|
|
275
|
+
return accountManager.getAddress();
|
|
280
276
|
}
|
|
281
277
|
async applyDeployAmmSnapshot() {
|
|
282
278
|
await this.snapshotManager.snapshot('deploy_amm', async ()=>{
|
|
@@ -299,17 +295,17 @@ export class ClientFlowsBenchmark {
|
|
|
299
295
|
this.amm = await AMMContract.at(ammAddress, this.adminWallet);
|
|
300
296
|
});
|
|
301
297
|
}
|
|
302
|
-
async getBridgedFeeJuicePaymentMethodForWallet(
|
|
303
|
-
const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(
|
|
304
|
-
return new FeeJuicePaymentMethodWithClaim(
|
|
298
|
+
async getBridgedFeeJuicePaymentMethodForWallet(_wallet, sender) {
|
|
299
|
+
const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(sender);
|
|
300
|
+
return new FeeJuicePaymentMethodWithClaim(sender, claim);
|
|
305
301
|
}
|
|
306
|
-
getPrivateFPCPaymentMethodForWallet(wallet) {
|
|
307
|
-
return Promise.resolve(new PrivateFeePaymentMethod(this.bananaFPC.address, wallet));
|
|
302
|
+
getPrivateFPCPaymentMethodForWallet(wallet, sender) {
|
|
303
|
+
return Promise.resolve(new PrivateFeePaymentMethod(this.bananaFPC.address, sender, wallet));
|
|
308
304
|
}
|
|
309
|
-
getSponsoredFPCPaymentMethodForWallet(_wallet) {
|
|
305
|
+
getSponsoredFPCPaymentMethodForWallet(_wallet, _sender) {
|
|
310
306
|
return Promise.resolve(new SponsoredFeePaymentMethod(this.sponsoredFPC.address));
|
|
311
307
|
}
|
|
312
|
-
getFeeJuicePaymentMethodForWallet(
|
|
313
|
-
return Promise.resolve(new FeeJuicePaymentMethod(
|
|
308
|
+
getFeeJuicePaymentMethodForWallet(_wallet, sender) {
|
|
309
|
+
return Promise.resolve(new FeeJuicePaymentMethod(sender));
|
|
314
310
|
}
|
|
315
311
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/bench/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAa,KAAK,MAAM,EAAE,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAExF,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAClF,OAAO,EAAE,KAAK,UAAU,EAA2C,MAAM,mBAAmB,CAAC;AAC7F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAA4C,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAKxH,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,YAAY,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ACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AA6DF;;;;;;;;GAQG;AACH,wBAAsB,OAAO,CAC3B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,oBAAoB,EAC9B,kBAAkB,GAAE,OAAe,GAClC,OAAO,CAAC,MAAM,EAAE,CAAC,CAOnB;AAED,wBAAsB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,CAAC,EAAE,QAAQ,iBAI3F;AAED;;;;;;GAMG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,oBAAoB,GAAG,OAAO,CAAC,UAAU,CAAC,CAiBvG"}
|
package/dest/bench/utils.js
CHANGED
|
@@ -14,8 +14,9 @@ import { setup } from '../fixtures/utils.js';
|
|
|
14
14
|
benchmark: true
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
+
const defaultAccountAddress = context.accounts[0];
|
|
17
18
|
const contract = await BenchmarkingContract.deploy(context.wallet).send({
|
|
18
|
-
from:
|
|
19
|
+
from: defaultAccountAddress
|
|
19
20
|
}).deployed();
|
|
20
21
|
context.logger.info(`Deployed benchmarking contract at ${contract.address}`);
|
|
21
22
|
const sequencer = context.aztecNode.getSequencer();
|
|
@@ -92,10 +93,10 @@ function getMetricValues(points) {
|
|
|
92
93
|
* @param heavyPublicCompute - Whether the transactions include heavy public compute (like a big sha256).
|
|
93
94
|
* @returns A BatchCall instance.
|
|
94
95
|
*/ function makeCall(index, context, contract, heavyPublicCompute) {
|
|
95
|
-
const owner = context.
|
|
96
|
+
const [owner] = context.accounts;
|
|
96
97
|
if (heavyPublicCompute) {
|
|
97
98
|
return new BatchCall(context.wallet, [
|
|
98
|
-
contract.methods.
|
|
99
|
+
contract.methods.sha256_hash_1024(randomBytesAsBigInts(1024))
|
|
99
100
|
]);
|
|
100
101
|
} else {
|
|
101
102
|
return new BatchCall(context.wallet, [
|
|
@@ -115,8 +116,9 @@ function getMetricValues(points) {
|
|
|
115
116
|
*/ export async function sendTxs(txCount, context, contract, heavyPublicCompute = false) {
|
|
116
117
|
const calls = times(txCount, (index)=>makeCall(index, context, contract, heavyPublicCompute));
|
|
117
118
|
context.logger.info(`Creating ${txCount} txs`);
|
|
119
|
+
const [from] = context.accounts;
|
|
118
120
|
const provenTxs = await Promise.all(calls.map((call)=>call.prove({
|
|
119
|
-
from
|
|
121
|
+
from
|
|
120
122
|
})));
|
|
121
123
|
context.logger.info(`Sending ${txCount} txs`);
|
|
122
124
|
return provenTxs.map((tx)=>tx.send());
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AztecAddress, type AztecNode, Fr, type Logger, type PXE, type TxHash } from '@aztec/aztec.js';
|
|
2
2
|
import type { CheatCodes } from '@aztec/aztec/testing';
|
|
3
3
|
import { TokenBlacklistContract } from '@aztec/noir-contracts.js/TokenBlacklist';
|
|
4
4
|
import { InvalidAccountContract } from '@aztec/noir-test-contracts.js/InvalidAccount';
|
|
5
5
|
import type { SequencerClient } from '@aztec/sequencer-client';
|
|
6
|
+
import type { TestWallet } from '@aztec/test-wallet';
|
|
6
7
|
import { type SubsystemsContext } from '../fixtures/snapshot_manager.js';
|
|
7
8
|
import { TokenSimulator } from '../simulators/token_simulator.js';
|
|
8
9
|
export declare class Role {
|
|
@@ -22,20 +23,16 @@ export declare class BlacklistTokenContractTest {
|
|
|
22
23
|
static CHANGE_ROLES_DELAY: number;
|
|
23
24
|
private snapshotManager;
|
|
24
25
|
logger: Logger;
|
|
25
|
-
|
|
26
|
+
wallet: TestWallet;
|
|
26
27
|
pxe: PXE;
|
|
27
|
-
accounts: CompleteAddress[];
|
|
28
28
|
asset: TokenBlacklistContract;
|
|
29
29
|
tokenSim: TokenSimulator;
|
|
30
30
|
badAccount: InvalidAccountContract;
|
|
31
31
|
cheatCodes: CheatCodes;
|
|
32
32
|
sequencer: SequencerClient;
|
|
33
33
|
aztecNode: AztecNode;
|
|
34
|
-
admin: AccountWallet;
|
|
35
34
|
adminAddress: AztecAddress;
|
|
36
|
-
other: AccountWallet;
|
|
37
35
|
otherAddress: AztecAddress;
|
|
38
|
-
blacklisted: AccountWallet;
|
|
39
36
|
blacklistedAddress: AztecAddress;
|
|
40
37
|
constructor(testName: string);
|
|
41
38
|
crossTimestampOfChange(): Promise<void>;
|
|
@@ -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":"
|
|
1
|
+
{"version":3,"file":"blacklist_token_contract_test.d.ts","sourceRoot":"","sources":["../../src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,KAAK,SAAS,EACd,EAAE,EACF,KAAK,MAAM,EACX,KAAK,GAAG,EACR,KAAK,MAAM,EAGZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,8CAA8C,CAAC;AACtF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAIrD,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;IAErC,MAAM,CAAC,kBAAkB,SAAS;IAElC,OAAO,CAAC,eAAe,CAAmB;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAG,UAAU,CAAC;IACpB,GAAG,EAAG,GAAG,CAAC;IACV,KAAK,EAAG,sBAAsB,CAAC;IAC/B,QAAQ,EAAG,cAAc,CAAC;IAC1B,UAAU,EAAG,sBAAsB,CAAC;IACpC,UAAU,EAAG,UAAU,CAAC;IACxB,SAAS,EAAG,eAAe,CAAC;IAC5B,SAAS,EAAG,SAAS,CAAC;IAEtB,YAAY,EAAG,YAAY,CAAC;IAC5B,YAAY,EAAG,YAAY,CAAC;IAC5B,kBAAkB,EAAG,YAAY,CAAC;gBAEtB,QAAQ,EAAE,MAAM;IAKtB,sBAAsB;IAQ5B;;;;OAIG;IACG,kBAAkB;IAiElB,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,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,4 +1,3 @@
|
|
|
1
|
-
import { getSchnorrWallet } from '@aztec/accounts/schnorr';
|
|
2
1
|
import { Fr, computeSecretHash, createLogger } from '@aztec/aztec.js';
|
|
3
2
|
import { TokenBlacklistContract } from '@aztec/noir-contracts.js/TokenBlacklist';
|
|
4
3
|
import { InvalidAccountContract } from '@aztec/noir-test-contracts.js/InvalidAccount';
|
|
@@ -37,20 +36,16 @@ export class BlacklistTokenContractTest {
|
|
|
37
36
|
static CHANGE_ROLES_DELAY = 86400;
|
|
38
37
|
snapshotManager;
|
|
39
38
|
logger;
|
|
40
|
-
|
|
39
|
+
wallet;
|
|
41
40
|
pxe;
|
|
42
|
-
accounts = [];
|
|
43
41
|
asset;
|
|
44
42
|
tokenSim;
|
|
45
43
|
badAccount;
|
|
46
44
|
cheatCodes;
|
|
47
45
|
sequencer;
|
|
48
46
|
aztecNode;
|
|
49
|
-
admin;
|
|
50
47
|
adminAddress;
|
|
51
|
-
other;
|
|
52
48
|
otherAddress;
|
|
53
|
-
blacklisted;
|
|
54
49
|
blacklistedAddress;
|
|
55
50
|
constructor(testName){
|
|
56
51
|
this.logger = createLogger(`e2e:e2e_blacklist_token_contract:${testName}`);
|
|
@@ -66,32 +61,33 @@ export class BlacklistTokenContractTest {
|
|
|
66
61
|
*/ async applyBaseSnapshots() {
|
|
67
62
|
// Adding a timeout of 2 minutes in here such that it is propagated to the underlying tests
|
|
68
63
|
jest.setTimeout(120_000);
|
|
69
|
-
await this.snapshotManager.snapshot('3_accounts', deployAccounts(3, this.logger),
|
|
64
|
+
await this.snapshotManager.snapshot('3_accounts', deployAccounts(3, this.logger), ({ deployedAccounts }, { pxe, cheatCodes, aztecNode, sequencer, wallet })=>{
|
|
70
65
|
this.pxe = pxe;
|
|
71
66
|
this.cheatCodes = cheatCodes;
|
|
72
67
|
this.aztecNode = aztecNode;
|
|
73
68
|
this.sequencer = sequencer;
|
|
74
|
-
this.
|
|
75
|
-
this.
|
|
76
|
-
this.
|
|
77
|
-
this.
|
|
78
|
-
|
|
79
|
-
this.blacklisted = this.wallets[2];
|
|
80
|
-
this.blacklistedAddress = this.blacklisted.getAddress();
|
|
81
|
-
this.accounts = this.wallets.map((w)=>w.getCompleteAddress());
|
|
69
|
+
this.wallet = wallet;
|
|
70
|
+
this.adminAddress = deployedAccounts[0].address;
|
|
71
|
+
this.otherAddress = deployedAccounts[1].address;
|
|
72
|
+
this.blacklistedAddress = deployedAccounts[2].address;
|
|
73
|
+
return Promise.resolve();
|
|
82
74
|
});
|
|
83
75
|
await this.snapshotManager.snapshot('e2e_blacklist_token_contract', async ()=>{
|
|
84
76
|
// Create the token contract state.
|
|
85
77
|
// Move this account thing to addAccounts above?
|
|
86
78
|
this.logger.verbose(`Public deploy accounts...`);
|
|
87
|
-
await publicDeployAccounts(this.
|
|
79
|
+
await publicDeployAccounts(this.wallet, [
|
|
80
|
+
this.adminAddress,
|
|
81
|
+
this.otherAddress,
|
|
82
|
+
this.blacklistedAddress
|
|
83
|
+
]);
|
|
88
84
|
this.logger.verbose(`Deploying TokenContract...`);
|
|
89
|
-
this.asset = await TokenBlacklistContract.deploy(this.
|
|
85
|
+
this.asset = await TokenBlacklistContract.deploy(this.wallet, this.adminAddress).send({
|
|
90
86
|
from: this.adminAddress
|
|
91
87
|
}).deployed();
|
|
92
88
|
this.logger.verbose(`Token deployed to ${this.asset.address}`);
|
|
93
89
|
this.logger.verbose(`Deploying bad account...`);
|
|
94
|
-
this.badAccount = await InvalidAccountContract.deploy(this.
|
|
90
|
+
this.badAccount = await InvalidAccountContract.deploy(this.wallet).send({
|
|
95
91
|
from: this.adminAddress
|
|
96
92
|
}).deployed();
|
|
97
93
|
this.logger.verbose(`Deployed to ${this.badAccount.address}.`);
|
|
@@ -102,10 +98,14 @@ export class BlacklistTokenContractTest {
|
|
|
102
98
|
};
|
|
103
99
|
}, async ({ tokenContractAddress, badAccountAddress })=>{
|
|
104
100
|
// Restore the token contract state.
|
|
105
|
-
this.asset = await TokenBlacklistContract.at(tokenContractAddress, this.
|
|
101
|
+
this.asset = await TokenBlacklistContract.at(tokenContractAddress, this.wallet);
|
|
106
102
|
this.logger.verbose(`Token contract address: ${this.asset.address}`);
|
|
107
|
-
this.tokenSim = new TokenSimulator(this.asset, this.
|
|
108
|
-
|
|
103
|
+
this.tokenSim = new TokenSimulator(this.asset, this.wallet, this.adminAddress, this.logger, [
|
|
104
|
+
this.adminAddress,
|
|
105
|
+
this.otherAddress,
|
|
106
|
+
this.blacklistedAddress
|
|
107
|
+
]);
|
|
108
|
+
this.badAccount = await InvalidAccountContract.at(badAccountAddress, this.wallet);
|
|
109
109
|
this.logger.verbose(`Bad account address: ${this.badAccount.address}`);
|
|
110
110
|
expect(await this.asset.methods.get_roles(this.adminAddress).simulate({
|
|
111
111
|
from: this.adminAddress
|
|
@@ -127,22 +127,22 @@ export class BlacklistTokenContractTest {
|
|
|
127
127
|
}
|
|
128
128
|
async applyMintSnapshot() {
|
|
129
129
|
await this.snapshotManager.snapshot('mint', async ()=>{
|
|
130
|
-
const { asset
|
|
130
|
+
const { asset } = this;
|
|
131
131
|
const amount = 10000n;
|
|
132
132
|
const adminMinterRole = new Role().withAdmin().withMinter();
|
|
133
|
-
await this.asset.
|
|
133
|
+
await this.asset.methods.update_roles(this.adminAddress, adminMinterRole.toNoirStruct()).send({
|
|
134
134
|
from: this.adminAddress
|
|
135
135
|
}).wait();
|
|
136
136
|
const blacklistRole = new Role().withBlacklisted();
|
|
137
|
-
await this.asset.
|
|
137
|
+
await this.asset.methods.update_roles(this.blacklistedAddress, blacklistRole.toNoirStruct()).send({
|
|
138
138
|
from: this.adminAddress
|
|
139
139
|
}).wait();
|
|
140
140
|
await this.crossTimestampOfChange();
|
|
141
|
-
expect(await this.asset.methods.get_roles(this.
|
|
141
|
+
expect(await this.asset.methods.get_roles(this.adminAddress).simulate({
|
|
142
142
|
from: this.adminAddress
|
|
143
143
|
})).toEqual(adminMinterRole.toNoirStruct());
|
|
144
144
|
this.logger.verbose(`Minting ${amount} publicly...`);
|
|
145
|
-
await asset.methods.mint_public(
|
|
145
|
+
await asset.methods.mint_public(this.adminAddress, amount).send({
|
|
146
146
|
from: this.adminAddress
|
|
147
147
|
}).wait();
|
|
148
148
|
this.logger.verbose(`Minting ${amount} privately...`);
|
|
@@ -151,8 +151,8 @@ export class BlacklistTokenContractTest {
|
|
|
151
151
|
const receipt = await asset.methods.mint_private(amount, secretHash).send({
|
|
152
152
|
from: this.adminAddress
|
|
153
153
|
}).wait();
|
|
154
|
-
await this.addPendingShieldNoteToPXE(asset,
|
|
155
|
-
const txClaim = asset.methods.redeem_shield(
|
|
154
|
+
await this.addPendingShieldNoteToPXE(asset, this.adminAddress, amount, secretHash, receipt.txHash);
|
|
155
|
+
const txClaim = asset.methods.redeem_shield(this.adminAddress, amount, secret).send({
|
|
156
156
|
from: this.adminAddress
|
|
157
157
|
});
|
|
158
158
|
await txClaim.wait();
|
|
@@ -161,21 +161,21 @@ export class BlacklistTokenContractTest {
|
|
|
161
161
|
amount
|
|
162
162
|
};
|
|
163
163
|
}, async ({ amount })=>{
|
|
164
|
-
const { asset,
|
|
165
|
-
tokenSim.mintPublic(
|
|
166
|
-
const publicBalance = await asset.methods.balance_of_public(
|
|
167
|
-
from:
|
|
164
|
+
const { asset, tokenSim } = this;
|
|
165
|
+
tokenSim.mintPublic(this.adminAddress, amount);
|
|
166
|
+
const publicBalance = await asset.methods.balance_of_public(this.adminAddress).simulate({
|
|
167
|
+
from: this.adminAddress
|
|
168
168
|
});
|
|
169
169
|
this.logger.verbose(`Public balance of wallet 0: ${publicBalance}`);
|
|
170
|
-
expect(publicBalance).toEqual(this.tokenSim.balanceOfPublic(
|
|
171
|
-
tokenSim.mintPrivate(
|
|
172
|
-
const privateBalance = await asset.methods.balance_of_private(
|
|
173
|
-
from:
|
|
170
|
+
expect(publicBalance).toEqual(this.tokenSim.balanceOfPublic(this.adminAddress));
|
|
171
|
+
tokenSim.mintPrivate(this.adminAddress, amount);
|
|
172
|
+
const privateBalance = await asset.methods.balance_of_private(this.adminAddress).simulate({
|
|
173
|
+
from: this.adminAddress
|
|
174
174
|
});
|
|
175
175
|
this.logger.verbose(`Private balance of wallet 0: ${privateBalance}`);
|
|
176
|
-
expect(privateBalance).toEqual(tokenSim.balanceOfPrivate(
|
|
176
|
+
expect(privateBalance).toEqual(tokenSim.balanceOfPrivate(this.adminAddress));
|
|
177
177
|
const totalSupply = await asset.methods.total_supply().simulate({
|
|
178
|
-
from:
|
|
178
|
+
from: this.adminAddress
|
|
179
179
|
});
|
|
180
180
|
this.logger.verbose(`Total supply: ${totalSupply}`);
|
|
181
181
|
expect(totalSupply).toEqual(tokenSim.totalSupply);
|
|
@@ -1,28 +1,27 @@
|
|
|
1
1
|
import type { AztecNodeConfig } from '@aztec/aztec-node';
|
|
2
|
-
import {
|
|
2
|
+
import { AztecAddress, type AztecNode, EthAddress, type Logger, type PXE } from '@aztec/aztec.js';
|
|
3
3
|
import { CheatCodes } from '@aztec/aztec/testing';
|
|
4
4
|
import { type DeployL1ContractsReturnType, type ExtendedViemWalletClient } from '@aztec/ethereum';
|
|
5
5
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
6
6
|
import { TokenBridgeContract } from '@aztec/noir-contracts.js/TokenBridge';
|
|
7
7
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
8
|
+
import type { TestWallet } from '@aztec/test-wallet';
|
|
8
9
|
import { type SubsystemsContext } from '../fixtures/snapshot_manager.js';
|
|
9
10
|
import { CrossChainTestHarness } from '../shared/cross_chain_test_harness.js';
|
|
10
11
|
export declare class CrossChainMessagingTest {
|
|
11
12
|
private snapshotManager;
|
|
12
13
|
logger: Logger;
|
|
13
|
-
accounts: CompleteAddress[];
|
|
14
14
|
aztecNode: AztecNode;
|
|
15
15
|
pxe: PXE;
|
|
16
16
|
aztecNodeConfig: AztecNodeConfig;
|
|
17
17
|
aztecNodeAdmin: AztecNodeAdmin;
|
|
18
18
|
l1Client: ExtendedViemWalletClient | undefined;
|
|
19
|
-
|
|
19
|
+
wallet: TestWallet;
|
|
20
|
+
ownerAddress: AztecAddress;
|
|
20
21
|
user1Address: AztecAddress;
|
|
21
|
-
user2Wallet: AccountWallet;
|
|
22
22
|
user2Address: AztecAddress;
|
|
23
23
|
crossChainTestHarness: CrossChainTestHarness;
|
|
24
24
|
ethAccount: EthAddress;
|
|
25
|
-
ownerAddress: AztecAddress;
|
|
26
25
|
l2Token: TokenContract;
|
|
27
26
|
l2Bridge: TokenBridgeContract;
|
|
28
27
|
inbox: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cross_chain_messaging_test.d.ts","sourceRoot":"","sources":["../../src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cross_chain_messaging_test.d.ts","sourceRoot":"","sources":["../../src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,KAAK,SAAS,EAAE,UAAU,EAAE,KAAK,MAAM,EAAE,KAAK,GAAG,EAAgB,MAAM,iBAAiB,CAAC;AAChH,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EACL,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAG9B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAKrD,OAAO,EAEL,KAAK,iBAAiB,EAIvB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAI9E,qBAAa,uBAAuB;IAClC,OAAO,CAAC,eAAe,CAAmB;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAG,SAAS,CAAC;IACtB,GAAG,EAAG,GAAG,CAAC;IACV,eAAe,EAAG,eAAe,CAAC;IAClC,cAAc,EAAG,cAAc,CAAC;IAEhC,QAAQ,EAAG,wBAAwB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