@aztec/end-to-end 1.0.0-nightly.20250608 → 1.0.0-nightly.20250611
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/e2e_p2p/p2p_network.d.ts +9 -1
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +33 -4
- package/dest/e2e_p2p/shared.d.ts +24 -0
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +72 -1
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +5 -0
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +43 -42
- package/package.json +37 -36
- package/src/e2e_p2p/p2p_network.ts +43 -4
- package/src/e2e_p2p/shared.ts +136 -1
- package/src/fixtures/dumps/epoch_proof_result.json +1 -1
- package/src/fixtures/setup_p2p_test.ts +7 -0
- package/src/shared/uniswap_l1_l2.ts +43 -42
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
import { sha256ToField } from '@aztec/foundation/crypto';
|
|
21
21
|
import { InboxAbi, UniswapPortalAbi, UniswapPortalBytecode } from '@aztec/l1-artifacts';
|
|
22
22
|
import { UniswapContract } from '@aztec/noir-contracts.js/Uniswap';
|
|
23
|
+
import { computeL2ToL1MessageHash } from '@aztec/stdlib/hash';
|
|
23
24
|
import { computeL2ToL1MembershipWitness } from '@aztec/stdlib/messaging';
|
|
24
25
|
|
|
25
26
|
import { jest } from '@jest/globals';
|
|
@@ -242,13 +243,13 @@ export const uniswapL1L2TestSuite = (
|
|
|
242
243
|
ownerEthAddress.toBuffer32(),
|
|
243
244
|
]);
|
|
244
245
|
|
|
245
|
-
const swapPrivateLeaf =
|
|
246
|
-
uniswapL2Contract.address,
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
new Fr(
|
|
250
|
-
|
|
251
|
-
|
|
246
|
+
const swapPrivateLeaf = computeL2ToL1MessageHash({
|
|
247
|
+
l2Sender: uniswapL2Contract.address,
|
|
248
|
+
l1Recipient: EthAddress.fromString(uniswapPortal.address),
|
|
249
|
+
content: swapPrivateContent,
|
|
250
|
+
rollupVersion: new Fr(version),
|
|
251
|
+
chainId: new Fr(l1Client.chain.id),
|
|
252
|
+
});
|
|
252
253
|
|
|
253
254
|
const withdrawContent = sha256ToField([
|
|
254
255
|
Buffer.from(toFunctionSelector('withdraw(address,uint256,address)').substring(2), 'hex'),
|
|
@@ -257,13 +258,13 @@ export const uniswapL1L2TestSuite = (
|
|
|
257
258
|
uniswapPortalAddress.toBuffer32(),
|
|
258
259
|
]);
|
|
259
260
|
|
|
260
|
-
const withdrawLeaf =
|
|
261
|
-
wethCrossChainHarness.l2Bridge.address,
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
new Fr(
|
|
265
|
-
|
|
266
|
-
|
|
261
|
+
const withdrawLeaf = computeL2ToL1MessageHash({
|
|
262
|
+
l2Sender: wethCrossChainHarness.l2Bridge.address,
|
|
263
|
+
l1Recipient: wethCrossChainHarness.tokenPortalAddress,
|
|
264
|
+
content: withdrawContent,
|
|
265
|
+
rollupVersion: new Fr(version),
|
|
266
|
+
chainId: new Fr(l1Client.chain.id),
|
|
267
|
+
});
|
|
267
268
|
|
|
268
269
|
// ensure that user's funds were burnt
|
|
269
270
|
await wethCrossChainHarness.expectPrivateBalanceOnL2(ownerAddress, wethL2BalanceBeforeSwap - wethAmountToBridge);
|
|
@@ -837,13 +838,13 @@ export const uniswapL1L2TestSuite = (
|
|
|
837
838
|
ownerEthAddress.toBuffer32(),
|
|
838
839
|
]);
|
|
839
840
|
|
|
840
|
-
const swapPrivateLeaf =
|
|
841
|
-
uniswapL2Contract.address,
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
new Fr(
|
|
845
|
-
|
|
846
|
-
|
|
841
|
+
const swapPrivateLeaf = computeL2ToL1MessageHash({
|
|
842
|
+
l2Sender: uniswapL2Contract.address,
|
|
843
|
+
l1Recipient: EthAddress.fromString(uniswapPortal.address),
|
|
844
|
+
content: swapPrivateContent,
|
|
845
|
+
rollupVersion: new Fr(version),
|
|
846
|
+
chainId: new Fr(l1Client.chain.id),
|
|
847
|
+
});
|
|
847
848
|
|
|
848
849
|
const withdrawContent = sha256ToField([
|
|
849
850
|
Buffer.from(toFunctionSelector('withdraw(address,uint256,address)').substring(2), 'hex'),
|
|
@@ -852,13 +853,13 @@ export const uniswapL1L2TestSuite = (
|
|
|
852
853
|
uniswapPortalAddress.toBuffer32(),
|
|
853
854
|
]);
|
|
854
855
|
|
|
855
|
-
const withdrawLeaf =
|
|
856
|
-
wethCrossChainHarness.l2Bridge.address,
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
new Fr(
|
|
860
|
-
|
|
861
|
-
|
|
856
|
+
const withdrawLeaf = computeL2ToL1MessageHash({
|
|
857
|
+
l2Sender: wethCrossChainHarness.l2Bridge.address,
|
|
858
|
+
l1Recipient: wethCrossChainHarness.tokenPortalAddress,
|
|
859
|
+
content: withdrawContent,
|
|
860
|
+
rollupVersion: new Fr(version),
|
|
861
|
+
chainId: new Fr(l1Client.chain.id),
|
|
862
|
+
});
|
|
862
863
|
|
|
863
864
|
const swapResult = await computeL2ToL1MembershipWitness(aztecNode, withdrawReceipt.blockNumber!, swapPrivateLeaf);
|
|
864
865
|
const withdrawResult = await computeL2ToL1MembershipWitness(
|
|
@@ -971,13 +972,13 @@ export const uniswapL1L2TestSuite = (
|
|
|
971
972
|
ownerEthAddress.toBuffer32(),
|
|
972
973
|
]);
|
|
973
974
|
|
|
974
|
-
const swapPublicLeaf =
|
|
975
|
-
uniswapL2Contract.address,
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
new Fr(
|
|
979
|
-
|
|
980
|
-
|
|
975
|
+
const swapPublicLeaf = computeL2ToL1MessageHash({
|
|
976
|
+
l2Sender: uniswapL2Contract.address,
|
|
977
|
+
l1Recipient: EthAddress.fromString(uniswapPortal.address),
|
|
978
|
+
content: swapPublicContent,
|
|
979
|
+
rollupVersion: new Fr(version),
|
|
980
|
+
chainId: new Fr(l1Client.chain.id),
|
|
981
|
+
});
|
|
981
982
|
|
|
982
983
|
const withdrawContent = sha256ToField([
|
|
983
984
|
Buffer.from(toFunctionSelector('withdraw(address,uint256,address)').substring(2), 'hex'),
|
|
@@ -986,13 +987,13 @@ export const uniswapL1L2TestSuite = (
|
|
|
986
987
|
uniswapPortalAddress.toBuffer32(),
|
|
987
988
|
]);
|
|
988
989
|
|
|
989
|
-
const withdrawLeaf =
|
|
990
|
-
wethCrossChainHarness.l2Bridge.address,
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
new Fr(
|
|
994
|
-
|
|
995
|
-
|
|
990
|
+
const withdrawLeaf = computeL2ToL1MessageHash({
|
|
991
|
+
l2Sender: wethCrossChainHarness.l2Bridge.address,
|
|
992
|
+
l1Recipient: wethCrossChainHarness.tokenPortalAddress,
|
|
993
|
+
content: withdrawContent,
|
|
994
|
+
rollupVersion: new Fr(version),
|
|
995
|
+
chainId: new Fr(l1Client.chain.id),
|
|
996
|
+
});
|
|
996
997
|
|
|
997
998
|
const swapResult = await computeL2ToL1MembershipWitness(aztecNode, withdrawReceipt.blockNumber!, swapPublicLeaf);
|
|
998
999
|
const withdrawResult = await computeL2ToL1MembershipWitness(
|