@aztec/end-to-end 2.1.0-rc.9 → 3.0.0-devnet.2
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 +3 -2
- package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.d.ts +16 -12
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +54 -58
- package/dest/bench/utils.d.ts +2 -11
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +10 -34
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +7 -7
- 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 +42 -42
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +10 -8
- 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 +31 -33
- package/dest/e2e_deploy_contract/deploy_test.d.ts +10 -4
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
- package/dest/e2e_deploy_contract/deploy_test.js +9 -18
- package/dest/e2e_epochs/epochs_test.d.ts +3 -1
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +10 -9
- package/dest/e2e_fees/bridging_race.notest.js +12 -9
- package/dest/e2e_fees/fees_test.d.ts +5 -5
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +23 -31
- package/dest/e2e_l1_publisher/write_json.d.ts +3 -1
- package/dest/e2e_l1_publisher/write_json.d.ts.map +1 -1
- package/dest/e2e_l1_publisher/write_json.js +5 -5
- package/dest/e2e_multi_validator/utils.d.ts +1 -1
- package/dest/e2e_multi_validator/utils.d.ts.map +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.d.ts +6 -3
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +7 -9
- package/dest/e2e_p2p/inactivity_slash_test.d.ts +2 -2
- package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -1
- package/dest/e2e_p2p/inactivity_slash_test.js +5 -2
- package/dest/e2e_p2p/p2p_network.d.ts +16 -4
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +32 -10
- package/dest/e2e_p2p/shared.d.ts +11 -13
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +49 -45
- package/dest/e2e_token_contract/token_contract_test.d.ts +5 -4
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/e2e_token_contract/token_contract_test.js +14 -17
- package/dest/fixtures/e2e_prover_test.d.ts +8 -6
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +40 -50
- package/dest/fixtures/get_acvm_config.d.ts +1 -1
- package/dest/fixtures/get_acvm_config.d.ts.map +1 -1
- package/dest/fixtures/get_bb_config.d.ts +1 -1
- package/dest/fixtures/get_bb_config.d.ts.map +1 -1
- package/dest/fixtures/get_bb_config.js +2 -2
- package/dest/fixtures/setup_l1_contracts.d.ts +1 -1
- package/dest/fixtures/setup_l1_contracts.d.ts.map +1 -1
- package/dest/fixtures/setup_l1_contracts.js +2 -2
- package/dest/fixtures/setup_p2p_test.d.ts +0 -7
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.d.ts +10 -7
- package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.js +44 -34
- package/dest/fixtures/token_utils.d.ts +6 -4
- package/dest/fixtures/token_utils.d.ts.map +1 -1
- package/dest/fixtures/token_utils.js +11 -15
- package/dest/fixtures/utils.d.ts +23 -27
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +76 -101
- package/dest/fixtures/web3signer.d.ts +1 -1
- package/dest/fixtures/web3signer.d.ts.map +1 -1
- package/dest/fixtures/web3signer.js +16 -5
- package/dest/quality_of_service/alert_checker.d.ts +1 -1
- package/dest/quality_of_service/alert_checker.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.d.ts +16 -10
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +13 -15
- package/dest/shared/gas_portal_test_harness.d.ts +9 -6
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.js +10 -7
- package/dest/shared/jest_setup.js +1 -1
- package/dest/shared/submit-transactions.d.ts +5 -3
- package/dest/shared/submit-transactions.d.ts.map +1 -1
- package/dest/shared/submit-transactions.js +8 -7
- package/dest/shared/uniswap_l1_l2.d.ts +9 -6
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +29 -45
- package/dest/simulators/lending_simulator.d.ts +2 -1
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.js +3 -2
- package/dest/simulators/token_simulator.d.ts +3 -1
- package/dest/simulators/token_simulator.d.ts.map +1 -1
- package/dest/simulators/token_simulator.js +2 -2
- package/dest/spartan/setup_test_wallets.d.ts +19 -13
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +108 -85
- package/dest/spartan/utils.d.ts +44 -0
- package/dest/spartan/utils.d.ts.map +1 -1
- package/dest/spartan/utils.js +212 -20
- package/package.json +38 -37
- package/src/bench/client_flows/benchmark.ts +6 -6
- package/src/bench/client_flows/client_flows_benchmark.ts +62 -82
- package/src/bench/client_flows/data_extractor.ts +1 -1
- package/src/bench/utils.ts +9 -37
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +46 -63
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +33 -47
- package/src/e2e_deploy_contract/deploy_test.ts +17 -35
- package/src/e2e_epochs/epochs_test.ts +12 -14
- package/src/e2e_fees/bridging_race.notest.ts +14 -9
- package/src/e2e_fees/fees_test.ts +26 -38
- package/src/e2e_l1_publisher/write_json.ts +8 -6
- package/src/e2e_multi_validator/utils.ts +1 -1
- package/src/e2e_nested_contract/nested_contract_test.ts +11 -10
- package/src/e2e_p2p/inactivity_slash_test.ts +7 -3
- package/src/e2e_p2p/p2p_network.ts +105 -67
- package/src/e2e_p2p/shared.ts +50 -55
- package/src/e2e_token_contract/token_contract_test.ts +17 -17
- package/src/fixtures/e2e_prover_test.ts +51 -88
- package/src/fixtures/get_acvm_config.ts +1 -1
- package/src/fixtures/get_bb_config.ts +3 -2
- package/src/fixtures/setup_l1_contracts.ts +3 -3
- package/src/fixtures/setup_p2p_test.ts +0 -8
- package/src/fixtures/snapshot_manager.ts +61 -61
- package/src/fixtures/token_utils.ts +13 -21
- package/src/fixtures/utils.ts +87 -138
- package/src/fixtures/web3signer.ts +22 -5
- package/src/guides/up_quick_start.sh +2 -10
- package/src/quality_of_service/alert_checker.ts +1 -1
- package/src/shared/cross_chain_test_harness.ts +18 -29
- package/src/shared/gas_portal_test_harness.ts +12 -19
- package/src/shared/jest_setup.ts +1 -1
- package/src/shared/submit-transactions.ts +12 -8
- package/src/shared/uniswap_l1_l2.ts +61 -67
- package/src/simulators/lending_simulator.ts +3 -2
- package/src/simulators/token_simulator.ts +5 -2
- package/src/spartan/DEVELOP.md +8 -3
- package/src/spartan/setup_test_wallets.ts +133 -126
- package/src/spartan/utils.ts +268 -18
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ContractFunctionInteraction, DeployMethod, type DeployOptions, type ProfileInteractionOptions } from '@aztec/aztec.js/contracts';
|
|
2
|
+
import type { Logger } from '@aztec/aztec.js/log';
|
|
2
3
|
import { type PrivateExecutionStep } from '@aztec/stdlib/kernel';
|
|
3
4
|
import type { ProvingStats, ProvingTimings, SimulationStats, SimulationTimings } from '@aztec/stdlib/tx';
|
|
4
5
|
import type { GithubActionBenchmarkResult } from '../utils.js';
|
|
@@ -55,6 +56,6 @@ type ClientFlowBenchmark = {
|
|
|
55
56
|
};
|
|
56
57
|
export declare function generateBenchmark(flow: string, logs: Log[], stats: ProvingStats | SimulationStats, privateExecutionSteps: PrivateExecutionStep[], proverType: ProverType, error: string | undefined): ClientFlowBenchmark;
|
|
57
58
|
export declare function convertProfileToGHBenchmark(benchmark: ClientFlowBenchmark): GithubActionBenchmarkResult[];
|
|
58
|
-
export declare function captureProfile(label: string, interaction: ContractFunctionInteraction | DeployMethod, opts: Omit<
|
|
59
|
+
export declare function captureProfile(label: string, interaction: ContractFunctionInteraction | DeployMethod, opts: Omit<ProfileInteractionOptions & DeployOptions, 'profileMode'>, expectedSteps?: number): Promise<import("@aztec/stdlib/tx").TxProfileResult>;
|
|
59
60
|
export {};
|
|
60
61
|
//# 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,
|
|
1
|
+
{"version":3,"file":"benchmark.d.ts","sourceRoot":"","sources":["../../../src/bench/client_flows/benchmark.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,YAAY,EACZ,KAAK,aAAa,EAClB,KAAK,yBAAyB,EAC/B,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD,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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AAC;CACxC,CAAC;AAEF,KAAK,mBAAmB,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,IAAI,CAAC,cAAc,GAAG,iBAAiB,EAAE,aAAa,CAAC,GAAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACtF,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACnC,UAAU,EAAE,UAAU,CAAC;IACvB,YAAY,EAAE,eAAe,CAAC;IAC9B,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B,CAAC;AA0CF,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,GAAG,EAAE,EACX,KAAK,EAAE,YAAY,GAAG,eAAe,EACrC,qBAAqB,EAAE,oBAAoB,EAAE,EAC7C,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,MAAM,GAAG,SAAS,GACxB,mBAAmB,CAsErB;AAED,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,mBAAmB,GAAG,2BAA2B,EAAE,CAmDzG;AAED,wBAAsB,cAAc,CAClC,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,2BAA2B,GAAG,YAAY,EACvD,IAAI,EAAE,IAAI,CAAC,yBAAyB,GAAG,aAAa,EAAE,aAAa,CAAC,EACpE,aAAa,CAAC,EAAE,MAAM,uDAoCvB"}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
+
import { FeeJuicePaymentMethodWithClaim } from '@aztec/aztec.js/fee';
|
|
3
|
+
import { type FeePaymentMethod, PrivateFeePaymentMethod, SponsoredFeePaymentMethod } from '@aztec/aztec.js/fee';
|
|
4
|
+
import { type Logger } from '@aztec/aztec.js/log';
|
|
5
|
+
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
6
|
+
import type { Wallet } from '@aztec/aztec.js/wallet';
|
|
2
7
|
import { CheatCodes } from '@aztec/aztec/testing';
|
|
3
8
|
import { type DeployL1ContractsArgs } from '@aztec/ethereum';
|
|
4
9
|
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
@@ -8,24 +13,24 @@ import { FPCContract } from '@aztec/noir-contracts.js/FPC';
|
|
|
8
13
|
import { FeeJuiceContract } from '@aztec/noir-contracts.js/FeeJuice';
|
|
9
14
|
import { SponsoredFPCContract } from '@aztec/noir-contracts.js/SponsoredFPC';
|
|
10
15
|
import { TokenContract as BananaCoin, TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
16
|
+
import { TestWallet } from '@aztec/test-wallet/server';
|
|
11
17
|
import { type SubsystemsContext } from '../../fixtures/snapshot_manager.js';
|
|
12
18
|
import { type SetupOptions } from '../../fixtures/utils.js';
|
|
13
19
|
import { CrossChainTestHarness } from '../../shared/cross_chain_test_harness.js';
|
|
14
20
|
import { type GasBridgingTestHarness } from '../../shared/gas_portal_test_harness.js';
|
|
15
21
|
import { type ClientFlowsConfig } from './config.js';
|
|
16
22
|
export type AccountType = 'ecdsar1' | 'schnorr';
|
|
17
|
-
export type FeePaymentMethodGetter = (wallet: Wallet) => Promise<FeePaymentMethod>;
|
|
23
|
+
export type FeePaymentMethodGetter = (wallet: Wallet, sender: AztecAddress) => Promise<FeePaymentMethod | undefined>;
|
|
18
24
|
export type BenchmarkingFeePaymentMethod = 'bridged_fee_juice' | 'private_fpc' | 'sponsored_fpc' | 'fee_juice';
|
|
19
25
|
export declare class ClientFlowsBenchmark {
|
|
20
26
|
private snapshotManager;
|
|
21
27
|
logger: Logger;
|
|
22
|
-
pxe: PXE;
|
|
23
28
|
aztecNode: AztecNode;
|
|
24
29
|
cheatCodes: CheatCodes;
|
|
25
30
|
context: SubsystemsContext;
|
|
26
31
|
chainMonitor: ChainMonitor;
|
|
27
32
|
feeJuiceBridgeTestHarness: GasBridgingTestHarness;
|
|
28
|
-
adminWallet:
|
|
33
|
+
adminWallet: TestWallet;
|
|
29
34
|
adminAddress: AztecAddress;
|
|
30
35
|
sequencerAddress: AztecAddress;
|
|
31
36
|
coinbase: EthAddress;
|
|
@@ -36,7 +41,7 @@ export declare class ClientFlowsBenchmark {
|
|
|
36
41
|
amm: AMMContract;
|
|
37
42
|
liquidityToken: TokenContract;
|
|
38
43
|
sponsoredFPC: SponsoredFPCContract;
|
|
39
|
-
|
|
44
|
+
userWallet: TestWallet;
|
|
40
45
|
realProofs: boolean;
|
|
41
46
|
paymentMethods: Record<BenchmarkingFeePaymentMethod, {
|
|
42
47
|
forWallet: FeePaymentMethodGetter;
|
|
@@ -50,7 +55,7 @@ export declare class ClientFlowsBenchmark {
|
|
|
50
55
|
mintAndBridgeFeeJuice(address: AztecAddress): Promise<void>;
|
|
51
56
|
/** Admin mints bananaCoin tokens privately to the target address and redeems them. */
|
|
52
57
|
mintPrivateBananas(amount: bigint, address: AztecAddress): Promise<void>;
|
|
53
|
-
createBenchmarkingAccountManager(
|
|
58
|
+
createBenchmarkingAccountManager(wallet: TestWallet, type: 'ecdsar1' | 'schnorr'): Promise<import("@aztec/aztec.js/wallet").AccountManager>;
|
|
54
59
|
applyBaseSnapshots(): Promise<void>;
|
|
55
60
|
applyInitialAccountsSnapshot(): Promise<void>;
|
|
56
61
|
applySetupFeeJuiceSnapshot(): Promise<void>;
|
|
@@ -58,12 +63,11 @@ export declare class ClientFlowsBenchmark {
|
|
|
58
63
|
applyDeployCandyBarTokenSnapshot(): Promise<void>;
|
|
59
64
|
applyFPCSetupSnapshot(): Promise<void>;
|
|
60
65
|
applyDeploySponsoredFPCSnapshot(): Promise<void>;
|
|
61
|
-
createCrossChainTestHarness(owner:
|
|
62
|
-
|
|
66
|
+
createCrossChainTestHarness(owner: AztecAddress): Promise<CrossChainTestHarness>;
|
|
67
|
+
createAndFundBenchmarkingAccountOnUserWallet(accountType: AccountType): Promise<AztecAddress>;
|
|
63
68
|
applyDeployAmmSnapshot(): Promise<void>;
|
|
64
|
-
getBridgedFeeJuicePaymentMethodForWallet(
|
|
65
|
-
getPrivateFPCPaymentMethodForWallet(wallet: Wallet): Promise<PrivateFeePaymentMethod>;
|
|
66
|
-
getSponsoredFPCPaymentMethodForWallet(_wallet: Wallet): Promise<SponsoredFeePaymentMethod>;
|
|
67
|
-
getFeeJuicePaymentMethodForWallet(wallet: Wallet): Promise<FeeJuicePaymentMethod>;
|
|
69
|
+
getBridgedFeeJuicePaymentMethodForWallet(_wallet: Wallet, sender: AztecAddress): Promise<FeeJuicePaymentMethodWithClaim>;
|
|
70
|
+
getPrivateFPCPaymentMethodForWallet(wallet: Wallet, sender: AztecAddress): Promise<PrivateFeePaymentMethod>;
|
|
71
|
+
getSponsoredFPCPaymentMethodForWallet(_wallet: Wallet, _sender: AztecAddress): Promise<SponsoredFeePaymentMethod>;
|
|
68
72
|
}
|
|
69
73
|
//# 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,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,8BAA8B,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,KAAK,gBAAgB,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChH,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,qBAAqB,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACrD,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B;IA0BtB,wCAAwC,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY;IAK9E,mCAAmC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY;IAQ9E,qCAAqC,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY;CAGpF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
+
import { FeeJuicePaymentMethodWithClaim } from '@aztec/aztec.js/fee';
|
|
3
|
+
import { PrivateFeePaymentMethod, SponsoredFeePaymentMethod } from '@aztec/aztec.js/fee';
|
|
4
|
+
import { createLogger } from '@aztec/aztec.js/log';
|
|
5
5
|
import { RollupContract, createExtendedL1Client, deployL1Contract } from '@aztec/ethereum';
|
|
6
6
|
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
7
7
|
import { randomBytes } from '@aztec/foundation/crypto';
|
|
@@ -16,8 +16,10 @@ import { SponsoredFPCContract } from '@aztec/noir-contracts.js/SponsoredFPC';
|
|
|
16
16
|
import { TokenContract as BananaCoin, TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
17
17
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
18
18
|
import { getCanonicalFeeJuice } from '@aztec/protocol-contracts/fee-juice';
|
|
19
|
-
import {
|
|
19
|
+
import { getPXEConfig } from '@aztec/pxe/server';
|
|
20
|
+
import { GasSettings } from '@aztec/stdlib/gas';
|
|
20
21
|
import { deriveSigningKey } from '@aztec/stdlib/keys';
|
|
22
|
+
import { TestWallet } from '@aztec/test-wallet/server';
|
|
21
23
|
import { MNEMONIC } from '../../fixtures/fixtures.js';
|
|
22
24
|
import { createSnapshotManager, deployAccounts } from '../../fixtures/snapshot_manager.js';
|
|
23
25
|
import { mintTokensToPrivate } from '../../fixtures/token_utils.js';
|
|
@@ -30,14 +32,13 @@ const { E2E_DATA_PATH: dataPath, BENCHMARK_CONFIG } = process.env;
|
|
|
30
32
|
export class ClientFlowsBenchmark {
|
|
31
33
|
snapshotManager;
|
|
32
34
|
logger;
|
|
33
|
-
pxe;
|
|
34
35
|
aztecNode;
|
|
35
36
|
cheatCodes;
|
|
36
37
|
context;
|
|
37
38
|
chainMonitor;
|
|
38
39
|
feeJuiceBridgeTestHarness;
|
|
39
|
-
// The admin that aids in the setup of the test
|
|
40
40
|
adminWallet;
|
|
41
|
+
// The admin that aids in the setup of the test
|
|
41
42
|
adminAddress;
|
|
42
43
|
// Aztec Node config
|
|
43
44
|
sequencerAddress;
|
|
@@ -55,8 +56,8 @@ export class ClientFlowsBenchmark {
|
|
|
55
56
|
liquidityToken;
|
|
56
57
|
// Sponsored FPC contract
|
|
57
58
|
sponsoredFPC;
|
|
58
|
-
// PXE used by the benchmarking user. It can be set up with client-side proving enabled
|
|
59
|
-
|
|
59
|
+
// PXE and Wallet used by the benchmarking user. It can be set up with client-side proving enabled
|
|
60
|
+
userWallet;
|
|
60
61
|
realProofs = [
|
|
61
62
|
'true',
|
|
62
63
|
'1'
|
|
@@ -82,7 +83,7 @@ export class ClientFlowsBenchmark {
|
|
|
82
83
|
},
|
|
83
84
|
// eslint-disable-next-line camelcase
|
|
84
85
|
fee_juice: {
|
|
85
|
-
forWallet:
|
|
86
|
+
forWallet: ()=>Promise.resolve(undefined),
|
|
86
87
|
circuits: 0
|
|
87
88
|
}
|
|
88
89
|
};
|
|
@@ -125,53 +126,46 @@ export class ClientFlowsBenchmark {
|
|
|
125
126
|
const balanceBefore = await this.bananaCoin.methods.balance_of_private(address).simulate({
|
|
126
127
|
from: this.adminAddress
|
|
127
128
|
});
|
|
128
|
-
await mintTokensToPrivate(this.bananaCoin, this.adminAddress,
|
|
129
|
+
await mintTokensToPrivate(this.bananaCoin, this.adminAddress, address, amount);
|
|
129
130
|
const balanceAfter = await this.bananaCoin.methods.balance_of_private(address).simulate({
|
|
130
131
|
from: this.adminAddress
|
|
131
132
|
});
|
|
132
133
|
expect(balanceAfter).toEqual(balanceBefore + amount);
|
|
133
134
|
}
|
|
134
|
-
|
|
135
|
-
const
|
|
135
|
+
createBenchmarkingAccountManager(wallet, type) {
|
|
136
|
+
const benchysSecret = Fr.random();
|
|
136
137
|
const salt = Fr.random();
|
|
137
138
|
let benchysPrivateSigningKey;
|
|
138
|
-
let benchysAccountManager;
|
|
139
139
|
if (type === 'schnorr') {
|
|
140
|
-
benchysPrivateSigningKey = deriveSigningKey(
|
|
141
|
-
|
|
140
|
+
benchysPrivateSigningKey = deriveSigningKey(benchysSecret);
|
|
141
|
+
return wallet.createSchnorrAccount(benchysSecret, salt, benchysPrivateSigningKey);
|
|
142
142
|
} else if (type === 'ecdsar1') {
|
|
143
143
|
benchysPrivateSigningKey = randomBytes(32);
|
|
144
|
-
|
|
144
|
+
return wallet.createECDSARAccount(benchysSecret, salt, benchysPrivateSigningKey);
|
|
145
145
|
} else {
|
|
146
146
|
throw new Error(`Unknown account type: ${type}`);
|
|
147
147
|
}
|
|
148
|
-
await benchysAccountManager.register();
|
|
149
|
-
return benchysAccountManager;
|
|
150
148
|
}
|
|
151
149
|
async applyBaseSnapshots() {
|
|
152
150
|
await this.applyInitialAccountsSnapshot();
|
|
153
151
|
await this.applySetupFeeJuiceSnapshot();
|
|
154
152
|
}
|
|
155
153
|
async applyInitialAccountsSnapshot() {
|
|
156
|
-
await this.snapshotManager.snapshot('initial_accounts', deployAccounts(2, this.logger), async ({ deployedAccounts }, {
|
|
157
|
-
this.
|
|
154
|
+
await this.snapshotManager.snapshot('initial_accounts', deployAccounts(2, this.logger), async ({ deployedAccounts: [{ address: adminAddress }, { address: sequencerAddress }] }, { wallet, aztecNode, cheatCodes })=>{
|
|
155
|
+
this.adminWallet = wallet;
|
|
158
156
|
this.aztecNode = aztecNode;
|
|
159
|
-
this.cheatCodes =
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
this.adminAddress = this.adminWallet.getAddress();
|
|
163
|
-
this.sequencerAddress = deployedWallets[1].getAddress();
|
|
157
|
+
this.cheatCodes = cheatCodes;
|
|
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();
|
|
167
|
-
const userPXEConfig =
|
|
168
|
-
const l1Contracts = await aztecNode.getL1ContractAddresses();
|
|
163
|
+
const userPXEConfig = getPXEConfig();
|
|
169
164
|
const userPXEConfigWithContracts = {
|
|
170
165
|
...userPXEConfig,
|
|
171
|
-
proverEnabled: this.realProofs
|
|
172
|
-
l1Contracts
|
|
166
|
+
proverEnabled: this.realProofs
|
|
173
167
|
};
|
|
174
|
-
this.
|
|
168
|
+
this.userWallet = await TestWallet.create(this.aztecNode, userPXEConfigWithContracts, {
|
|
175
169
|
loggers: {
|
|
176
170
|
prover: this.proxyLogger.createLogger('pxe:bb:wasm:bundle:proxied')
|
|
177
171
|
}
|
|
@@ -185,7 +179,6 @@ export class ClientFlowsBenchmark {
|
|
|
185
179
|
this.feeJuiceBridgeTestHarness = await FeeJuicePortalTestingHarnessFactory.create({
|
|
186
180
|
aztecNode: context.aztecNode,
|
|
187
181
|
aztecNodeAdmin: context.aztecNode,
|
|
188
|
-
pxeService: context.pxe,
|
|
189
182
|
l1Client: context.deployL1ContractsValues.l1Client,
|
|
190
183
|
wallet: this.adminWallet,
|
|
191
184
|
logger: this.logger
|
|
@@ -221,7 +214,7 @@ export class ClientFlowsBenchmark {
|
|
|
221
214
|
async applyFPCSetupSnapshot() {
|
|
222
215
|
await this.snapshotManager.snapshot('fpc_setup', async (context)=>{
|
|
223
216
|
const feeJuiceContract = this.feeJuiceBridgeTestHarness.feeJuice;
|
|
224
|
-
expect((await context.
|
|
217
|
+
expect((await context.wallet.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
|
|
225
218
|
const bananaCoin = this.bananaCoin;
|
|
226
219
|
const bananaFPC = await FPCContract.deploy(this.adminWallet, bananaCoin.address, this.adminAddress).send({
|
|
227
220
|
from: this.adminAddress
|
|
@@ -237,7 +230,7 @@ export class ClientFlowsBenchmark {
|
|
|
237
230
|
}
|
|
238
231
|
async applyDeploySponsoredFPCSnapshot() {
|
|
239
232
|
await this.snapshotManager.snapshot('deploy_sponsored_fpc', async ()=>{
|
|
240
|
-
const sponsoredFPC = await setupSponsoredFPC(this.
|
|
233
|
+
const sponsoredFPC = await setupSponsoredFPC(this.adminWallet);
|
|
241
234
|
this.logger.info(`SponsoredFPC at ${sponsoredFPC.address}`);
|
|
242
235
|
return {
|
|
243
236
|
sponsoredFPCAddress: sponsoredFPC.address
|
|
@@ -254,29 +247,29 @@ export class ClientFlowsBenchmark {
|
|
|
254
247
|
l1Client.account.address
|
|
255
248
|
]).then(({ address })=>address);
|
|
256
249
|
this.logger.verbose(`Setting up cross chain harness...`);
|
|
257
|
-
const crossChainTestHarness = await CrossChainTestHarness.new(this.aztecNode,
|
|
250
|
+
const crossChainTestHarness = await CrossChainTestHarness.new(this.aztecNode, l1Client, this.adminWallet, owner, this.logger, underlyingERC20Address);
|
|
258
251
|
this.logger.verbose(`L2 token deployed to: ${crossChainTestHarness.l2Token.address}`);
|
|
259
252
|
return crossChainTestHarness;
|
|
260
253
|
}
|
|
261
|
-
async
|
|
262
|
-
const benchysAccountManager = await this.createBenchmarkingAccountManager(this.
|
|
263
|
-
const
|
|
264
|
-
const benchysAddress = benchysAccountManager.
|
|
254
|
+
async createAndFundBenchmarkingAccountOnUserWallet(accountType) {
|
|
255
|
+
const benchysAccountManager = await this.createBenchmarkingAccountManager(this.adminWallet, accountType);
|
|
256
|
+
const benchysAccount = await benchysAccountManager.getAccount();
|
|
257
|
+
const benchysAddress = benchysAccountManager.address;
|
|
265
258
|
const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(benchysAddress);
|
|
266
|
-
const
|
|
267
|
-
await
|
|
259
|
+
const behchysDeployMethod = await benchysAccountManager.getDeployMethod();
|
|
260
|
+
await behchysDeployMethod.send({
|
|
261
|
+
from: AztecAddress.ZERO,
|
|
268
262
|
fee: {
|
|
269
|
-
paymentMethod
|
|
263
|
+
paymentMethod: new FeeJuicePaymentMethodWithClaim(benchysAddress, claim)
|
|
270
264
|
}
|
|
271
265
|
}).wait();
|
|
272
|
-
// Register benchy on the user's
|
|
273
|
-
await this.
|
|
274
|
-
|
|
275
|
-
|
|
266
|
+
// Register benchy on the user's Wallet, where we're going to be interacting from
|
|
267
|
+
const accountManager = await this.userWallet.createAccount({
|
|
268
|
+
secret: benchysAccount.getSecretKey(),
|
|
269
|
+
salt: new Fr(benchysAccount.salt),
|
|
270
|
+
contract: benchysAccountManager.getAccountContract()
|
|
276
271
|
});
|
|
277
|
-
|
|
278
|
-
const entrypoint = await benchysAccountManager.getAccount();
|
|
279
|
-
return new AccountWalletWithSecretKey(this.userPXE, entrypoint, benchysWallet.getSecretKey(), benchysAccountManager.salt);
|
|
272
|
+
return accountManager.address;
|
|
280
273
|
}
|
|
281
274
|
async applyDeployAmmSnapshot() {
|
|
282
275
|
await this.snapshotManager.snapshot('deploy_amm', async ()=>{
|
|
@@ -299,17 +292,20 @@ export class ClientFlowsBenchmark {
|
|
|
299
292
|
this.amm = await AMMContract.at(ammAddress, this.adminWallet);
|
|
300
293
|
});
|
|
301
294
|
}
|
|
302
|
-
async getBridgedFeeJuicePaymentMethodForWallet(
|
|
303
|
-
const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(
|
|
304
|
-
return new FeeJuicePaymentMethodWithClaim(
|
|
295
|
+
async getBridgedFeeJuicePaymentMethodForWallet(_wallet, sender) {
|
|
296
|
+
const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(sender);
|
|
297
|
+
return new FeeJuicePaymentMethodWithClaim(sender, claim);
|
|
305
298
|
}
|
|
306
|
-
getPrivateFPCPaymentMethodForWallet(wallet) {
|
|
307
|
-
|
|
299
|
+
async getPrivateFPCPaymentMethodForWallet(wallet, sender) {
|
|
300
|
+
// The private fee paying method assembled on the app side requires knowledge of the maximum
|
|
301
|
+
// fee the user is willing to pay
|
|
302
|
+
const maxFeesPerGas = (await this.aztecNode.getCurrentBaseFees()).mul(1.5);
|
|
303
|
+
const gasSettings = GasSettings.default({
|
|
304
|
+
maxFeesPerGas
|
|
305
|
+
});
|
|
306
|
+
return new PrivateFeePaymentMethod(this.bananaFPC.address, sender, wallet, gasSettings);
|
|
308
307
|
}
|
|
309
|
-
getSponsoredFPCPaymentMethodForWallet(_wallet) {
|
|
308
|
+
getSponsoredFPCPaymentMethodForWallet(_wallet, _sender) {
|
|
310
309
|
return Promise.resolve(new SponsoredFeePaymentMethod(this.sponsoredFPC.address));
|
|
311
310
|
}
|
|
312
|
-
getFeeJuicePaymentMethodForWallet(wallet) {
|
|
313
|
-
return Promise.resolve(new FeeJuicePaymentMethod(wallet.getAddress()));
|
|
314
|
-
}
|
|
315
311
|
}
|
package/dest/bench/utils.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type SentTx, type WaitOpts } from '@aztec/aztec.js/contracts';
|
|
2
2
|
import { BenchmarkingContract } from '@aztec/noir-test-contracts.js/Benchmarking';
|
|
3
|
-
import { type PXEService } from '@aztec/pxe/server';
|
|
4
3
|
import type { MetricsType } from '@aztec/telemetry-client';
|
|
5
4
|
import type { BenchmarkTelemetryClient } from '@aztec/telemetry-client/bench';
|
|
6
5
|
import { type EndToEndContext, type SetupOptions } from '../fixtures/utils.js';
|
|
@@ -39,15 +38,7 @@ export type GithubActionBenchmarkResult = {
|
|
|
39
38
|
* @param heavyPublicCompute - Whether the transactions include heavy public compute (like a big sha256).
|
|
40
39
|
* @returns Array of sent txs.
|
|
41
40
|
*/
|
|
42
|
-
export declare function sendTxs(txCount: number, context: EndToEndContext, contract: BenchmarkingContract, heavyPublicCompute?: boolean):
|
|
41
|
+
export declare function sendTxs(txCount: number, context: EndToEndContext, contract: BenchmarkingContract, heavyPublicCompute?: boolean): SentTx[];
|
|
43
42
|
export declare function waitTxs(txs: SentTx[], context: EndToEndContext, txWaitOpts?: WaitOpts): Promise<void>;
|
|
44
|
-
/**
|
|
45
|
-
* Creates a new PXE
|
|
46
|
-
* @param node - Node to connect the pxe to.
|
|
47
|
-
* @param contract - Benchmark contract to add to the pxe.
|
|
48
|
-
* @param startingBlock - First l2 block to process.
|
|
49
|
-
* @returns The new PXE.
|
|
50
|
-
*/
|
|
51
|
-
export declare function createNewPXE(node: AztecNode, contract: BenchmarkingContract): Promise<PXEService>;
|
|
52
43
|
export {};
|
|
53
44
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/bench/utils.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/bench/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,KAAK,MAAM,EAAE,KAAK,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAElF,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAClF,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;;;;;GAyBF;AAED,KAAK,YAAY,GAAG;IAClB,MAAM,EAAE,WAAW,CAAC;IACpB,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAGF,MAAM,MAAM,2BAA2B,GAAG;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AA6DF;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CACrB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,oBAAoB,EAC9B,kBAAkB,GAAE,OAAe,GAClC,MAAM,EAAE,CAMV;AAED,wBAAsB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,CAAC,EAAE,QAAQ,iBAI3F"}
|
package/dest/bench/utils.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { BatchCall } from '@aztec/aztec.js';
|
|
1
|
+
import { BatchCall } from '@aztec/aztec.js/contracts';
|
|
2
2
|
import { mean, stdDev, times } from '@aztec/foundation/collection';
|
|
3
3
|
import { BenchmarkingContract } from '@aztec/noir-test-contracts.js/Benchmarking';
|
|
4
|
-
import { createPXEService } from '@aztec/pxe/server';
|
|
5
4
|
import { mkdirSync, writeFileSync } from 'fs';
|
|
6
5
|
import path from 'path';
|
|
7
6
|
import { setup } from '../fixtures/utils.js';
|
|
@@ -14,8 +13,9 @@ import { setup } from '../fixtures/utils.js';
|
|
|
14
13
|
benchmark: true
|
|
15
14
|
}
|
|
16
15
|
});
|
|
16
|
+
const defaultAccountAddress = context.accounts[0];
|
|
17
17
|
const contract = await BenchmarkingContract.deploy(context.wallet).send({
|
|
18
|
-
from:
|
|
18
|
+
from: defaultAccountAddress
|
|
19
19
|
}).deployed();
|
|
20
20
|
context.logger.info(`Deployed benchmarking contract at ${contract.address}`);
|
|
21
21
|
const sequencer = context.aztecNode.getSequencer();
|
|
@@ -92,10 +92,10 @@ function getMetricValues(points) {
|
|
|
92
92
|
* @param heavyPublicCompute - Whether the transactions include heavy public compute (like a big sha256).
|
|
93
93
|
* @returns A BatchCall instance.
|
|
94
94
|
*/ function makeCall(index, context, contract, heavyPublicCompute) {
|
|
95
|
-
const owner = context.
|
|
95
|
+
const [owner] = context.accounts;
|
|
96
96
|
if (heavyPublicCompute) {
|
|
97
97
|
return new BatchCall(context.wallet, [
|
|
98
|
-
contract.methods.
|
|
98
|
+
contract.methods.sha256_hash_1024(randomBytesAsBigInts(1024))
|
|
99
99
|
]);
|
|
100
100
|
} else {
|
|
101
101
|
return new BatchCall(context.wallet, [
|
|
@@ -112,44 +112,20 @@ function getMetricValues(points) {
|
|
|
112
112
|
* @param contract - Target contract.
|
|
113
113
|
* @param heavyPublicCompute - Whether the transactions include heavy public compute (like a big sha256).
|
|
114
114
|
* @returns Array of sent txs.
|
|
115
|
-
*/ export
|
|
115
|
+
*/ export function sendTxs(txCount, context, contract, heavyPublicCompute = false) {
|
|
116
116
|
const calls = times(txCount, (index)=>makeCall(index, context, contract, heavyPublicCompute));
|
|
117
117
|
context.logger.info(`Creating ${txCount} txs`);
|
|
118
|
-
const
|
|
119
|
-
from: context.wallet.getAddress()
|
|
120
|
-
})));
|
|
118
|
+
const [from] = context.accounts;
|
|
121
119
|
context.logger.info(`Sending ${txCount} txs`);
|
|
122
|
-
return
|
|
120
|
+
return calls.map((call)=>call.send({
|
|
121
|
+
from
|
|
122
|
+
}));
|
|
123
123
|
}
|
|
124
124
|
export async function waitTxs(txs, context, txWaitOpts) {
|
|
125
125
|
context.logger.info(`Awaiting ${txs.length} txs to be mined`);
|
|
126
126
|
await Promise.all(txs.map((tx)=>tx.wait(txWaitOpts)));
|
|
127
127
|
context.logger.info(`All ${txs.length} txs have been mined`);
|
|
128
128
|
}
|
|
129
|
-
/**
|
|
130
|
-
* Creates a new PXE
|
|
131
|
-
* @param node - Node to connect the pxe to.
|
|
132
|
-
* @param contract - Benchmark contract to add to the pxe.
|
|
133
|
-
* @param startingBlock - First l2 block to process.
|
|
134
|
-
* @returns The new PXE.
|
|
135
|
-
*/ export async function createNewPXE(node, contract) {
|
|
136
|
-
const l1Contracts = await node.getL1ContractAddresses();
|
|
137
|
-
const { l1ChainId, rollupVersion } = await node.getNodeInfo();
|
|
138
|
-
const pxeConfig = {
|
|
139
|
-
l2BlockBatchSize: 50,
|
|
140
|
-
l2BlockPollingIntervalMS: 100,
|
|
141
|
-
dataDirectory: undefined,
|
|
142
|
-
dataStoreMapSizeKB: 1024 * 1024,
|
|
143
|
-
l1Contracts,
|
|
144
|
-
l1ChainId,
|
|
145
|
-
rollupVersion
|
|
146
|
-
};
|
|
147
|
-
// docs:start:PXEcreate
|
|
148
|
-
const pxe = await createPXEService(node, pxeConfig);
|
|
149
|
-
// docs:end:PXEcreate
|
|
150
|
-
await pxe.registerContract(contract);
|
|
151
|
-
return pxe;
|
|
152
|
-
}
|
|
153
129
|
function randomBytesAsBigInts(length) {
|
|
154
130
|
return [
|
|
155
131
|
...Array(length)
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
+
import { Fr } from '@aztec/aztec.js/fields';
|
|
3
|
+
import { type Logger } from '@aztec/aztec.js/log';
|
|
4
|
+
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
5
|
+
import type { TxHash } from '@aztec/aztec.js/tx';
|
|
2
6
|
import type { CheatCodes } from '@aztec/aztec/testing';
|
|
3
7
|
import { TokenBlacklistContract } from '@aztec/noir-contracts.js/TokenBlacklist';
|
|
4
8
|
import { InvalidAccountContract } from '@aztec/noir-test-contracts.js/InvalidAccount';
|
|
5
9
|
import type { SequencerClient } from '@aztec/sequencer-client';
|
|
10
|
+
import type { TestWallet } from '@aztec/test-wallet/server';
|
|
6
11
|
import { type SubsystemsContext } from '../fixtures/snapshot_manager.js';
|
|
7
12
|
import { TokenSimulator } from '../simulators/token_simulator.js';
|
|
8
13
|
export declare class Role {
|
|
@@ -22,20 +27,15 @@ export declare class BlacklistTokenContractTest {
|
|
|
22
27
|
static CHANGE_ROLES_DELAY: number;
|
|
23
28
|
private snapshotManager;
|
|
24
29
|
logger: Logger;
|
|
25
|
-
|
|
26
|
-
pxe: PXE;
|
|
27
|
-
accounts: CompleteAddress[];
|
|
30
|
+
wallet: TestWallet;
|
|
28
31
|
asset: TokenBlacklistContract;
|
|
29
32
|
tokenSim: TokenSimulator;
|
|
30
33
|
badAccount: InvalidAccountContract;
|
|
31
34
|
cheatCodes: CheatCodes;
|
|
32
35
|
sequencer: SequencerClient;
|
|
33
36
|
aztecNode: AztecNode;
|
|
34
|
-
admin: AccountWallet;
|
|
35
37
|
adminAddress: AztecAddress;
|
|
36
|
-
other: AccountWallet;
|
|
37
38
|
otherAddress: AztecAddress;
|
|
38
|
-
blacklisted: AccountWallet;
|
|
39
39
|
blacklistedAddress: AztecAddress;
|
|
40
40
|
constructor(testName: string);
|
|
41
41
|
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,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,OAAO,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AAC5C,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,qBAAqB,CAAC;AAChE,OAAO,KAAK,EAA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