@@ -6,11 +6,8 @@ import {Test} from "forge-std/Test.sol";
66import {TestERC20} from "src/mock/TestERC20.sol " ;
77import {IERC20 } from "@oz/token/ERC20/IERC20.sol " ;
88import {IInbox} from "@aztec/core/interfaces/messagebridge/IInbox.sol " ;
9- import {
10- ProposeLib,
11- INBOX_LAG_SECONDS,
12- MAX_L1_TO_L2_MSGS_PER_CHECKPOINT
13- } from "@aztec/core/libraries/rollup/ProposeLib.sol " ;
9+ import {ProposeLib} from "@aztec/core/libraries/rollup/ProposeLib.sol " ;
10+ import {Constants} from "@aztec/core/libraries/ConstantsGen.sol " ;
1411import {TimeLib, Slot, Timestamp} from "@aztec/core/libraries/TimeLib.sol " ;
1512import {Errors} from "@aztec/core/libraries/Errors.sol " ;
1613import {DataStructures} from "@aztec/core/libraries/DataStructures.sol " ;
@@ -50,7 +47,7 @@ contract ProposeInboxConsumptionTest is Test {
5047 // Start of the build frame for a checkpoint proposed in SLOT: it is built during the previous slot.
5148 uint256 internal buildFrameStart = GENESIS_TIME + (Slot.unwrap (SLOT) - 1 ) * SLOT_DURATION;
5249 // Buckets at or before the cutoff must be consumed by the checkpoint.
53- uint256 internal cutoff = buildFrameStart - INBOX_LAG_SECONDS;
50+ uint256 internal cutoff = buildFrameStart - Constants. INBOX_LAG_SECONDS;
5451
5552 function setUp () public {
5653 vm.warp (GENESIS_TIME);
@@ -123,7 +120,7 @@ contract ProposeInboxConsumptionTest is Test {
123120 // One more message than the checkpoint cap, all before the cutoff. They spill over into buckets
124121 // 1..4 of 256 (the per-bucket cap) plus bucket 5 with the single excess message.
125122 vm.warp (cutoff - 100 );
126- _sendMany (MAX_L1_TO_L2_MSGS_PER_CHECKPOINT + 1 );
123+ _sendMany (Constants. MAX_L1_TO_L2_MSGS_PER_CHECKPOINT + 1 );
127124 assertEq (inbox.getCurrentBucketSeq (), 5 , "expected five buckets " );
128125
129126 vm.warp (GENESIS_TIME + Slot.unwrap (SLOT) * SLOT_DURATION);
@@ -132,12 +129,12 @@ contract ProposeInboxConsumptionTest is Test {
132129 // even though it is old.
133130 bytes32 endHash = inbox.getBucket (4 ).rollingHash;
134131 uint256 consumed = rollup.validateInboxConsumption (inbox, endHash, 4 , SLOT, 0 );
135- assertEq (consumed, MAX_L1_TO_L2_MSGS_PER_CHECKPOINT, "consumed the full cap " );
132+ assertEq (consumed, Constants. MAX_L1_TO_L2_MSGS_PER_CHECKPOINT, "consumed the full cap " );
136133 }
137134
138135 function testNoCapEscapeAtExactCap () public {
139136 vm.warp (cutoff - 100 );
140- _sendMany (MAX_L1_TO_L2_MSGS_PER_CHECKPOINT + 1 );
137+ _sendMany (Constants. MAX_L1_TO_L2_MSGS_PER_CHECKPOINT + 1 );
141138
142139 vm.warp (GENESIS_TIME + Slot.unwrap (SLOT) * SLOT_DURATION);
143140
@@ -152,7 +149,7 @@ contract ProposeInboxConsumptionTest is Test {
152149 // Same layout as testCapEscape, but the parent checkpoint had already consumed one message:
153150 // buckets 2..5 then hold cap messages total, which fit in one checkpoint, so no escape from bucket 1.
154151 vm.warp (cutoff - 100 );
155- _sendMany (MAX_L1_TO_L2_MSGS_PER_CHECKPOINT + 1 );
152+ _sendMany (Constants. MAX_L1_TO_L2_MSGS_PER_CHECKPOINT + 1 );
156153
157154 vm.warp (GENESIS_TIME + Slot.unwrap (SLOT) * SLOT_DURATION);
158155
@@ -254,14 +251,16 @@ contract ProposeInboxConsumptionTest is Test {
254251 // One more message than the checkpoint cap, all before the cutoff, referenced in a single proposal from
255252 // a fresh parent: the consumed delta exceeds what the circuits can insert.
256253 vm.warp (cutoff - 100 );
257- _sendMany (MAX_L1_TO_L2_MSGS_PER_CHECKPOINT + 1 );
254+ _sendMany (Constants. MAX_L1_TO_L2_MSGS_PER_CHECKPOINT + 1 );
258255 assertEq (inbox.getCurrentBucketSeq (), 5 , "expected five buckets " );
259256
260257 bytes32 endHash = inbox.getBucket (5 ).rollingHash;
261258
262259 vm.warp (GENESIS_TIME + Slot.unwrap (SLOT) * SLOT_DURATION);
263260 vm.expectRevert (
264- abi.encodeWithSelector (Errors.Rollup__TooManyInboxMessagesConsumed.selector , MAX_L1_TO_L2_MSGS_PER_CHECKPOINT + 1 )
261+ abi.encodeWithSelector (
262+ Errors.Rollup__TooManyInboxMessagesConsumed.selector , Constants.MAX_L1_TO_L2_MSGS_PER_CHECKPOINT + 1
263+ )
265264 );
266265 rollup.validateInboxConsumption (inbox, endHash, 5 , SLOT, 0 );
267266 }
0 commit comments