@aztec/end-to-end 1.2.1 → 2.0.0-nightly.20250813
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/benchmark.d.ts +2 -2
- package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/benchmark.js +4 -2
- package/dest/bench/client_flows/client_flows_benchmark.d.ts +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +33 -15
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +7 -4
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +11 -3
- 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 +59 -24
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +3 -2
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +1 -1
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +13 -10
- package/dest/e2e_deploy_contract/deploy_test.d.ts +1 -1
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
- package/dest/e2e_deploy_contract/deploy_test.js +7 -6
- package/dest/e2e_epochs/epochs_test.d.ts +16 -2
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +65 -7
- package/dest/e2e_fees/bridging_race.notest.js +3 -1
- package/dest/e2e_fees/fees_test.d.ts +5 -4
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +44 -59
- package/dest/e2e_nested_contract/nested_contract_test.d.ts +3 -3
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +17 -12
- package/dest/e2e_p2p/p2p_network.d.ts +7 -4
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +43 -22
- package/dest/e2e_p2p/shared.d.ts +3 -3
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +16 -12
- package/dest/e2e_token_contract/token_contract_test.d.ts +8 -4
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/e2e_token_contract/token_contract_test.js +48 -23
- package/dest/fixtures/e2e_prover_test.d.ts +1 -1
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +27 -10
- package/dest/fixtures/setup_p2p_test.d.ts +4 -1
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +39 -8
- package/dest/fixtures/snapshot_manager.d.ts +3 -1
- package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.js +20 -17
- 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 +14 -10
- package/dest/fixtures/utils.d.ts +23 -8
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +88 -56
- package/dest/integration_l1_publisher/write_json.d.ts +8 -0
- package/dest/integration_l1_publisher/write_json.d.ts.map +1 -0
- package/dest/integration_l1_publisher/write_json.js +57 -0
- package/dest/sample-dapp/connect.d.mts +2 -0
- package/dest/sample-dapp/connect.d.mts.map +1 -0
- package/dest/sample-dapp/connect.js +1 -1
- package/dest/sample-dapp/contracts.d.mts +3 -0
- package/dest/sample-dapp/contracts.d.mts.map +1 -0
- package/dest/sample-dapp/contracts.js +1 -1
- package/dest/sample-dapp/deploy.d.mts +3 -0
- package/dest/sample-dapp/deploy.d.mts.map +1 -0
- package/dest/sample-dapp/deploy.js +4 -1
- package/dest/sample-dapp/index.d.mts +2 -0
- package/dest/sample-dapp/index.d.mts.map +1 -0
- package/dest/sample-dapp/index.js +18 -8
- package/dest/shared/cross_chain_test_harness.d.ts +6 -3
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +50 -20
- package/dest/shared/gas_portal_test_harness.d.ts +3 -3
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.js +21 -6
- package/dest/shared/uniswap_l1_l2.d.ts +1 -1
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +45 -22
- package/dest/simulators/lending_simulator.d.ts +1 -1
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.js +6 -2
- package/dest/simulators/token_simulator.d.ts +2 -1
- package/dest/simulators/token_simulator.d.ts.map +1 -1
- package/dest/simulators/token_simulator.js +12 -4
- package/dest/spartan/setup_test_wallets.d.ts +7 -0
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +96 -11
- package/dest/spartan/utils.d.ts +23 -3
- package/dest/spartan/utils.d.ts.map +1 -1
- package/dest/spartan/utils.js +9 -6
- package/package.json +36 -36
- package/src/bench/client_flows/benchmark.ts +8 -3
- package/src/bench/client_flows/client_flows_benchmark.ts +23 -14
- package/src/bench/utils.ts +5 -4
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +47 -26
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +14 -9
- package/src/e2e_deploy_contract/deploy_test.ts +7 -7
- package/src/e2e_epochs/epochs_test.ts +97 -25
- package/src/e2e_fees/bridging_race.notest.ts +1 -1
- package/src/e2e_fees/fees_test.ts +55 -82
- package/src/e2e_nested_contract/nested_contract_test.ts +16 -11
- package/src/e2e_p2p/p2p_network.ts +51 -26
- package/src/e2e_p2p/shared.ts +14 -12
- package/src/e2e_token_contract/token_contract_test.ts +38 -36
- package/src/fixtures/e2e_prover_test.ts +17 -10
- package/src/fixtures/setup_p2p_test.ts +51 -9
- package/src/fixtures/snapshot_manager.ts +24 -17
- package/src/fixtures/token_utils.ts +14 -9
- package/src/fixtures/utils.ts +116 -57
- package/src/guides/up_quick_start.sh +1 -1
- package/src/integration_l1_publisher/write_json.ts +74 -0
- package/src/sample-dapp/connect.mjs +1 -1
- package/src/sample-dapp/contracts.mjs +1 -1
- package/src/sample-dapp/deploy.mjs +3 -3
- package/src/sample-dapp/index.mjs +11 -8
- package/src/shared/cross_chain_test_harness.ts +31 -18
- package/src/shared/gas_portal_test_harness.ts +17 -7
- package/src/shared/uniswap_l1_l2.ts +28 -24
- package/src/simulators/lending_simulator.ts +3 -3
- package/src/simulators/token_simulator.ts +12 -3
- package/src/spartan/setup_test_wallets.ts +130 -19
- package/src/spartan/utils.ts +10 -3
|
@@ -11,7 +11,7 @@ export type Log = {
|
|
|
11
11
|
message: string;
|
|
12
12
|
data: any;
|
|
13
13
|
};
|
|
14
|
-
declare const GATE_TYPES: readonly ["ecc_op", "busread", "lookup", "pub_inputs", "arithmetic", "delta_range", "elliptic", "
|
|
14
|
+
declare const GATE_TYPES: readonly ["ecc_op", "busread", "lookup", "pub_inputs", "arithmetic", "delta_range", "elliptic", "memory", "nnf", "poseidon2_external", "poseidon2_internal", "overflow"];
|
|
15
15
|
type GateType = (typeof GATE_TYPES)[number];
|
|
16
16
|
type StructuredTrace = {
|
|
17
17
|
[k in GateType]: number;
|
|
@@ -55,6 +55,6 @@ type ClientFlowBenchmark = {
|
|
|
55
55
|
};
|
|
56
56
|
export declare function generateBenchmark(flow: string, logs: Log[], stats: ProvingStats | SimulationStats, privateExecutionSteps: PrivateExecutionStep[], proverType: ProverType, error: string | undefined): ClientFlowBenchmark;
|
|
57
57
|
export declare function convertProfileToGHBenchmark(benchmark: ClientFlowBenchmark): GithubActionBenchmarkResult[];
|
|
58
|
-
export declare function captureProfile(label: string, interaction: ContractFunctionInteraction | DeployMethod, opts
|
|
58
|
+
export declare function captureProfile(label: string, interaction: ContractFunctionInteraction | DeployMethod, opts: Omit<ProfileMethodOptions & DeployOptions, 'profileMode'>, expectedSteps?: number): Promise<import("@aztec/aztec.js").TxProfileResult>;
|
|
59
59
|
export {};
|
|
60
60
|
//# sourceMappingURL=benchmark.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"benchmark.d.ts","sourceRoot":"","sources":["../../../src/bench/client_flows/benchmark.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,2BAA2B,EAC3B,YAAY,EACZ,aAAa,EACb,MAAM,EACN,oBAAoB,EACrB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,KAAK,oBAAoB,EAAkC,MAAM,sBAAsB,CAAC;AACjG,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAMzG,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAI/D,QAAA,MAAM,QAAQ,oFAAqF,CAAC;AACpG,KAAK,QAAQ,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1C,MAAM,MAAM,GAAG,GAAG;IAChB,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,GAAG,CAAC;CACX,CAAC;AAEF,QAAA,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"benchmark.d.ts","sourceRoot":"","sources":["../../../src/bench/client_flows/benchmark.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,2BAA2B,EAC3B,YAAY,EACZ,aAAa,EACb,MAAM,EACN,oBAAoB,EACrB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,KAAK,oBAAoB,EAAkC,MAAM,sBAAsB,CAAC;AACjG,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,iB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
|
'overflow'
|
|
@@ -77,9 +78,10 @@ export class ProxyLogger {
|
|
|
77
78
|
}
|
|
78
79
|
}
|
|
79
80
|
function getMinimumTrace(logs) {
|
|
81
|
+
const LOG_MESSAGE_CANDIDATE_PADDING = 5;
|
|
80
82
|
const minimumMessage = 'Minimum required block sizes for structured trace';
|
|
81
83
|
const minimumMessageIndex = logs.findIndex((log)=>log.message.includes(minimumMessage));
|
|
82
|
-
const candidateLogs = logs.slice(minimumMessageIndex - GATE_TYPES.length, minimumMessageIndex +
|
|
84
|
+
const candidateLogs = logs.slice(minimumMessageIndex - GATE_TYPES.length, minimumMessageIndex + LOG_MESSAGE_CANDIDATE_PADDING);
|
|
83
85
|
const traceLogs = candidateLogs.filter((log)=>GATE_TYPES.some((type)=>log.message.includes(type))).map((log)=>log.message.split(/\t|\n/)).flat().map((log)=>log.replace(/\(mem: .*\)/, '').trim()).filter(Boolean);
|
|
84
86
|
const traceSizes = traceLogs.map((log)=>{
|
|
85
87
|
const [gateType, gateSizeStr] = log.replace(/\n.*\)$/, '').replace(/bb - /, '').split(':').map((s)=>s.trim());
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type AccountWallet, AccountWalletWithSecretKey, AztecAddress, type AztecNode, FeeJuicePaymentMethod, FeeJuicePaymentMethodWithClaim, type FeePaymentMethod, type Logger, type PXE, PrivateFeePaymentMethod, SponsoredFeePaymentMethod, type Wallet } from '@aztec/aztec.js';
|
|
2
|
-
import { CheatCodes } from '@aztec/aztec
|
|
2
|
+
import { CheatCodes } from '@aztec/aztec/testing';
|
|
3
3
|
import { type DeployL1ContractsArgs } from '@aztec/ethereum';
|
|
4
4
|
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
5
5
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client_flows_benchmark.d.ts","sourceRoot":"","sources":["../../../src/bench/client_flows/client_flows_benchmark.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,aAAa,EAClB,0BAA0B,EAC1B,YAAY,EACZ,KAAK,SAAS,EACd,qBAAqB,EACrB,8BAA8B,EAC9B,KAAK,gBAAgB,EACrB,KAAK,MAAM,EACX,KAAK,GAAG,EACR,uBAAuB,EACvB,yBAAyB,EACzB,KAAK,MAAM,EAEZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"client_flows_benchmark.d.ts","sourceRoot":"","sources":["../../../src/bench/client_flows/client_flows_benchmark.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,aAAa,EAClB,0BAA0B,EAC1B,YAAY,EACZ,KAAK,SAAS,EACd,qBAAqB,EACrB,8BAA8B,EAC9B,KAAK,gBAAgB,EACrB,KAAK,MAAM,EACX,KAAK,GAAG,EACR,uBAAuB,EACvB,yBAAyB,EACzB,KAAK,MAAM,EAEZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,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;AAO5F,OAAO,EAEL,KAAK,iBAAiB,EAGvB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,KAAK,YAAY,EAAqB,MAAM,yBAAyB,CAAC;AAC/E,OAAO,E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EjC,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,EAAE,MAAM,EAAE,MAAM;IAMjE,sFAAsF;IAChF,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY;IAaxD,gCAAgC,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,GAAG,SAAS;IAmB/D,kBAAkB;IAKzB,4BAA4B;IAsC5B,0BAA0B;IAqB1B,8BAA8B;IAgB9B,gCAAgC;IAgBzB,qBAAqB;IA4B5B,+BAA+B;IAcxB,2BAA2B,CAAC,KAAK,EAAE,aAAa;IAyBhD,+BAA+B,CAAC,WAAW,EAAE,WAAW;IAyBxD,sBAAsB;IA0BtB,wCAAwC,CAAC,MAAM,EAAE,MAAM;IAQ7D,mCAAmC,CAAC,MAAM,EAAE,MAAM;IAIlD,qCAAqC,CAAC,OAAO,EAAE,MAAM;IAIrD,iCAAiC,CAAC,MAAM,EAAE,MAAM;CAGxD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EcdsaRAccountContractArtifact, getEcdsaRAccount } from '@aztec/accounts/ecdsa';
|
|
2
2
|
import { SchnorrAccountContractArtifact, getSchnorrAccount, getSchnorrWallet } from '@aztec/accounts/schnorr';
|
|
3
3
|
import { AccountWalletWithSecretKey, FeeJuicePaymentMethod, FeeJuicePaymentMethodWithClaim, PrivateFeePaymentMethod, SponsoredFeePaymentMethod, createLogger } from '@aztec/aztec.js';
|
|
4
|
-
import { CheatCodes } from '@aztec/aztec
|
|
4
|
+
import { CheatCodes } from '@aztec/aztec/testing';
|
|
5
5
|
import { FEE_FUNDING_FOR_TESTER_ACCOUNT } from '@aztec/constants';
|
|
6
6
|
import { RollupContract, createExtendedL1Client, deployL1Contract } from '@aztec/ethereum';
|
|
7
7
|
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
@@ -108,7 +108,7 @@ export class ClientFlowsBenchmark {
|
|
|
108
108
|
coinbase: this.coinbase
|
|
109
109
|
});
|
|
110
110
|
const rollupContract = RollupContract.getFromConfig(context.aztecNodeConfig);
|
|
111
|
-
this.chainMonitor = new ChainMonitor(rollupContract, this.logger, 200).start();
|
|
111
|
+
this.chainMonitor = new ChainMonitor(rollupContract, context.dateProvider, this.logger, 200).start();
|
|
112
112
|
return this;
|
|
113
113
|
}
|
|
114
114
|
async teardown() {
|
|
@@ -118,12 +118,18 @@ export class ClientFlowsBenchmark {
|
|
|
118
118
|
async mintAndBridgeFeeJuice(address, amount) {
|
|
119
119
|
const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(amount, address);
|
|
120
120
|
const { claimSecret: secret, messageLeafIndex: index } = claim;
|
|
121
|
-
await this.feeJuiceContract.methods.claim(address, amount, secret, index).send(
|
|
121
|
+
await this.feeJuiceContract.methods.claim(address, amount, secret, index).send({
|
|
122
|
+
from: this.adminAddress
|
|
123
|
+
}).wait();
|
|
122
124
|
}
|
|
123
125
|
/** Admin mints bananaCoin tokens privately to the target address and redeems them. */ async mintPrivateBananas(amount, address) {
|
|
124
|
-
const balanceBefore = await this.bananaCoin.methods.balance_of_private(address).simulate(
|
|
125
|
-
|
|
126
|
-
|
|
126
|
+
const balanceBefore = await this.bananaCoin.methods.balance_of_private(address).simulate({
|
|
127
|
+
from: this.adminAddress
|
|
128
|
+
});
|
|
129
|
+
await mintTokensToPrivate(this.bananaCoin, this.adminAddress, this.adminWallet, address, amount);
|
|
130
|
+
const balanceAfter = await this.bananaCoin.methods.balance_of_private(address).simulate({
|
|
131
|
+
from: this.adminAddress
|
|
132
|
+
});
|
|
127
133
|
expect(balanceAfter).toEqual(balanceBefore + amount);
|
|
128
134
|
}
|
|
129
135
|
async createBenchmarkingAccountManager(pxe, type) {
|
|
@@ -189,7 +195,9 @@ export class ClientFlowsBenchmark {
|
|
|
189
195
|
}
|
|
190
196
|
async applyDeployBananaTokenSnapshot() {
|
|
191
197
|
await this.snapshotManager.snapshot('deploy_banana_token', async ()=>{
|
|
192
|
-
const bananaCoin = await BananaCoin.deploy(this.adminWallet, this.adminAddress, 'BC', 'BC', 18n).send(
|
|
198
|
+
const bananaCoin = await BananaCoin.deploy(this.adminWallet, this.adminAddress, 'BC', 'BC', 18n).send({
|
|
199
|
+
from: this.adminAddress
|
|
200
|
+
}).deployed();
|
|
193
201
|
this.logger.info(`BananaCoin deployed at ${bananaCoin.address}`);
|
|
194
202
|
return {
|
|
195
203
|
bananaCoinAddress: bananaCoin.address
|
|
@@ -200,7 +208,9 @@ export class ClientFlowsBenchmark {
|
|
|
200
208
|
}
|
|
201
209
|
async applyDeployCandyBarTokenSnapshot() {
|
|
202
210
|
await this.snapshotManager.snapshot('deploy_candy_bar_token', async ()=>{
|
|
203
|
-
const candyBarCoin = await TokenContract.deploy(this.adminWallet, this.adminAddress, 'CBC', 'CBC', 18n).send(
|
|
211
|
+
const candyBarCoin = await TokenContract.deploy(this.adminWallet, this.adminAddress, 'CBC', 'CBC', 18n).send({
|
|
212
|
+
from: this.adminAddress
|
|
213
|
+
}).deployed();
|
|
204
214
|
this.logger.info(`CandyBarCoin deployed at ${candyBarCoin.address}`);
|
|
205
215
|
return {
|
|
206
216
|
candyBarCoinAddress: candyBarCoin.address
|
|
@@ -212,11 +222,13 @@ export class ClientFlowsBenchmark {
|
|
|
212
222
|
async applyFPCSetupSnapshot() {
|
|
213
223
|
await this.snapshotManager.snapshot('fpc_setup', async (context)=>{
|
|
214
224
|
const feeJuiceContract = this.feeJuiceBridgeTestHarness.feeJuice;
|
|
215
|
-
expect((await context.pxe.getContractMetadata(feeJuiceContract.address)).
|
|
225
|
+
expect((await context.pxe.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
|
|
216
226
|
const bananaCoin = this.bananaCoin;
|
|
217
|
-
const bananaFPC = await FPCContract.deploy(this.adminWallet, bananaCoin.address, this.adminAddress).send(
|
|
227
|
+
const bananaFPC = await FPCContract.deploy(this.adminWallet, bananaCoin.address, this.adminAddress).send({
|
|
228
|
+
from: this.adminAddress
|
|
229
|
+
}).deployed();
|
|
218
230
|
this.logger.info(`BananaPay deployed at ${bananaFPC.address}`);
|
|
219
|
-
await this.feeJuiceBridgeTestHarness.bridgeFromL1ToL2(FEE_FUNDING_FOR_TESTER_ACCOUNT, bananaFPC.address);
|
|
231
|
+
await this.feeJuiceBridgeTestHarness.bridgeFromL1ToL2(FEE_FUNDING_FOR_TESTER_ACCOUNT, bananaFPC.address, this.adminAddress);
|
|
220
232
|
return {
|
|
221
233
|
bananaFPCAddress: bananaFPC.address
|
|
222
234
|
};
|
|
@@ -243,7 +255,7 @@ export class ClientFlowsBenchmark {
|
|
|
243
255
|
l1Client.account.address
|
|
244
256
|
]).then(({ address })=>address);
|
|
245
257
|
this.logger.verbose(`Setting up cross chain harness...`);
|
|
246
|
-
const crossChainTestHarness = await CrossChainTestHarness.new(this.aztecNode, this.pxe, l1Client, owner, this.logger, underlyingERC20Address);
|
|
258
|
+
const crossChainTestHarness = await CrossChainTestHarness.new(this.aztecNode, this.pxe, l1Client, owner, owner.getAddress(), this.logger, underlyingERC20Address);
|
|
247
259
|
this.logger.verbose(`L2 token deployed to: ${crossChainTestHarness.l2Token.address}`);
|
|
248
260
|
return crossChainTestHarness;
|
|
249
261
|
}
|
|
@@ -269,10 +281,16 @@ export class ClientFlowsBenchmark {
|
|
|
269
281
|
}
|
|
270
282
|
async applyDeployAmmSnapshot() {
|
|
271
283
|
await this.snapshotManager.snapshot('deploy_amm', async ()=>{
|
|
272
|
-
const liquidityToken = await TokenContract.deploy(this.adminWallet, this.adminAddress, 'LPT', 'LPT', 18n).send(
|
|
273
|
-
|
|
284
|
+
const liquidityToken = await TokenContract.deploy(this.adminWallet, this.adminAddress, 'LPT', 'LPT', 18n).send({
|
|
285
|
+
from: this.adminAddress
|
|
286
|
+
}).deployed();
|
|
287
|
+
const amm = await AMMContract.deploy(this.adminWallet, this.bananaCoin.address, this.candyBarCoin.address, liquidityToken.address).send({
|
|
288
|
+
from: this.adminAddress
|
|
289
|
+
}).deployed();
|
|
274
290
|
this.logger.info(`AMM deployed at ${amm.address}`);
|
|
275
|
-
await liquidityToken.methods.set_minter(amm.address, true).send(
|
|
291
|
+
await liquidityToken.methods.set_minter(amm.address, true).send({
|
|
292
|
+
from: this.adminAddress
|
|
293
|
+
}).wait();
|
|
276
294
|
return {
|
|
277
295
|
ammAddress: amm.address,
|
|
278
296
|
liquidityTokenAddress: liquidityToken.address
|
|
@@ -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,EAAS,MAAM,sBAAsB,CAAC;AAEtF;;GAEG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG;IAC5B,6BAA6B,CAAC,OAAO,EAAE,CAAC,WAAW,GAAG,YAAY,CAAC,EAAE,CAAC;IACtE,kFAAkF;IAClF,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;;;;;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/bench/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAa,KAAK,MAAM,EA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,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,7 +14,9 @@ import { setup } from '../fixtures/utils.js';
|
|
|
14
14
|
benchmark: true
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
-
const contract = await BenchmarkingContract.deploy(context.wallet).send(
|
|
17
|
+
const contract = await BenchmarkingContract.deploy(context.wallet).send({
|
|
18
|
+
from: context.wallet.getAddress()
|
|
19
|
+
}).deployed();
|
|
18
20
|
context.logger.info(`Deployed benchmarking contract at ${contract.address}`);
|
|
19
21
|
const sequencer = context.aztecNode.getSequencer();
|
|
20
22
|
const telemetry = context.telemetryClient;
|
|
@@ -91,14 +93,13 @@ function getMetricValues(points) {
|
|
|
91
93
|
* @returns A BatchCall instance.
|
|
92
94
|
*/ function makeCall(index, context, contract, heavyPublicCompute) {
|
|
93
95
|
const owner = context.wallet.getAddress();
|
|
94
|
-
const sender = owner;
|
|
95
96
|
if (heavyPublicCompute) {
|
|
96
97
|
return new BatchCall(context.wallet, [
|
|
97
98
|
contract.methods.sha256_hash_2048(randomBytesAsBigInts(2048))
|
|
98
99
|
]);
|
|
99
100
|
} else {
|
|
100
101
|
return new BatchCall(context.wallet, [
|
|
101
|
-
contract.methods.create_note(owner,
|
|
102
|
+
contract.methods.create_note(owner, index + 1),
|
|
102
103
|
contract.methods.increment_balance(owner, index + 1)
|
|
103
104
|
]);
|
|
104
105
|
}
|
|
@@ -114,7 +115,9 @@ function getMetricValues(points) {
|
|
|
114
115
|
*/ export async function sendTxs(txCount, context, contract, heavyPublicCompute = false) {
|
|
115
116
|
const calls = times(txCount, (index)=>makeCall(index, context, contract, heavyPublicCompute));
|
|
116
117
|
context.logger.info(`Creating ${txCount} txs`);
|
|
117
|
-
const provenTxs = await Promise.all(calls.map((call)=>call.prove(
|
|
118
|
+
const provenTxs = await Promise.all(calls.map((call)=>call.prove({
|
|
119
|
+
from: context.wallet.getAddress()
|
|
120
|
+
})));
|
|
118
121
|
context.logger.info(`Sending ${txCount} txs`);
|
|
119
122
|
return provenTxs.map((tx)=>tx.send());
|
|
120
123
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { type AccountWallet, AztecAddress, type CompleteAddress, Fr, type Logger, type PXE, type TxHash } from '@aztec/aztec.js';
|
|
1
|
+
import { type AccountWallet, AztecAddress, type AztecNode, type CompleteAddress, Fr, type Logger, type PXE, type TxHash } from '@aztec/aztec.js';
|
|
2
|
+
import type { CheatCodes } from '@aztec/aztec/testing';
|
|
2
3
|
import { TokenBlacklistContract } from '@aztec/noir-contracts.js/TokenBlacklist';
|
|
3
4
|
import { InvalidAccountContract } from '@aztec/noir-test-contracts.js/InvalidAccount';
|
|
5
|
+
import type { SequencerClient } from '@aztec/sequencer-client';
|
|
4
6
|
import { type SubsystemsContext } from '../fixtures/snapshot_manager.js';
|
|
5
7
|
import { TokenSimulator } from '../simulators/token_simulator.js';
|
|
6
8
|
export declare class Role {
|
|
@@ -17,7 +19,7 @@ export declare class Role {
|
|
|
17
19
|
};
|
|
18
20
|
}
|
|
19
21
|
export declare class BlacklistTokenContractTest {
|
|
20
|
-
static
|
|
22
|
+
static CHANGE_ROLES_DELAY: number;
|
|
21
23
|
private snapshotManager;
|
|
22
24
|
logger: Logger;
|
|
23
25
|
wallets: AccountWallet[];
|
|
@@ -26,11 +28,17 @@ export declare class BlacklistTokenContractTest {
|
|
|
26
28
|
asset: TokenBlacklistContract;
|
|
27
29
|
tokenSim: TokenSimulator;
|
|
28
30
|
badAccount: InvalidAccountContract;
|
|
31
|
+
cheatCodes: CheatCodes;
|
|
32
|
+
sequencer: SequencerClient;
|
|
33
|
+
aztecNode: AztecNode;
|
|
29
34
|
admin: AccountWallet;
|
|
35
|
+
adminAddress: AztecAddress;
|
|
30
36
|
other: AccountWallet;
|
|
37
|
+
otherAddress: AztecAddress;
|
|
31
38
|
blacklisted: AccountWallet;
|
|
39
|
+
blacklistedAddress: AztecAddress;
|
|
32
40
|
constructor(testName: string);
|
|
33
|
-
|
|
41
|
+
crossTimestampOfChange(): Promise<void>;
|
|
34
42
|
/**
|
|
35
43
|
* Adds two state shifts to snapshot manager.
|
|
36
44
|
* 1. Add 3 accounts.
|
|
@@ -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;
|
|
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,SAAS,EACd,KAAK,eAAe,EACpB,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;AAI/D,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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
33
|
}
|
|
34
34
|
}
|
|
35
35
|
export class BlacklistTokenContractTest {
|
|
36
|
-
// A low delay is really poor ux, but we need to keep it low for the tests to run "quickly".
|
|
37
36
|
// This value MUST match the same value that we have in the contract
|
|
38
|
-
static
|
|
37
|
+
static CHANGE_ROLES_DELAY = 86400;
|
|
39
38
|
snapshotManager;
|
|
40
39
|
logger;
|
|
41
40
|
wallets = [];
|
|
@@ -44,17 +43,21 @@ export class BlacklistTokenContractTest {
|
|
|
44
43
|
asset;
|
|
45
44
|
tokenSim;
|
|
46
45
|
badAccount;
|
|
46
|
+
cheatCodes;
|
|
47
|
+
sequencer;
|
|
48
|
+
aztecNode;
|
|
47
49
|
admin;
|
|
50
|
+
adminAddress;
|
|
48
51
|
other;
|
|
52
|
+
otherAddress;
|
|
49
53
|
blacklisted;
|
|
54
|
+
blacklistedAddress;
|
|
50
55
|
constructor(testName){
|
|
51
56
|
this.logger = createLogger(`e2e:e2e_blacklist_token_contract:${testName}`);
|
|
52
57
|
this.snapshotManager = createSnapshotManager(`e2e_blacklist_token_contract/${testName}`, dataPath);
|
|
53
58
|
}
|
|
54
|
-
async
|
|
55
|
-
|
|
56
|
-
await this.asset.methods.get_roles(this.admin.getAddress()).send().wait();
|
|
57
|
-
}
|
|
59
|
+
async crossTimestampOfChange() {
|
|
60
|
+
await this.cheatCodes.warpL2TimeAtLeastBy(this.sequencer, this.aztecNode, BlacklistTokenContractTest.CHANGE_ROLES_DELAY);
|
|
58
61
|
}
|
|
59
62
|
/**
|
|
60
63
|
* Adds two state shifts to snapshot manager.
|
|
@@ -63,26 +66,36 @@ export class BlacklistTokenContractTest {
|
|
|
63
66
|
*/ async applyBaseSnapshots() {
|
|
64
67
|
// Adding a timeout of 2 minutes in here such that it is propagated to the underlying tests
|
|
65
68
|
jest.setTimeout(120_000);
|
|
66
|
-
await this.snapshotManager.snapshot('3_accounts', deployAccounts(3, this.logger), async ({ deployedAccounts }, { pxe })=>{
|
|
69
|
+
await this.snapshotManager.snapshot('3_accounts', deployAccounts(3, this.logger), async ({ deployedAccounts }, { pxe, cheatCodes, aztecNode, sequencer })=>{
|
|
67
70
|
this.pxe = pxe;
|
|
71
|
+
this.cheatCodes = cheatCodes;
|
|
72
|
+
this.aztecNode = aztecNode;
|
|
73
|
+
this.sequencer = sequencer;
|
|
68
74
|
this.wallets = await Promise.all(deployedAccounts.map((a)=>getSchnorrWallet(pxe, a.address, a.signingKey)));
|
|
69
75
|
this.admin = this.wallets[0];
|
|
76
|
+
this.adminAddress = this.admin.getAddress();
|
|
70
77
|
this.other = this.wallets[1];
|
|
78
|
+
this.otherAddress = this.other.getAddress();
|
|
71
79
|
this.blacklisted = this.wallets[2];
|
|
80
|
+
this.blacklistedAddress = this.blacklisted.getAddress();
|
|
72
81
|
this.accounts = this.wallets.map((w)=>w.getCompleteAddress());
|
|
73
82
|
});
|
|
74
83
|
await this.snapshotManager.snapshot('e2e_blacklist_token_contract', async ()=>{
|
|
75
84
|
// Create the token contract state.
|
|
76
85
|
// Move this account thing to addAccounts above?
|
|
77
86
|
this.logger.verbose(`Public deploy accounts...`);
|
|
78
|
-
await publicDeployAccounts(this.
|
|
87
|
+
await publicDeployAccounts(this.admin, this.accounts.slice(0, 3));
|
|
79
88
|
this.logger.verbose(`Deploying TokenContract...`);
|
|
80
|
-
this.asset = await TokenBlacklistContract.deploy(this.admin, this.
|
|
89
|
+
this.asset = await TokenBlacklistContract.deploy(this.admin, this.adminAddress).send({
|
|
90
|
+
from: this.adminAddress
|
|
91
|
+
}).deployed();
|
|
81
92
|
this.logger.verbose(`Token deployed to ${this.asset.address}`);
|
|
82
93
|
this.logger.verbose(`Deploying bad account...`);
|
|
83
|
-
this.badAccount = await InvalidAccountContract.deploy(this.
|
|
94
|
+
this.badAccount = await InvalidAccountContract.deploy(this.admin).send({
|
|
95
|
+
from: this.adminAddress
|
|
96
|
+
}).deployed();
|
|
84
97
|
this.logger.verbose(`Deployed to ${this.badAccount.address}.`);
|
|
85
|
-
await this.
|
|
98
|
+
await this.crossTimestampOfChange();
|
|
86
99
|
return {
|
|
87
100
|
tokenContractAddress: this.asset.address,
|
|
88
101
|
badAccountAddress: this.badAccount.address
|
|
@@ -91,10 +104,12 @@ export class BlacklistTokenContractTest {
|
|
|
91
104
|
// Restore the token contract state.
|
|
92
105
|
this.asset = await TokenBlacklistContract.at(tokenContractAddress, this.wallets[0]);
|
|
93
106
|
this.logger.verbose(`Token contract address: ${this.asset.address}`);
|
|
94
|
-
this.tokenSim = new TokenSimulator(this.asset, this.
|
|
107
|
+
this.tokenSim = new TokenSimulator(this.asset, this.admin, this.adminAddress, this.logger, this.accounts.map((a)=>a.address));
|
|
95
108
|
this.badAccount = await InvalidAccountContract.at(badAccountAddress, this.wallets[0]);
|
|
96
109
|
this.logger.verbose(`Bad account address: ${this.badAccount.address}`);
|
|
97
|
-
expect(await this.asset.methods.get_roles(this.
|
|
110
|
+
expect(await this.asset.methods.get_roles(this.adminAddress).simulate({
|
|
111
|
+
from: this.adminAddress
|
|
112
|
+
})).toEqual(new Role().withAdmin().toNoirStruct());
|
|
98
113
|
});
|
|
99
114
|
}
|
|
100
115
|
async setup() {
|
|
@@ -106,26 +121,40 @@ export class BlacklistTokenContractTest {
|
|
|
106
121
|
}
|
|
107
122
|
async addPendingShieldNoteToPXE(contract, recipient, amount, secretHash, txHash) {
|
|
108
123
|
const txEffects = await this.pxe.getTxEffect(txHash);
|
|
109
|
-
await contract.methods.deliver_transparent_note(contract.address, amount, secretHash, txHash.hash, txEffects.data.noteHashes, txEffects.data.nullifiers[0], recipient).simulate(
|
|
124
|
+
await contract.methods.deliver_transparent_note(contract.address, amount, secretHash, txHash.hash, txEffects.data.noteHashes, txEffects.data.nullifiers[0], recipient).simulate({
|
|
125
|
+
from: recipient
|
|
126
|
+
});
|
|
110
127
|
}
|
|
111
128
|
async applyMintSnapshot() {
|
|
112
129
|
await this.snapshotManager.snapshot('mint', async ()=>{
|
|
113
130
|
const { asset, accounts, wallets } = this;
|
|
114
131
|
const amount = 10000n;
|
|
115
132
|
const adminMinterRole = new Role().withAdmin().withMinter();
|
|
116
|
-
await this.asset.withWallet(this.admin).methods.update_roles(this.admin.getAddress(), adminMinterRole.toNoirStruct()).send(
|
|
133
|
+
await this.asset.withWallet(this.admin).methods.update_roles(this.admin.getAddress(), adminMinterRole.toNoirStruct()).send({
|
|
134
|
+
from: this.adminAddress
|
|
135
|
+
}).wait();
|
|
117
136
|
const blacklistRole = new Role().withBlacklisted();
|
|
118
|
-
await this.asset.withWallet(this.admin).methods.update_roles(this.blacklisted.getAddress(), blacklistRole.toNoirStruct()).send(
|
|
119
|
-
|
|
120
|
-
|
|
137
|
+
await this.asset.withWallet(this.admin).methods.update_roles(this.blacklisted.getAddress(), blacklistRole.toNoirStruct()).send({
|
|
138
|
+
from: this.adminAddress
|
|
139
|
+
}).wait();
|
|
140
|
+
await this.crossTimestampOfChange();
|
|
141
|
+
expect(await this.asset.methods.get_roles(this.admin.getAddress()).simulate({
|
|
142
|
+
from: this.adminAddress
|
|
143
|
+
})).toEqual(adminMinterRole.toNoirStruct());
|
|
121
144
|
this.logger.verbose(`Minting ${amount} publicly...`);
|
|
122
|
-
await asset.methods.mint_public(accounts[0].address, amount).send(
|
|
145
|
+
await asset.methods.mint_public(accounts[0].address, amount).send({
|
|
146
|
+
from: this.adminAddress
|
|
147
|
+
}).wait();
|
|
123
148
|
this.logger.verbose(`Minting ${amount} privately...`);
|
|
124
149
|
const secret = Fr.random();
|
|
125
150
|
const secretHash = await computeSecretHash(secret);
|
|
126
|
-
const receipt = await asset.methods.mint_private(amount, secretHash).send(
|
|
151
|
+
const receipt = await asset.methods.mint_private(amount, secretHash).send({
|
|
152
|
+
from: this.adminAddress
|
|
153
|
+
}).wait();
|
|
127
154
|
await this.addPendingShieldNoteToPXE(asset, wallets[0].getAddress(), amount, secretHash, receipt.txHash);
|
|
128
|
-
const txClaim = asset.methods.redeem_shield(accounts[0].address, amount, secret).send(
|
|
155
|
+
const txClaim = asset.methods.redeem_shield(accounts[0].address, amount, secret).send({
|
|
156
|
+
from: this.adminAddress
|
|
157
|
+
});
|
|
129
158
|
await txClaim.wait();
|
|
130
159
|
this.logger.verbose(`Minting complete.`);
|
|
131
160
|
return {
|
|
@@ -134,14 +163,20 @@ export class BlacklistTokenContractTest {
|
|
|
134
163
|
}, async ({ amount })=>{
|
|
135
164
|
const { asset, accounts: [{ address }], tokenSim } = this;
|
|
136
165
|
tokenSim.mintPublic(address, amount);
|
|
137
|
-
const publicBalance = await asset.methods.balance_of_public(address).simulate(
|
|
166
|
+
const publicBalance = await asset.methods.balance_of_public(address).simulate({
|
|
167
|
+
from: address
|
|
168
|
+
});
|
|
138
169
|
this.logger.verbose(`Public balance of wallet 0: ${publicBalance}`);
|
|
139
170
|
expect(publicBalance).toEqual(this.tokenSim.balanceOfPublic(address));
|
|
140
171
|
tokenSim.mintPrivate(address, amount);
|
|
141
|
-
const privateBalance = await asset.methods.balance_of_private(address).simulate(
|
|
172
|
+
const privateBalance = await asset.methods.balance_of_private(address).simulate({
|
|
173
|
+
from: address
|
|
174
|
+
});
|
|
142
175
|
this.logger.verbose(`Private balance of wallet 0: ${privateBalance}`);
|
|
143
176
|
expect(privateBalance).toEqual(tokenSim.balanceOfPrivate(address));
|
|
144
|
-
const totalSupply = await asset.methods.total_supply().simulate(
|
|
177
|
+
const totalSupply = await asset.methods.total_supply().simulate({
|
|
178
|
+
from: address
|
|
179
|
+
});
|
|
145
180
|
this.logger.verbose(`Total supply: ${totalSupply}`);
|
|
146
181
|
expect(totalSupply).toEqual(tokenSim.totalSupply);
|
|
147
182
|
return Promise.resolve();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AztecNodeConfig } from '@aztec/aztec-node';
|
|
2
2
|
import { type AccountWallet, AztecAddress, type AztecNode, type CompleteAddress, EthAddress, type Logger, type PXE } from '@aztec/aztec.js';
|
|
3
|
-
import { CheatCodes } from '@aztec/aztec
|
|
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';
|
|
@@ -10,7 +10,6 @@ import { CrossChainTestHarness } from '../shared/cross_chain_test_harness.js';
|
|
|
10
10
|
export declare class CrossChainMessagingTest {
|
|
11
11
|
private snapshotManager;
|
|
12
12
|
logger: Logger;
|
|
13
|
-
wallets: AccountWallet[];
|
|
14
13
|
accounts: CompleteAddress[];
|
|
15
14
|
aztecNode: AztecNode;
|
|
16
15
|
pxe: PXE;
|
|
@@ -18,7 +17,9 @@ export declare class CrossChainMessagingTest {
|
|
|
18
17
|
aztecNodeAdmin: AztecNodeAdmin;
|
|
19
18
|
l1Client: ExtendedViemWalletClient | undefined;
|
|
20
19
|
user1Wallet: AccountWallet;
|
|
20
|
+
user1Address: AztecAddress;
|
|
21
21
|
user2Wallet: AccountWallet;
|
|
22
|
+
user2Address: AztecAddress;
|
|
22
23
|
crossChainTestHarness: CrossChainTestHarness;
|
|
23
24
|
ethAccount: EthAddress;
|
|
24
25
|
ownerAddress: AztecAddress;
|
|
@@ -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":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EACL,KAAK,aAAa,EAClB,YAAY,EACZ,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,UAAU,EACV,KAAK,MAAM,EACX,KAAK,GAAG,EAET,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"cross_chain_messaging_test.d.ts","sourceRoot":"","sources":["../../src/e2e_cross_chain_messaging/cross_chain_messaging_test.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;IACZ,MAAM,EAAG,GAAG,CAAC;IACb,UAAU,EAAG,UAAU,CAAC;IAExB,uBAAuB,EAAG,2BAA2B,CAAC;gBAE1C,QAAQ,EAAE,MAAM;IAKtB,YAAY;IAIZ,KAAK;IAUX,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,kBAAkB;CAiGzB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getSchnorrWallet } from '@aztec/accounts/schnorr';
|
|
2
2
|
import { AztecAddress, EthAddress, createLogger } from '@aztec/aztec.js';
|
|
3
|
-
import { CheatCodes } from '@aztec/aztec
|
|
3
|
+
import { CheatCodes } from '@aztec/aztec/testing';
|
|
4
4
|
import { createExtendedL1Client, deployL1Contract } from '@aztec/ethereum';
|
|
5
5
|
import { InboxAbi, OutboxAbi, TestERC20Abi, TestERC20Bytecode } from '@aztec/l1-artifacts';
|
|
6
6
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
@@ -13,7 +13,6 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
13
13
|
export class CrossChainMessagingTest {
|
|
14
14
|
snapshotManager;
|
|
15
15
|
logger;
|
|
16
|
-
wallets = [];
|
|
17
16
|
accounts = [];
|
|
18
17
|
aztecNode;
|
|
19
18
|
pxe;
|
|
@@ -21,7 +20,9 @@ export class CrossChainMessagingTest {
|
|
|
21
20
|
aztecNodeAdmin;
|
|
22
21
|
l1Client;
|
|
23
22
|
user1Wallet;
|
|
23
|
+
user1Address;
|
|
24
24
|
user2Wallet;
|
|
25
|
+
user2Address;
|
|
25
26
|
crossChainTestHarness;
|
|
26
27
|
ethAccount;
|
|
27
28
|
ownerAddress;
|
|
@@ -55,11 +56,13 @@ export class CrossChainMessagingTest {
|
|
|
55
56
|
// Note that we are using the same `pxe`, `aztecNodeConfig` and `aztecNode` across all snapshots.
|
|
56
57
|
// This is to not have issues with different networks.
|
|
57
58
|
await this.snapshotManager.snapshot('3_accounts', deployAccounts(3, this.logger), async ({ deployedAccounts }, { pxe, aztecNodeConfig, aztecNode })=>{
|
|
58
|
-
|
|
59
|
-
this.accounts =
|
|
60
|
-
|
|
61
|
-
this.user1Wallet =
|
|
62
|
-
this.
|
|
59
|
+
const wallets = await Promise.all(deployedAccounts.map((a)=>getSchnorrWallet(pxe, a.address, a.signingKey)));
|
|
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();
|
|
63
66
|
this.pxe = pxe;
|
|
64
67
|
this.aztecNode = aztecNode;
|
|
65
68
|
this.aztecNodeConfig = aztecNodeConfig;
|
|
@@ -68,7 +71,7 @@ export class CrossChainMessagingTest {
|
|
|
68
71
|
// Create the token contract state.
|
|
69
72
|
// Move this account thing to addAccounts above?
|
|
70
73
|
this.logger.verbose(`Public deploy accounts...`);
|
|
71
|
-
await publicDeployAccounts(this.
|
|
74
|
+
await publicDeployAccounts(this.user1Wallet, this.accounts.slice(0, 3));
|
|
72
75
|
this.l1Client = createExtendedL1Client(this.aztecNodeConfig.l1RpcUrls, MNEMONIC);
|
|
73
76
|
const underlyingERC20Address = await deployL1Contract(this.l1Client, TestERC20Abi, TestERC20Bytecode, [
|
|
74
77
|
'Underlying',
|
|
@@ -76,7 +79,7 @@ export class CrossChainMessagingTest {
|
|
|
76
79
|
this.l1Client.account.address
|
|
77
80
|
]).then(({ address })=>address);
|
|
78
81
|
this.logger.verbose(`Setting up cross chain harness...`);
|
|
79
|
-
this.crossChainTestHarness = await CrossChainTestHarness.new(this.aztecNode, this.pxe, this.l1Client, this.
|
|
82
|
+
this.crossChainTestHarness = await CrossChainTestHarness.new(this.aztecNode, this.pxe, this.l1Client, this.user1Wallet, this.user1Address, this.logger, underlyingERC20Address);
|
|
80
83
|
this.logger.verbose(`L2 token deployed to: ${this.crossChainTestHarness.l2Token.address}`);
|
|
81
84
|
return this.crossChainTestHarness.toCrossChainContext();
|
|
82
85
|
}, async (crossChainContext)=>{
|
|
@@ -97,7 +100,7 @@ export class CrossChainMessagingTest {
|
|
|
97
100
|
abi: OutboxAbi,
|
|
98
101
|
client: l1Client
|
|
99
102
|
});
|
|
100
|
-
this.crossChainTestHarness = new CrossChainTestHarness(this.aztecNode, this.pxe, this.logger, this.l2Token, this.l2Bridge, this.ethAccount, tokenPortalAddress, crossChainContext.underlying, l1Client, this.aztecNodeConfig.l1Contracts, this.user1Wallet);
|
|
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.user1Wallet, this.user1Address);
|
|
101
104
|
this.l1Client = l1Client;
|
|
102
105
|
this.inbox = inbox;
|
|
103
106
|
this.outbox = outbox;
|
|
@@ -3,10 +3,10 @@ import type { StatefulTestContract } from '@aztec/noir-test-contracts.js/Statefu
|
|
|
3
3
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
4
4
|
export declare class DeployTest {
|
|
5
5
|
private snapshotManager;
|
|
6
|
-
private wallets;
|
|
7
6
|
logger: Logger;
|
|
8
7
|
pxe: PXE;
|
|
9
8
|
wallet: AccountWallet;
|
|
9
|
+
defaultAccountAddress: AztecAddress;
|
|
10
10
|
aztecNode: AztecNode;
|
|
11
11
|
aztecNodeAdmin: AztecNodeAdmin;
|
|
12
12
|
constructor(testName: string);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy_test.d.ts","sourceRoot":"","sources":["../../src/e2e_deploy_contract/deploy_test.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAClB,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;
|
|
1
|
+
{"version":3,"file":"deploy_test.d.ts","sourceRoot":"","sources":["../../src/e2e_deploy_contract/deploy_test.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAClB,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,aAAa,CAAC;IACvB,qBAAqB,EAAG,YAAY,CAAC;IACrC,SAAS,EAAG,SAAS,CAAC;IACtB,cAAc,EAAG,cAAc,CAAC;gBAE3B,QAAQ,EAAE,MAAM;IAKtB,KAAK;IAQL,QAAQ;YAIA,2BAA2B;IAanC,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,13 +1,13 @@
|
|
|
1
1
|
import { getSchnorrWallet } from '@aztec/accounts/schnorr';
|
|
2
|
-
import { Fr, createLogger,
|
|
2
|
+
import { Fr, createLogger, getContractInstanceFromInstantiationParams } from '@aztec/aztec.js';
|
|
3
3
|
import { createSnapshotManager, deployAccounts } from '../fixtures/snapshot_manager.js';
|
|
4
4
|
const { E2E_DATA_PATH: dataPath } = process.env;
|
|
5
5
|
export class DeployTest {
|
|
6
6
|
snapshotManager;
|
|
7
|
-
wallets = [];
|
|
8
7
|
logger;
|
|
9
8
|
pxe;
|
|
10
9
|
wallet;
|
|
10
|
+
defaultAccountAddress;
|
|
11
11
|
aztecNode;
|
|
12
12
|
aztecNodeAdmin;
|
|
13
13
|
constructor(testName){
|
|
@@ -26,14 +26,15 @@ export class DeployTest {
|
|
|
26
26
|
}
|
|
27
27
|
async applyInitialAccountSnapshot() {
|
|
28
28
|
await this.snapshotManager.snapshot('initial_account', deployAccounts(1, this.logger), async ({ deployedAccounts }, { pxe })=>{
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
this.wallet =
|
|
29
|
+
const wallets = await Promise.all(deployedAccounts.map((a)=>getSchnorrWallet(pxe, a.address, a.signingKey)));
|
|
30
|
+
wallets.forEach((w, i)=>this.logger.verbose(`Wallet ${i} address: ${w.getAddress()}`));
|
|
31
|
+
this.wallet = wallets[0];
|
|
32
|
+
this.defaultAccountAddress = this.wallet.getAddress();
|
|
32
33
|
});
|
|
33
34
|
}
|
|
34
35
|
async registerContract(wallet, contractArtifact, opts = {}) {
|
|
35
36
|
const { salt, publicKeys, initArgs, constructorName, deployer } = opts;
|
|
36
|
-
const instance = await
|
|
37
|
+
const instance = await getContractInstanceFromInstantiationParams(contractArtifact.artifact, {
|
|
37
38
|
constructorArgs: initArgs ?? [],
|
|
38
39
|
constructorArtifact: constructorName,
|
|
39
40
|
salt,
|