@aztec/end-to-end 0.0.0-test.1 → 0.0.1-commit.24de95ac
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 +61 -0
- package/dest/bench/client_flows/benchmark.d.ts.map +1 -0
- package/dest/bench/client_flows/benchmark.js +261 -0
- package/dest/bench/client_flows/client_flows_benchmark.d.ts +73 -0
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -0
- package/dest/bench/client_flows/client_flows_benchmark.js +311 -0
- package/dest/bench/client_flows/config.d.ts +14 -0
- package/dest/bench/client_flows/config.d.ts.map +1 -0
- package/dest/bench/client_flows/config.js +106 -0
- package/dest/bench/client_flows/data_extractor.d.ts +2 -0
- package/dest/bench/client_flows/data_extractor.d.ts.map +1 -0
- package/dest/bench/client_flows/data_extractor.js +99 -0
- package/dest/bench/utils.d.ts +10 -36
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +26 -66
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +20 -12
- 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 +85 -57
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +18 -24
- 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 +48 -69
- package/dest/e2e_deploy_contract/deploy_test.d.ts +14 -6
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
- package/dest/e2e_deploy_contract/deploy_test.js +13 -19
- package/dest/e2e_epochs/epochs_test.d.ts +58 -17
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +224 -43
- package/dest/e2e_fees/bridging_race.notest.d.ts +2 -0
- package/dest/e2e_fees/bridging_race.notest.d.ts.map +1 -0
- package/dest/e2e_fees/bridging_race.notest.js +63 -0
- package/dest/e2e_fees/fees_test.d.ts +20 -9
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +98 -107
- package/dest/e2e_l1_publisher/write_json.d.ts +10 -0
- package/dest/e2e_l1_publisher/write_json.d.ts.map +1 -0
- package/dest/e2e_l1_publisher/write_json.js +57 -0
- package/dest/e2e_multi_validator/utils.d.ts +12 -0
- package/dest/e2e_multi_validator/utils.d.ts.map +1 -0
- package/dest/e2e_multi_validator/utils.js +214 -0
- package/dest/e2e_nested_contract/nested_contract_test.d.ts +9 -6
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +22 -19
- package/dest/e2e_p2p/inactivity_slash_test.d.ts +31 -0
- package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -0
- package/dest/e2e_p2p/inactivity_slash_test.js +135 -0
- package/dest/e2e_p2p/p2p_network.d.ts +69 -22
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +180 -129
- package/dest/e2e_p2p/shared.d.ts +41 -5
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +163 -19
- package/dest/e2e_token_contract/token_contract_test.d.ts +11 -5
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/e2e_token_contract/token_contract_test.js +50 -26
- package/dest/{e2e_prover → fixtures}/e2e_prover_test.d.ts +14 -9
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -0
- package/dest/{e2e_prover → fixtures}/e2e_prover_test.js +95 -100
- package/dest/fixtures/fixtures.d.ts +5 -6
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/fixtures.js +4 -3
- 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_acvm_config.js +2 -14
- 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 +10 -17
- package/dest/fixtures/l1_to_l2_messaging.d.ts +8 -5
- package/dest/fixtures/l1_to_l2_messaging.d.ts.map +1 -1
- package/dest/fixtures/l1_to_l2_messaging.js +44 -18
- package/dest/fixtures/setup_l1_contracts.d.ts +3 -3
- package/dest/fixtures/setup_l1_contracts.d.ts.map +1 -1
- package/dest/fixtures/setup_l1_contracts.js +4 -4
- package/dest/fixtures/setup_p2p_test.d.ts +14 -13
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +73 -21
- package/dest/fixtures/snapshot_manager.d.ts +15 -7
- package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.js +147 -121
- package/dest/fixtures/token_utils.d.ts +6 -3
- package/dest/fixtures/token_utils.d.ts.map +1 -1
- package/dest/fixtures/token_utils.js +23 -10
- package/dest/fixtures/utils.d.ts +76 -37
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +464 -368
- package/dest/fixtures/web3signer.d.ts +5 -0
- package/dest/fixtures/web3signer.d.ts.map +1 -0
- package/dest/fixtures/web3signer.js +53 -0
- 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 +41 -25
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +104 -50
- package/dest/shared/gas_portal_test_harness.d.ts +32 -24
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.js +50 -29
- 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 +13 -11
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +138 -108
- package/dest/simulators/lending_simulator.d.ts +6 -6
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.js +13 -16
- package/dest/simulators/token_simulator.d.ts +5 -2
- package/dest/simulators/token_simulator.d.ts.map +1 -1
- package/dest/simulators/token_simulator.js +16 -13
- package/dest/spartan/setup_test_wallets.d.ts +23 -10
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +167 -58
- package/dest/spartan/utils.d.ts +106 -303
- package/dest/spartan/utils.d.ts.map +1 -1
- package/dest/spartan/utils.js +434 -130
- package/package.json +61 -56
- package/src/bench/client_flows/benchmark.ts +341 -0
- package/src/bench/client_flows/client_flows_benchmark.ts +402 -0
- package/src/bench/client_flows/config.ts +61 -0
- package/src/bench/client_flows/data_extractor.ts +111 -0
- package/src/bench/utils.ts +22 -76
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +80 -77
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +63 -105
- package/src/e2e_deploy_contract/deploy_test.ts +23 -38
- package/src/e2e_epochs/epochs_test.ts +274 -54
- package/src/e2e_fees/bridging_race.notest.ts +80 -0
- package/src/e2e_fees/fees_test.ts +137 -136
- package/src/e2e_l1_publisher/write_json.ts +76 -0
- package/src/e2e_multi_validator/utils.ts +258 -0
- package/src/e2e_nested_contract/nested_contract_test.ts +27 -18
- package/src/e2e_p2p/inactivity_slash_test.ts +178 -0
- package/src/e2e_p2p/p2p_network.ts +272 -166
- package/src/e2e_p2p/shared.ts +244 -29
- package/src/e2e_token_contract/token_contract_test.ts +43 -39
- package/src/fixtures/dumps/epoch_proof_result.json +1 -1
- package/src/{e2e_prover → fixtures}/e2e_prover_test.ts +101 -145
- package/src/fixtures/fixtures.ts +4 -3
- package/src/fixtures/get_acvm_config.ts +3 -11
- package/src/fixtures/get_bb_config.ts +18 -13
- package/src/fixtures/l1_to_l2_messaging.ts +53 -23
- package/src/fixtures/setup_l1_contracts.ts +6 -7
- package/src/fixtures/setup_p2p_test.ts +112 -38
- package/src/fixtures/snapshot_manager.ts +187 -139
- package/src/fixtures/token_utils.ts +29 -12
- package/src/fixtures/utils.ts +552 -425
- package/src/fixtures/web3signer.ts +63 -0
- package/src/guides/up_quick_start.sh +6 -14
- package/src/quality_of_service/alert_checker.ts +1 -1
- package/src/shared/cross_chain_test_harness.ts +108 -79
- package/src/shared/gas_portal_test_harness.ts +58 -49
- package/src/shared/jest_setup.ts +1 -1
- package/src/shared/submit-transactions.ts +12 -8
- package/src/shared/uniswap_l1_l2.ts +173 -176
- package/src/simulators/lending_simulator.ts +12 -15
- package/src/simulators/token_simulator.ts +21 -13
- package/src/spartan/DEVELOP.md +121 -0
- package/src/spartan/setup_test_wallets.ts +215 -93
- package/src/spartan/utils.ts +490 -130
- package/dest/e2e_prover/e2e_prover_test.d.ts.map +0 -1
- package/dest/sample-dapp/connect.js +0 -12
- package/dest/sample-dapp/contracts.js +0 -10
- package/dest/sample-dapp/deploy.js +0 -35
- package/dest/sample-dapp/index.js +0 -98
- package/src/sample-dapp/connect.mjs +0 -16
- package/src/sample-dapp/contracts.mjs +0 -14
- package/src/sample-dapp/deploy.mjs +0 -40
- package/src/sample-dapp/index.mjs +0 -128
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import { EthAddress
|
|
1
|
+
import { EthAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
+
import { L1FeeJuicePortalManager } from '@aztec/aztec.js/ethereum';
|
|
3
|
+
import { Fr } from '@aztec/aztec.js/fields';
|
|
4
|
+
import { retryUntil } from '@aztec/foundation/retry';
|
|
2
5
|
import { FeeJuiceContract } from '@aztec/noir-contracts.js/FeeJuice';
|
|
3
6
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
4
7
|
export class FeeJuicePortalTestingHarnessFactory {
|
|
@@ -7,16 +10,16 @@ export class FeeJuicePortalTestingHarnessFactory {
|
|
|
7
10
|
this.config = config;
|
|
8
11
|
}
|
|
9
12
|
async createReal() {
|
|
10
|
-
const { aztecNode,
|
|
11
|
-
const ethAccount = EthAddress.fromString((await
|
|
12
|
-
const l1ContractAddresses = (await
|
|
13
|
+
const { aztecNode, aztecNodeAdmin, l1Client, wallet, logger } = this.config;
|
|
14
|
+
const ethAccount = EthAddress.fromString((await l1Client.getAddresses())[0]);
|
|
15
|
+
const l1ContractAddresses = (await aztecNode.getNodeInfo()).l1ContractAddresses;
|
|
13
16
|
const feeJuiceAddress = l1ContractAddresses.feeJuiceAddress;
|
|
14
17
|
const feeJuicePortalAddress = l1ContractAddresses.feeJuicePortalAddress;
|
|
15
18
|
if (feeJuiceAddress.isZero() || feeJuicePortalAddress.isZero()) {
|
|
16
19
|
throw new Error('Fee Juice portal not deployed on L1');
|
|
17
20
|
}
|
|
18
21
|
const gasL2 = await FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, wallet);
|
|
19
|
-
return new GasBridgingTestHarness(aztecNode,
|
|
22
|
+
return new GasBridgingTestHarness(aztecNode, aztecNodeAdmin, wallet, logger, gasL2, ethAccount, feeJuicePortalAddress, feeJuiceAddress, l1ContractAddresses.feeAssetHandlerAddress, l1Client);
|
|
20
23
|
}
|
|
21
24
|
static create(config) {
|
|
22
25
|
const factory = new FeeJuicePortalTestingHarnessFactory(config);
|
|
@@ -28,54 +31,62 @@ export class FeeJuicePortalTestingHarnessFactory {
|
|
|
28
31
|
* shared between cross chain tests.
|
|
29
32
|
*/ export class GasBridgingTestHarness {
|
|
30
33
|
aztecNode;
|
|
31
|
-
|
|
34
|
+
aztecNodeAdmin;
|
|
35
|
+
wallet;
|
|
32
36
|
logger;
|
|
33
37
|
feeJuice;
|
|
34
38
|
ethAccount;
|
|
35
39
|
feeJuicePortalAddress;
|
|
36
40
|
l1FeeJuiceAddress;
|
|
37
|
-
|
|
38
|
-
|
|
41
|
+
feeAssetHandlerAddress;
|
|
42
|
+
l1Client;
|
|
39
43
|
l1TokenManager;
|
|
40
44
|
feeJuicePortalManager;
|
|
41
|
-
constructor(/** Aztec node */ aztecNode, /**
|
|
45
|
+
constructor(/** Aztec node */ aztecNode, /** Aztec node admin interface */ aztecNodeAdmin, /** Wallet. */ wallet, /** Logger. */ logger, /** L2 Token/Bridge contract. */ feeJuice, /** Eth account to interact with. */ ethAccount, /** Portal address. */ feeJuicePortalAddress, /** Underlying token for portal tests. */ l1FeeJuiceAddress, /** Fee asset handler address. */ feeAssetHandlerAddress, /** Viem Extended client instance. */ l1Client){
|
|
42
46
|
this.aztecNode = aztecNode;
|
|
43
|
-
this.
|
|
47
|
+
this.aztecNodeAdmin = aztecNodeAdmin;
|
|
48
|
+
this.wallet = wallet;
|
|
44
49
|
this.logger = logger;
|
|
45
50
|
this.feeJuice = feeJuice;
|
|
46
51
|
this.ethAccount = ethAccount;
|
|
47
52
|
this.feeJuicePortalAddress = feeJuicePortalAddress;
|
|
48
53
|
this.l1FeeJuiceAddress = l1FeeJuiceAddress;
|
|
49
|
-
this.
|
|
50
|
-
this.
|
|
51
|
-
this.feeJuicePortalManager = new L1FeeJuicePortalManager(this.feeJuicePortalAddress, this.l1FeeJuiceAddress, this.
|
|
54
|
+
this.feeAssetHandlerAddress = feeAssetHandlerAddress;
|
|
55
|
+
this.l1Client = l1Client;
|
|
56
|
+
this.feeJuicePortalManager = new L1FeeJuicePortalManager(this.feeJuicePortalAddress, this.l1FeeJuiceAddress, this.feeAssetHandlerAddress, this.l1Client, this.logger);
|
|
52
57
|
this.l1TokenManager = this.feeJuicePortalManager.getTokenManager();
|
|
53
58
|
}
|
|
54
|
-
async mintTokensOnL1(
|
|
55
|
-
const balanceBefore = await this.l1TokenManager.getL1TokenBalance(to.toString());
|
|
56
|
-
await this.l1TokenManager.mint(
|
|
57
|
-
|
|
59
|
+
async mintTokensOnL1(to = this.ethAccount) {
|
|
60
|
+
// const balanceBefore = await this.l1TokenManager.getL1TokenBalance(to.toString());
|
|
61
|
+
await this.l1TokenManager.mint(to.toString());
|
|
62
|
+
// expect(await this.l1TokenManager.getL1TokenBalance(to.toString())).toEqual(balanceBefore + amount);
|
|
58
63
|
}
|
|
59
64
|
async getL1FeeJuiceBalance(address) {
|
|
60
65
|
return await this.l1TokenManager.getL1TokenBalance(address.toString());
|
|
61
66
|
}
|
|
62
|
-
sendTokensToPortalPublic(bridgeAmount, l2Address
|
|
63
|
-
return this.feeJuicePortalManager.bridgeTokensPublic(l2Address, bridgeAmount,
|
|
67
|
+
sendTokensToPortalPublic(bridgeAmount, l2Address) {
|
|
68
|
+
return this.feeJuicePortalManager.bridgeTokensPublic(l2Address, bridgeAmount, false);
|
|
64
69
|
}
|
|
65
|
-
async consumeMessageOnAztecAndClaimPrivately(owner, claim) {
|
|
70
|
+
async consumeMessageOnAztecAndClaimPrivately(owner, claimer, claim) {
|
|
66
71
|
this.logger.info('Consuming messages on L2 Privately');
|
|
67
72
|
const { claimAmount, claimSecret, messageLeafIndex } = claim;
|
|
68
|
-
await this.feeJuice.methods.claim(owner, claimAmount, claimSecret, messageLeafIndex).send(
|
|
73
|
+
await this.feeJuice.methods.claim(owner, claimAmount, claimSecret, messageLeafIndex).send({
|
|
74
|
+
from: claimer
|
|
75
|
+
}).wait();
|
|
69
76
|
}
|
|
70
77
|
async getL2PublicBalanceOf(owner) {
|
|
71
|
-
return await this.feeJuice.methods.balance_of_public(owner).simulate(
|
|
78
|
+
return await this.feeJuice.methods.balance_of_public(owner).simulate({
|
|
79
|
+
from: owner
|
|
80
|
+
});
|
|
72
81
|
}
|
|
73
82
|
async expectPublicBalanceOnL2(owner, expectedBalance) {
|
|
74
83
|
const balance = await this.getL2PublicBalanceOf(owner);
|
|
75
84
|
expect(balance).toBe(expectedBalance);
|
|
76
85
|
}
|
|
77
|
-
async prepareTokensOnL1(
|
|
78
|
-
const
|
|
86
|
+
async prepareTokensOnL1(owner) {
|
|
87
|
+
const bridgeAmount = await this.l1TokenManager.getMintAmount();
|
|
88
|
+
await this.mintTokensOnL1();
|
|
89
|
+
const claim = await this.sendTokensToPortalPublic(bridgeAmount, owner);
|
|
79
90
|
const isSynced = async ()=>await this.aztecNode.isL1ToL2MessageSynced(Fr.fromHexString(claim.messageHash));
|
|
80
91
|
await retryUntil(isSynced, `message ${claim.messageHash} sync`, 24, 1);
|
|
81
92
|
// Progress by 2 L2 blocks so that the l1ToL2Message added above will be available to use on L2.
|
|
@@ -83,16 +94,26 @@ export class FeeJuicePortalTestingHarnessFactory {
|
|
|
83
94
|
await this.advanceL2Block();
|
|
84
95
|
return claim;
|
|
85
96
|
}
|
|
86
|
-
async bridgeFromL1ToL2(
|
|
97
|
+
async bridgeFromL1ToL2(owner, claimer) {
|
|
87
98
|
// Prepare the tokens on the L1 side
|
|
88
|
-
const claim = await this.prepareTokensOnL1(
|
|
99
|
+
const claim = await this.prepareTokensOnL1(owner);
|
|
89
100
|
// Consume L1 -> L2 message and claim tokens privately on L2
|
|
90
|
-
await this.consumeMessageOnAztecAndClaimPrivately(owner, claim);
|
|
91
|
-
await this.expectPublicBalanceOnL2(owner, bridgeAmount);
|
|
101
|
+
await this.consumeMessageOnAztecAndClaimPrivately(owner, claimer, claim);
|
|
92
102
|
}
|
|
93
103
|
async advanceL2Block() {
|
|
94
104
|
const initialBlockNumber = await this.aztecNode.getBlockNumber();
|
|
95
|
-
|
|
105
|
+
let minTxsPerBlock = undefined;
|
|
106
|
+
if (this.aztecNodeAdmin) {
|
|
107
|
+
({ minTxsPerBlock } = await this.aztecNodeAdmin.getConfig());
|
|
108
|
+
await this.aztecNodeAdmin.setConfig({
|
|
109
|
+
minTxsPerBlock: 0
|
|
110
|
+
}); // Set to 0 to ensure we can advance the block
|
|
111
|
+
}
|
|
96
112
|
await retryUntil(async ()=>await this.aztecNode.getBlockNumber() >= initialBlockNumber + 1);
|
|
113
|
+
if (this.aztecNodeAdmin && minTxsPerBlock !== undefined) {
|
|
114
|
+
await this.aztecNodeAdmin.setConfig({
|
|
115
|
+
minTxsPerBlock
|
|
116
|
+
});
|
|
117
|
+
}
|
|
97
118
|
}
|
|
98
119
|
} // docs:end:cross_chain_test_harness
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type {
|
|
3
|
-
|
|
1
|
+
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
+
import type { SentTx } from '@aztec/aztec.js/contracts';
|
|
3
|
+
import type { Logger } from '@aztec/aztec.js/log';
|
|
4
|
+
import type { TestWallet } from '@aztec/test-wallet/server';
|
|
5
|
+
export declare const submitTxsTo: (wallet: TestWallet, submitter: AztecAddress, numTxs: number, logger: Logger) => Promise<SentTx[]>;
|
|
4
6
|
//# sourceMappingURL=submit-transactions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"submit-transactions.d.ts","sourceRoot":"","sources":["../../src/shared/submit-transactions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"submit-transactions.d.ts","sourceRoot":"","sources":["../../src/shared/submit-transactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAExD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAGlD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAG5D,eAAO,MAAM,WAAW,GACtB,QAAQ,UAAU,EAClB,WAAW,YAAY,EACvB,QAAQ,MAAM,EACd,QAAQ,MAAM,KACb,OAAO,CAAC,MAAM,EAAE,CAsBlB,CAAC"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Fr, GrumpkinScalar } from '@aztec/aztec.js/fields';
|
|
2
|
+
import { TxStatus } from '@aztec/aztec.js/tx';
|
|
3
3
|
import { times } from '@aztec/foundation/collection';
|
|
4
|
-
// submits a set of transactions to the provided
|
|
5
|
-
export const submitTxsTo = async (
|
|
4
|
+
// submits a set of transactions to the provided Wallet
|
|
5
|
+
export const submitTxsTo = async (wallet, submitter, numTxs, logger)=>{
|
|
6
6
|
const txs = [];
|
|
7
7
|
await Promise.all(times(numTxs, async ()=>{
|
|
8
|
-
const accountManager = await
|
|
9
|
-
const
|
|
10
|
-
|
|
8
|
+
const accountManager = await wallet.createSchnorrAccount(Fr.random(), Fr.random(), GrumpkinScalar.random());
|
|
9
|
+
const deployMethod = await accountManager.getDeployMethod();
|
|
10
|
+
const tx = deployMethod.send({
|
|
11
|
+
from: submitter
|
|
11
12
|
});
|
|
12
13
|
const txHash = await tx.getTxHash();
|
|
13
14
|
logger.info(`Tx sent with hash ${txHash}`);
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
+
import type { Logger } from '@aztec/aztec.js/log';
|
|
3
|
+
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
4
|
+
import { CheatCodes } from '@aztec/aztec/testing';
|
|
5
|
+
import { type DeployL1ContractsReturnType, type ExtendedViemWalletClient } from '@aztec/ethereum';
|
|
6
|
+
import type { TestWallet } from '@aztec/test-wallet/server';
|
|
3
7
|
/** Objects to be returned by the uniswap setup function */
|
|
4
8
|
export type UniswapSetupContext = {
|
|
5
9
|
/** Aztec Node instance */
|
|
6
10
|
aztecNode: AztecNode;
|
|
7
|
-
/** The Private eXecution Environment (PXE). */
|
|
8
|
-
pxe: PXE;
|
|
9
11
|
/** Logger instance named as the current test. */
|
|
10
12
|
logger: Logger;
|
|
11
|
-
/**
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
|
|
15
|
-
/** The owner
|
|
16
|
-
|
|
13
|
+
/** The L1 wallet client, extended with public actions. */
|
|
14
|
+
l1Client: ExtendedViemWalletClient;
|
|
15
|
+
/** The wallet. */
|
|
16
|
+
wallet: TestWallet;
|
|
17
|
+
/** The owner address. */
|
|
18
|
+
ownerAddress: AztecAddress;
|
|
17
19
|
/** The sponsor wallet. */
|
|
18
|
-
|
|
20
|
+
sponsorAddress: AztecAddress;
|
|
19
21
|
/** */
|
|
20
22
|
deployL1ContractsValues: DeployL1ContractsReturnType;
|
|
21
23
|
/** Cheat codes instance. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uniswap_l1_l2.d.ts","sourceRoot":"","sources":["../../src/shared/uniswap_l1_l2.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"uniswap_l1_l2.d.ts","sourceRoot":"","sources":["../../src/shared/uniswap_l1_l2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAc,MAAM,2BAA2B,CAAC;AAIrE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EACL,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAI9B,MAAM,iBAAiB,CAAC;AAMzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAiB5D,2DAA2D;AAC3D,MAAM,MAAM,mBAAmB,GAAG;IAChC,0BAA0B;IAC1B,SAAS,EAAE,SAAS,CAAC;IACrB,iDAAiD;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,0DAA0D;IAC1D,QAAQ,EAAE,wBAAwB,CAAC;IACnC,kBAAkB;IAClB,MAAM,EAAE,UAAU,CAAC;IACnB,yBAAyB;IACzB,YAAY,EAAE,YAAY,CAAC;IAC3B,0BAA0B;IAC1B,cAAc,EAAE,YAAY,CAAC;IAC7B,OAAO;IACP,uBAAuB,EAAE,2BAA2B,CAAC;IACrD,4BAA4B;IAC5B,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAC/B,OAAO,MAAM,OAAO,CAAC,mBAAmB,CAAC,EACzC,SAAS,MAAM,OAAO,CAAC,IAAI,CAAC,EAC5B,gCAAkC,SAg+BnC,CAAC"}
|