@aztec/end-to-end 0.85.0-nightly.20250423 → 0.85.0-nightly.20250424
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +6 -7
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +2 -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 +11 -11
- package/dest/e2e_epochs/epochs_test.d.ts +2 -2
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +1 -1
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +7 -11
- package/dest/e2e_p2p/p2p_network.d.ts +62 -62
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +12 -12
- package/dest/e2e_prover/e2e_prover_test.d.ts.map +1 -1
- package/dest/e2e_prover/e2e_prover_test.js +5 -5
- package/dest/fixtures/l1_to_l2_messaging.d.ts +2 -3
- package/dest/fixtures/l1_to_l2_messaging.d.ts.map +1 -1
- package/dest/fixtures/l1_to_l2_messaging.js +3 -3
- package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.js +8 -9
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +12 -13
- package/dest/shared/cross_chain_test_harness.d.ts +7 -11
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +14 -16
- package/dest/shared/gas_portal_test_harness.d.ts +6 -11
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.js +8 -10
- package/dest/shared/uniswap_l1_l2.d.ts +3 -5
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +18 -19
- package/dest/spartan/setup_test_wallets.js +3 -3
- package/package.json +33 -33
- package/src/bench/client_flows/client_flows_benchmark.ts +6 -8
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +14 -18
- package/src/e2e_epochs/epochs_test.ts +4 -3
- package/src/e2e_fees/fees_test.ts +7 -11
- package/src/e2e_p2p/p2p_network.ts +13 -23
- package/src/e2e_prover/e2e_prover_test.ts +5 -10
- package/src/fixtures/l1_to_l2_messaging.ts +5 -14
- package/src/fixtures/snapshot_manager.ts +8 -9
- package/src/fixtures/utils.ts +13 -15
- package/src/shared/cross_chain_test_harness.ts +14 -31
- package/src/shared/gas_portal_test_harness.ts +9 -14
- package/src/shared/uniswap_l1_l2.ts +25 -43
- package/src/spartan/setup_test_wallets.ts +3 -3
|
@@ -18,12 +18,7 @@ import {
|
|
|
18
18
|
type Wallet,
|
|
19
19
|
retryUntil,
|
|
20
20
|
} from '@aztec/aztec.js';
|
|
21
|
-
import {
|
|
22
|
-
type L1ContractAddresses,
|
|
23
|
-
type ViemPublicClient,
|
|
24
|
-
type ViemWalletClient,
|
|
25
|
-
deployL1Contract,
|
|
26
|
-
} from '@aztec/ethereum';
|
|
21
|
+
import { type ExtendedViemWalletClient, type L1ContractAddresses, deployL1Contract } from '@aztec/ethereum';
|
|
27
22
|
import { TestERC20Abi, TokenPortalAbi, TokenPortalBytecode } from '@aztec/l1-artifacts';
|
|
28
23
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
29
24
|
import { TokenBridgeContract } from '@aztec/noir-contracts.js/TokenBridge';
|
|
@@ -45,8 +40,7 @@ import { mintTokensToPrivate } from '../fixtures/token_utils.js';
|
|
|
45
40
|
*/
|
|
46
41
|
export async function deployAndInitializeTokenAndBridgeContracts(
|
|
47
42
|
wallet: Wallet,
|
|
48
|
-
|
|
49
|
-
publicClient: ViemPublicClient,
|
|
43
|
+
l1Client: ExtendedViemWalletClient,
|
|
50
44
|
rollupRegistryAddress: EthAddress,
|
|
51
45
|
owner: AztecAddress,
|
|
52
46
|
underlyingERC20Address: EthAddress,
|
|
@@ -73,16 +67,11 @@ export async function deployAndInitializeTokenAndBridgeContracts(
|
|
|
73
67
|
underlyingERC20: any;
|
|
74
68
|
}> {
|
|
75
69
|
// deploy the token portal
|
|
76
|
-
const { address: tokenPortalAddress } = await deployL1Contract(
|
|
77
|
-
walletClient,
|
|
78
|
-
publicClient,
|
|
79
|
-
TokenPortalAbi,
|
|
80
|
-
TokenPortalBytecode,
|
|
81
|
-
);
|
|
70
|
+
const { address: tokenPortalAddress } = await deployL1Contract(l1Client, TokenPortalAbi, TokenPortalBytecode);
|
|
82
71
|
const tokenPortal = getContract({
|
|
83
72
|
address: tokenPortalAddress.toString(),
|
|
84
73
|
abi: TokenPortalAbi,
|
|
85
|
-
client:
|
|
74
|
+
client: l1Client,
|
|
86
75
|
});
|
|
87
76
|
|
|
88
77
|
// deploy l2 token
|
|
@@ -114,7 +103,7 @@ export async function deployAndInitializeTokenAndBridgeContracts(
|
|
|
114
103
|
const underlyingERC20 = getContract({
|
|
115
104
|
address: underlyingERC20Address.toString(),
|
|
116
105
|
abi: TestERC20Abi,
|
|
117
|
-
client:
|
|
106
|
+
client: l1Client,
|
|
118
107
|
});
|
|
119
108
|
|
|
120
109
|
return { token, bridge, tokenPortalAddress, tokenPortal, underlyingERC20 };
|
|
@@ -140,21 +129,19 @@ export class CrossChainTestHarness {
|
|
|
140
129
|
static async new(
|
|
141
130
|
aztecNode: AztecNode,
|
|
142
131
|
pxeService: PXE,
|
|
143
|
-
|
|
144
|
-
walletClient: ViemWalletClient,
|
|
132
|
+
l1Client: ExtendedViemWalletClient,
|
|
145
133
|
wallet: AccountWallet,
|
|
146
134
|
logger: Logger,
|
|
147
135
|
underlyingERC20Address: EthAddress,
|
|
148
136
|
): Promise<CrossChainTestHarness> {
|
|
149
|
-
const ethAccount = EthAddress.fromString((await
|
|
137
|
+
const ethAccount = EthAddress.fromString((await l1Client.getAddresses())[0]);
|
|
150
138
|
const l1ContractAddresses = (await pxeService.getNodeInfo()).l1ContractAddresses;
|
|
151
139
|
|
|
152
140
|
// Deploy and initialize all required contracts
|
|
153
141
|
logger.info('Deploying and initializing token, portal and its bridge...');
|
|
154
142
|
const { token, bridge, tokenPortalAddress, underlyingERC20 } = await deployAndInitializeTokenAndBridgeContracts(
|
|
155
143
|
wallet,
|
|
156
|
-
|
|
157
|
-
publicClient,
|
|
144
|
+
l1Client,
|
|
158
145
|
l1ContractAddresses.registryAddress,
|
|
159
146
|
wallet.getAddress(),
|
|
160
147
|
underlyingERC20Address,
|
|
@@ -170,8 +157,7 @@ export class CrossChainTestHarness {
|
|
|
170
157
|
ethAccount,
|
|
171
158
|
tokenPortalAddress,
|
|
172
159
|
underlyingERC20.address,
|
|
173
|
-
|
|
174
|
-
walletClient,
|
|
160
|
+
l1Client,
|
|
175
161
|
l1ContractAddresses,
|
|
176
162
|
wallet,
|
|
177
163
|
);
|
|
@@ -202,10 +188,8 @@ export class CrossChainTestHarness {
|
|
|
202
188
|
public tokenPortalAddress: EthAddress,
|
|
203
189
|
/** Underlying token for portal tests. */
|
|
204
190
|
public underlyingERC20Address: EthAddress,
|
|
205
|
-
/** Viem
|
|
206
|
-
public
|
|
207
|
-
/** Viem Wallet Client instance. */
|
|
208
|
-
public walletClient: ViemWalletClient,
|
|
191
|
+
/** Viem Extended client instance. */
|
|
192
|
+
public l1Client: ExtendedViemWalletClient,
|
|
209
193
|
|
|
210
194
|
/** Deployment addresses for all L1 contracts */
|
|
211
195
|
public readonly l1ContractAddresses: L1ContractAddresses,
|
|
@@ -218,8 +202,7 @@ export class CrossChainTestHarness {
|
|
|
218
202
|
this.underlyingERC20Address,
|
|
219
203
|
this.l1ContractAddresses.feeAssetHandlerAddress,
|
|
220
204
|
this.l1ContractAddresses.outboxAddress,
|
|
221
|
-
this.
|
|
222
|
-
this.walletClient,
|
|
205
|
+
this.l1Client,
|
|
223
206
|
this.logger,
|
|
224
207
|
);
|
|
225
208
|
this.l1TokenManager = this.l1TokenPortalManager.getTokenManager();
|
|
@@ -230,11 +213,11 @@ export class CrossChainTestHarness {
|
|
|
230
213
|
const contract = getContract({
|
|
231
214
|
abi: TestERC20Abi,
|
|
232
215
|
address: this.l1TokenManager.tokenAddress.toString(),
|
|
233
|
-
client: this.
|
|
216
|
+
client: this.l1Client,
|
|
234
217
|
});
|
|
235
218
|
const balanceBefore = await this.l1TokenManager.getL1TokenBalance(this.ethAccount.toString());
|
|
236
219
|
const hash = await contract.write.mint([this.ethAccount.toString(), amount]);
|
|
237
|
-
await this.
|
|
220
|
+
await this.l1Client.waitForTransactionReceipt({ hash });
|
|
238
221
|
expect(await this.l1TokenManager.getL1TokenBalance(this.ethAccount.toString())).toEqual(balanceBefore + amount);
|
|
239
222
|
}
|
|
240
223
|
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
type Wallet,
|
|
12
12
|
retryUntil,
|
|
13
13
|
} from '@aztec/aztec.js';
|
|
14
|
-
import type {
|
|
14
|
+
import type { ExtendedViemWalletClient } from '@aztec/ethereum';
|
|
15
15
|
import { TestERC20Abi } from '@aztec/l1-artifacts/TestERC20Abi';
|
|
16
16
|
import { FeeJuiceContract } from '@aztec/noir-contracts.js/FeeJuice';
|
|
17
17
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
@@ -31,8 +31,7 @@ export interface FeeJuicePortalTestingHarnessFactoryConfig {
|
|
|
31
31
|
aztecNode: AztecNode;
|
|
32
32
|
aztecNodeAdmin?: AztecNodeAdmin;
|
|
33
33
|
pxeService: PXE;
|
|
34
|
-
|
|
35
|
-
walletClient: ViemWalletClient;
|
|
34
|
+
l1Client: ExtendedViemWalletClient;
|
|
36
35
|
wallet: Wallet;
|
|
37
36
|
logger: Logger;
|
|
38
37
|
mockL1?: boolean;
|
|
@@ -42,9 +41,9 @@ export class FeeJuicePortalTestingHarnessFactory {
|
|
|
42
41
|
private constructor(private config: FeeJuicePortalTestingHarnessFactoryConfig) {}
|
|
43
42
|
|
|
44
43
|
private async createReal() {
|
|
45
|
-
const { aztecNode, aztecNodeAdmin, pxeService,
|
|
44
|
+
const { aztecNode, aztecNodeAdmin, pxeService, l1Client, wallet, logger } = this.config;
|
|
46
45
|
|
|
47
|
-
const ethAccount = EthAddress.fromString((await
|
|
46
|
+
const ethAccount = EthAddress.fromString((await l1Client.getAddresses())[0]);
|
|
48
47
|
const l1ContractAddresses = (await pxeService.getNodeInfo()).l1ContractAddresses;
|
|
49
48
|
|
|
50
49
|
const feeJuiceAddress = l1ContractAddresses.feeJuiceAddress;
|
|
@@ -66,8 +65,7 @@ export class FeeJuicePortalTestingHarnessFactory {
|
|
|
66
65
|
feeJuicePortalAddress,
|
|
67
66
|
feeJuiceAddress,
|
|
68
67
|
l1ContractAddresses.feeAssetHandlerAddress!,
|
|
69
|
-
|
|
70
|
-
walletClient,
|
|
68
|
+
l1Client,
|
|
71
69
|
);
|
|
72
70
|
}
|
|
73
71
|
|
|
@@ -107,17 +105,14 @@ export class GasBridgingTestHarness implements IGasBridgingTestHarness {
|
|
|
107
105
|
public l1FeeJuiceAddress: EthAddress,
|
|
108
106
|
/** Fee asset handler address. */
|
|
109
107
|
public feeAssetHandlerAddress: EthAddress,
|
|
110
|
-
/** Viem
|
|
111
|
-
public
|
|
112
|
-
/** Viem Wallet Client instance. */
|
|
113
|
-
public walletClient: ViemWalletClient,
|
|
108
|
+
/** Viem Extended client instance. */
|
|
109
|
+
public l1Client: ExtendedViemWalletClient,
|
|
114
110
|
) {
|
|
115
111
|
this.feeJuicePortalManager = new L1FeeJuicePortalManager(
|
|
116
112
|
this.feeJuicePortalAddress,
|
|
117
113
|
this.l1FeeJuiceAddress,
|
|
118
114
|
this.feeAssetHandlerAddress,
|
|
119
|
-
this.
|
|
120
|
-
this.walletClient,
|
|
115
|
+
this.l1Client,
|
|
121
116
|
this.logger,
|
|
122
117
|
);
|
|
123
118
|
|
|
@@ -130,7 +125,7 @@ export class GasBridgingTestHarness implements IGasBridgingTestHarness {
|
|
|
130
125
|
const feeAssetL1 = getContract({
|
|
131
126
|
address: this.l1FeeJuiceAddress.toString(),
|
|
132
127
|
abi: TestERC20Abi,
|
|
133
|
-
client: this.
|
|
128
|
+
client: this.l1Client,
|
|
134
129
|
});
|
|
135
130
|
|
|
136
131
|
await feeAssetL1.write.mint([to.toString(), amount]);
|
|
@@ -12,9 +12,8 @@ import {
|
|
|
12
12
|
import { CheatCodes } from '@aztec/aztec.js/testing';
|
|
13
13
|
import {
|
|
14
14
|
type DeployL1ContractsReturnType,
|
|
15
|
+
type ExtendedViemWalletClient,
|
|
15
16
|
RollupContract,
|
|
16
|
-
type ViemPublicClient,
|
|
17
|
-
type ViemWalletClient,
|
|
18
17
|
deployL1Contract,
|
|
19
18
|
extractEvent,
|
|
20
19
|
} from '@aztec/ethereum';
|
|
@@ -46,10 +45,8 @@ export type UniswapSetupContext = {
|
|
|
46
45
|
pxe: PXE;
|
|
47
46
|
/** Logger instance named as the current test. */
|
|
48
47
|
logger: Logger;
|
|
49
|
-
/**
|
|
50
|
-
|
|
51
|
-
/** Viem Wallet Client instance. */
|
|
52
|
-
walletClient: ViemWalletClient;
|
|
48
|
+
/** The L1 wallet client, extended with public actions. */
|
|
49
|
+
l1Client: ExtendedViemWalletClient;
|
|
53
50
|
/** The owner wallet. */
|
|
54
51
|
ownerWallet: AccountWallet;
|
|
55
52
|
/** The sponsor wallet. */
|
|
@@ -77,8 +74,7 @@ export const uniswapL1L2TestSuite = (
|
|
|
77
74
|
let pxe: PXE;
|
|
78
75
|
let logger: Logger;
|
|
79
76
|
|
|
80
|
-
let
|
|
81
|
-
let publicClient: ViemPublicClient;
|
|
77
|
+
let l1Client: ExtendedViemWalletClient;
|
|
82
78
|
|
|
83
79
|
let ownerWallet: AccountWallet;
|
|
84
80
|
let ownerAddress: AztecAddress;
|
|
@@ -92,7 +88,7 @@ export const uniswapL1L2TestSuite = (
|
|
|
92
88
|
|
|
93
89
|
let deployL1ContractsValues: DeployL1ContractsReturnType;
|
|
94
90
|
let rollup: RollupContract;
|
|
95
|
-
let uniswapPortal: GetContractReturnType<typeof UniswapPortalAbi,
|
|
91
|
+
let uniswapPortal: GetContractReturnType<typeof UniswapPortalAbi, ExtendedViemWalletClient>;
|
|
96
92
|
let uniswapPortalAddress: EthAddress;
|
|
97
93
|
let uniswapL2Contract: UniswapContract;
|
|
98
94
|
|
|
@@ -103,30 +99,21 @@ export const uniswapL1L2TestSuite = (
|
|
|
103
99
|
let cheatCodes: CheatCodes;
|
|
104
100
|
let version: number;
|
|
105
101
|
beforeAll(async () => {
|
|
106
|
-
({
|
|
107
|
-
|
|
108
|
-
pxe,
|
|
109
|
-
logger,
|
|
110
|
-
publicClient,
|
|
111
|
-
walletClient,
|
|
112
|
-
ownerWallet,
|
|
113
|
-
sponsorWallet,
|
|
114
|
-
deployL1ContractsValues,
|
|
115
|
-
cheatCodes,
|
|
116
|
-
} = await setup());
|
|
102
|
+
({ aztecNode, pxe, logger, l1Client, ownerWallet, sponsorWallet, deployL1ContractsValues, cheatCodes } =
|
|
103
|
+
await setup());
|
|
117
104
|
|
|
118
|
-
if (Number(await
|
|
105
|
+
if (Number(await l1Client.getBlockNumber()) < expectedForkBlockNumber) {
|
|
119
106
|
throw new Error('This test must be run on a fork of mainnet with the expected fork block');
|
|
120
107
|
}
|
|
121
108
|
|
|
122
109
|
rollup = new RollupContract(
|
|
123
|
-
deployL1ContractsValues.
|
|
110
|
+
deployL1ContractsValues.l1Client,
|
|
124
111
|
deployL1ContractsValues.l1ContractAddresses.rollupAddress,
|
|
125
112
|
);
|
|
126
113
|
version = Number(await rollup.getVersion());
|
|
127
114
|
ownerAddress = ownerWallet.getAddress();
|
|
128
115
|
// sponsorAddress = sponsorWallet.getAddress();
|
|
129
|
-
ownerEthAddress = EthAddress.fromString((await
|
|
116
|
+
ownerEthAddress = EthAddress.fromString((await l1Client.getAddresses())[0]);
|
|
130
117
|
|
|
131
118
|
await ensureAccountsPubliclyDeployed(ownerWallet, [ownerWallet, sponsorWallet]);
|
|
132
119
|
|
|
@@ -134,8 +121,7 @@ export const uniswapL1L2TestSuite = (
|
|
|
134
121
|
daiCrossChainHarness = await CrossChainTestHarness.new(
|
|
135
122
|
aztecNode,
|
|
136
123
|
pxe,
|
|
137
|
-
|
|
138
|
-
walletClient,
|
|
124
|
+
deployL1ContractsValues.l1Client,
|
|
139
125
|
ownerWallet,
|
|
140
126
|
logger,
|
|
141
127
|
DAI_ADDRESS,
|
|
@@ -145,25 +131,21 @@ export const uniswapL1L2TestSuite = (
|
|
|
145
131
|
wethCrossChainHarness = await CrossChainTestHarness.new(
|
|
146
132
|
aztecNode,
|
|
147
133
|
pxe,
|
|
148
|
-
|
|
149
|
-
walletClient,
|
|
134
|
+
l1Client,
|
|
150
135
|
ownerWallet,
|
|
151
136
|
logger,
|
|
152
137
|
WETH9_ADDRESS,
|
|
153
138
|
);
|
|
154
139
|
|
|
155
140
|
logger.info('Deploy Uniswap portal on L1 and L2...');
|
|
156
|
-
uniswapPortalAddress = await deployL1Contract(
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
UniswapPortalAbi,
|
|
160
|
-
UniswapPortalBytecode,
|
|
161
|
-
).then(({ address }) => address);
|
|
141
|
+
uniswapPortalAddress = await deployL1Contract(l1Client, UniswapPortalAbi, UniswapPortalBytecode).then(
|
|
142
|
+
({ address }) => address,
|
|
143
|
+
);
|
|
162
144
|
|
|
163
145
|
uniswapPortal = getContract({
|
|
164
146
|
address: uniswapPortalAddress.toString(),
|
|
165
147
|
abi: UniswapPortalAbi,
|
|
166
|
-
client:
|
|
148
|
+
client: l1Client,
|
|
167
149
|
});
|
|
168
150
|
// deploy l2 uniswap contract and attach to portal
|
|
169
151
|
uniswapL2Contract = await UniswapContract.deploy(ownerWallet, uniswapPortalAddress).send().deployed();
|
|
@@ -177,8 +159,8 @@ export const uniswapL1L2TestSuite = (
|
|
|
177
159
|
|
|
178
160
|
// Give me some WETH so I can deposit to L2 and do the swap...
|
|
179
161
|
logger.info('Getting some weth');
|
|
180
|
-
const hash = await
|
|
181
|
-
await
|
|
162
|
+
const hash = await l1Client.sendTransaction({ to: WETH9_ADDRESS.toString(), value: parseEther('1000') });
|
|
163
|
+
await l1Client.waitForTransactionReceipt({ hash });
|
|
182
164
|
|
|
183
165
|
const wethBalance = await wethCrossChainHarness.getL1BalanceOf(ownerEthAddress);
|
|
184
166
|
expect(wethBalance).toBe(parseEther('1000'));
|
|
@@ -263,7 +245,7 @@ export const uniswapL1L2TestSuite = (
|
|
|
263
245
|
uniswapL2Contract.address,
|
|
264
246
|
new Fr(version), // aztec version
|
|
265
247
|
EthAddress.fromString(uniswapPortal.address).toBuffer32(),
|
|
266
|
-
new Fr(
|
|
248
|
+
new Fr(l1Client.chain.id), // chain id
|
|
267
249
|
swapPrivateContent,
|
|
268
250
|
]);
|
|
269
251
|
|
|
@@ -278,7 +260,7 @@ export const uniswapL1L2TestSuite = (
|
|
|
278
260
|
wethCrossChainHarness.l2Bridge.address,
|
|
279
261
|
new Fr(version), // aztec version
|
|
280
262
|
wethCrossChainHarness.tokenPortalAddress.toBuffer32(),
|
|
281
|
-
new Fr(
|
|
263
|
+
new Fr(l1Client.chain.id), // chain id
|
|
282
264
|
withdrawContent,
|
|
283
265
|
]);
|
|
284
266
|
|
|
@@ -333,7 +315,7 @@ export const uniswapL1L2TestSuite = (
|
|
|
333
315
|
] as const;
|
|
334
316
|
|
|
335
317
|
// this should also insert a message into the inbox.
|
|
336
|
-
const txReceipt = await daiCrossChainHarness.
|
|
318
|
+
const txReceipt = await daiCrossChainHarness.l1Client.waitForTransactionReceipt({
|
|
337
319
|
hash: await uniswapPortal.write.swapPrivate(swapArgs),
|
|
338
320
|
});
|
|
339
321
|
|
|
@@ -851,7 +833,7 @@ export const uniswapL1L2TestSuite = (
|
|
|
851
833
|
uniswapL2Contract.address,
|
|
852
834
|
new Fr(version), // aztec version
|
|
853
835
|
EthAddress.fromString(uniswapPortal.address).toBuffer32(),
|
|
854
|
-
new Fr(
|
|
836
|
+
new Fr(l1Client.chain.id), // chain id
|
|
855
837
|
swapPrivateContent,
|
|
856
838
|
]);
|
|
857
839
|
|
|
@@ -866,7 +848,7 @@ export const uniswapL1L2TestSuite = (
|
|
|
866
848
|
wethCrossChainHarness.l2Bridge.address,
|
|
867
849
|
new Fr(version), // aztec version
|
|
868
850
|
wethCrossChainHarness.tokenPortalAddress.toBuffer32(),
|
|
869
|
-
new Fr(
|
|
851
|
+
new Fr(l1Client.chain.id), // chain id
|
|
870
852
|
withdrawContent,
|
|
871
853
|
]);
|
|
872
854
|
|
|
@@ -981,7 +963,7 @@ export const uniswapL1L2TestSuite = (
|
|
|
981
963
|
uniswapL2Contract.address,
|
|
982
964
|
new Fr(version), // aztec version
|
|
983
965
|
EthAddress.fromString(uniswapPortal.address).toBuffer32(),
|
|
984
|
-
new Fr(
|
|
966
|
+
new Fr(l1Client.chain.id), // chain id
|
|
985
967
|
swapPublicContent,
|
|
986
968
|
]);
|
|
987
969
|
|
|
@@ -996,7 +978,7 @@ export const uniswapL1L2TestSuite = (
|
|
|
996
978
|
wethCrossChainHarness.l2Bridge.address,
|
|
997
979
|
new Fr(version), // aztec version
|
|
998
980
|
wethCrossChainHarness.tokenPortalAddress.toBuffer32(),
|
|
999
|
-
new Fr(
|
|
981
|
+
new Fr(l1Client.chain.id), // chain id
|
|
1000
982
|
withdrawContent,
|
|
1001
983
|
]);
|
|
1002
984
|
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
createCompatibleClient,
|
|
13
13
|
retryUntil,
|
|
14
14
|
} from '@aztec/aztec.js';
|
|
15
|
-
import { createEthereumChain,
|
|
15
|
+
import { createEthereumChain, createExtendedL1Client } from '@aztec/ethereum';
|
|
16
16
|
import type { Logger } from '@aztec/foundation/log';
|
|
17
17
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
18
18
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
@@ -105,10 +105,10 @@ async function bridgeL1FeeJuice(
|
|
|
105
105
|
) {
|
|
106
106
|
const { l1ChainId } = await pxe.getNodeInfo();
|
|
107
107
|
const chain = createEthereumChain(l1RpcUrls, l1ChainId);
|
|
108
|
-
const
|
|
108
|
+
const l1Client = createExtendedL1Client(chain.rpcUrls, mnemonicOrPrivateKey, chain.chainInfo);
|
|
109
109
|
|
|
110
110
|
// docs:start:bridge_fee_juice
|
|
111
|
-
const portal = await L1FeeJuicePortalManager.new(pxe,
|
|
111
|
+
const portal = await L1FeeJuicePortalManager.new(pxe, l1Client, log);
|
|
112
112
|
const claim = await portal.bridgeTokensPublic(recipient, amount, true /* mint */);
|
|
113
113
|
// docs:end:bridge_fee_juice
|
|
114
114
|
|