@@ -26,6 +26,7 @@ import {TestConstants} from "./harnesses/TestConstants.sol";
26
26
import {RewardDistributor} from "@aztec/governance/RewardDistributor.sol " ;
27
27
import {TxsDecoderHelper} from "./decoders/helpers/TxsDecoderHelper.sol " ;
28
28
import {IERC20Errors } from "@oz/interfaces/draft-IERC6093.sol " ;
29
+ import {ProposeArgs, ProposeLib} from "@aztec/core/libraries/ProposeLib.sol " ;
29
30
30
31
import {
31
32
Timestamp, Slot, Epoch, SlotLib, EpochLib, TimeFns
@@ -40,6 +41,7 @@ import {
40
41
contract RollupTest is DecoderBase , TimeFns {
41
42
using SlotLib for Slot;
42
43
using EpochLib for Epoch;
44
+ using ProposeLib for ProposeArgs;
43
45
44
46
Registry internal registry;
45
47
Inbox internal inbox;
@@ -258,7 +260,9 @@ contract RollupTest is DecoderBase, TimeFns {
258
260
// We jump to the time of the block. (unless it is in the past)
259
261
vm.warp (max (block .timestamp , data.decodedHeader.globalVariables.timestamp));
260
262
261
- rollup.propose (header, archive, blockHash, txHashes, signatures, body);
263
+ ProposeArgs memory args =
264
+ ProposeArgs ({header: header, archive: archive, blockHash: blockHash, txHashes: txHashes});
265
+ rollup.propose (args, signatures, body);
262
266
263
267
quote.epochToProve = Epoch.wrap (1 );
264
268
quote.validUntilSlot = toSlots (Epoch.wrap (2 ));
@@ -424,7 +428,9 @@ contract RollupTest is DecoderBase, TimeFns {
424
428
// We jump to the time of the block. (unless it is in the past)
425
429
vm.warp (max (block .timestamp , data.decodedHeader.globalVariables.timestamp));
426
430
427
- rollup.propose (header, archive, blockHash, txHashes, signatures, body);
431
+ ProposeArgs memory args =
432
+ ProposeArgs ({header: header, archive: archive, blockHash: blockHash, txHashes: txHashes});
433
+ rollup.propose (args, signatures, body);
428
434
429
435
(bytes32 preArchive , bytes32 preBlockHash ,) = rollup.blocks (0 );
430
436
_submitEpochProof (rollup, 1 , preArchive, archive, preBlockHash, blockHash, proverId);
@@ -556,7 +562,13 @@ contract RollupTest is DecoderBase, TimeFns {
556
562
vm.warp (max (block .timestamp , data.decodedHeader.globalVariables.timestamp));
557
563
558
564
vm.expectRevert (abi.encodeWithSelector (Errors.Rollup__NonZeroDaFee.selector ));
559
- rollup.propose (header, data.archive, data.blockHash, txHashes, signatures, data.body);
565
+ ProposeArgs memory args = ProposeArgs ({
566
+ header: header,
567
+ archive: data.archive,
568
+ blockHash: data.blockHash,
569
+ txHashes: txHashes
570
+ });
571
+ rollup.propose (args, signatures, data.body);
560
572
}
561
573
562
574
function testNonZeroL2Fee () public setUpFor ("mixed_block_1 " ) {
@@ -574,7 +586,13 @@ contract RollupTest is DecoderBase, TimeFns {
574
586
vm.warp (max (block .timestamp , data.decodedHeader.globalVariables.timestamp));
575
587
576
588
vm.expectRevert (abi.encodeWithSelector (Errors.Rollup__NonZeroL2Fee.selector ));
577
- rollup.propose (header, data.archive, data.blockHash, txHashes, signatures, data.body);
589
+ ProposeArgs memory args = ProposeArgs ({
590
+ header: header,
591
+ archive: data.archive,
592
+ blockHash: data.blockHash,
593
+ txHashes: txHashes
594
+ });
595
+ rollup.propose (args, signatures, data.body);
578
596
}
579
597
580
598
function testBlockFee () public setUpFor ("mixed_block_1 " ) {
@@ -603,7 +621,13 @@ contract RollupTest is DecoderBase, TimeFns {
603
621
assertEq (coinbaseBalance, 0 , "invalid initial coinbase balance " );
604
622
605
623
// Assert that balance have NOT been increased by proposing the block
606
- rollup.propose (header, data.archive, data.blockHash, txHashes, signatures, data.body);
624
+ ProposeArgs memory args = ProposeArgs ({
625
+ header: header,
626
+ archive: data.archive,
627
+ blockHash: data.blockHash,
628
+ txHashes: txHashes
629
+ });
630
+ rollup.propose (args, signatures, data.body);
607
631
assertEq (testERC20.balanceOf (coinbase), 0 , "invalid coinbase balance " );
608
632
}
609
633
@@ -704,7 +728,13 @@ contract RollupTest is DecoderBase, TimeFns {
704
728
bytes32 [] memory txHashes = new bytes32 [](0 );
705
729
706
730
vm.warp (max (block .timestamp , data2.decodedHeader.globalVariables.timestamp));
707
- rollup.propose (data2.header, data2.archive, data2.blockHash, txHashes, signatures, data2.body);
731
+ ProposeArgs memory args = ProposeArgs ({
732
+ header: data2.header,
733
+ archive: data2.archive,
734
+ blockHash: data2.blockHash,
735
+ txHashes: txHashes
736
+ });
737
+ rollup.propose (args, signatures, data2.body);
708
738
709
739
// Skips proving of block 1
710
740
(bytes32 preArchive ,,) = rollup.blocks (0 );
@@ -749,7 +779,9 @@ contract RollupTest is DecoderBase, TimeFns {
749
779
}
750
780
751
781
vm.expectRevert (abi.encodeWithSelector (Errors.Rollup__InvalidBlockNumber.selector , 1 , 0x420 ));
752
- rollup.propose (header, archive, data.blockHash, txHashes, signatures, body);
782
+ ProposeArgs memory args =
783
+ ProposeArgs ({header: header, archive: archive, blockHash: data.blockHash, txHashes: txHashes});
784
+ rollup.propose (args, signatures, body);
753
785
}
754
786
755
787
function testRevertInvalidChainId () public setUpFor ("empty_block_1 " ) {
@@ -764,7 +796,9 @@ contract RollupTest is DecoderBase, TimeFns {
764
796
}
765
797
766
798
vm.expectRevert (abi.encodeWithSelector (Errors.Rollup__InvalidChainId.selector , 31337 , 0x420 ));
767
- rollup.propose (header, archive, data.blockHash, txHashes, signatures, body);
799
+ ProposeArgs memory args =
800
+ ProposeArgs ({header: header, archive: archive, blockHash: data.blockHash, txHashes: txHashes});
801
+ rollup.propose (args, signatures, body);
768
802
}
769
803
770
804
function testRevertInvalidVersion () public setUpFor ("empty_block_1 " ) {
@@ -779,7 +813,9 @@ contract RollupTest is DecoderBase, TimeFns {
779
813
}
780
814
781
815
vm.expectRevert (abi.encodeWithSelector (Errors.Rollup__InvalidVersion.selector , 1 , 0x420 ));
782
- rollup.propose (header, archive, data.blockHash, txHashes, signatures, body);
816
+ ProposeArgs memory args =
817
+ ProposeArgs ({header: header, archive: archive, blockHash: data.blockHash, txHashes: txHashes});
818
+ rollup.propose (args, signatures, body);
783
819
}
784
820
785
821
function testRevertInvalidTimestamp () public setUpFor ("empty_block_1 " ) {
@@ -799,7 +835,9 @@ contract RollupTest is DecoderBase, TimeFns {
799
835
}
800
836
801
837
vm.expectRevert (abi.encodeWithSelector (Errors.Rollup__InvalidTimestamp.selector , realTs, badTs));
802
- rollup.propose (header, archive, data.blockHash, txHashes, signatures, body);
838
+ ProposeArgs memory args =
839
+ ProposeArgs ({header: header, archive: archive, blockHash: data.blockHash, txHashes: txHashes});
840
+ rollup.propose (args, signatures, body);
803
841
}
804
842
805
843
function testBlocksWithAssumeProven () public setUpFor ("mixed_block_1 " ) {
@@ -879,8 +917,6 @@ contract RollupTest is DecoderBase, TimeFns {
879
917
function _testBlock (string memory name , bool _submitProof , uint256 _slotNumber ) public {
880
918
DecoderBase.Full memory full = load (name);
881
919
bytes memory header = full.block .header ;
882
- bytes32 archive = full.block .archive ;
883
- bytes memory body = full.block .body ;
884
920
uint32 numTxs = full.block .numTxs ;
885
921
bytes32 [] memory txHashes = new bytes32 [](0 );
886
922
@@ -903,14 +939,20 @@ contract RollupTest is DecoderBase, TimeFns {
903
939
904
940
_populateInbox (full.populate.sender, full.populate.recipient, full.populate.l1ToL2Content);
905
941
906
- rollup.propose (header, archive, full.block .blockHash , txHashes, signatures, body);
942
+ ProposeArgs memory args = ProposeArgs ({
943
+ header: header,
944
+ archive: full.block .archive ,
945
+ blockHash: full.block .blockHash ,
946
+ txHashes: txHashes
947
+ });
948
+ rollup.propose (args, signatures, full.block .body );
907
949
908
950
if (_submitProof) {
909
951
uint256 pre = rollup.getProvenBlockNumber ();
910
952
(bytes32 preArchive , bytes32 preBlockHash ,) = rollup.blocks (pre);
911
953
912
954
_submitEpochProof (
913
- rollup, 1 , preArchive, archive, preBlockHash, full.block .blockHash , bytes32 (0 )
955
+ rollup, 1 , preArchive, args. archive, preBlockHash, full.block .blockHash , bytes32 (0 )
914
956
);
915
957
assertEq (pre + 1 , rollup.getProvenBlockNumber (), "Block not proven " );
916
958
}
@@ -952,7 +994,7 @@ contract RollupTest is DecoderBase, TimeFns {
952
994
assertEq (root, bytes32 (0 ), "Invalid outbox root " );
953
995
}
954
996
955
- assertEq (rollup.archive (), archive, "Invalid archive " );
997
+ assertEq (rollup.archive (), args. archive, "Invalid archive " );
956
998
}
957
999
958
1000
function _populateInbox (address _sender , bytes32 _recipient , bytes32 [] memory _contents ) internal {
0 commit comments