@@ -508,10 +508,44 @@ contract RouterTest is Test {
508508
509509 function test_SetWithdrawGasLimit_ZeroValueReverts () public {
510510 uint256 zeroGasLimit = 0 ;
511- vm.expectRevert ("Gas limit cannot be zero " );
511+ vm.expectRevert ("Gas limit below minimum " );
512512 router.setWithdrawGasLimit (zeroGasLimit);
513513 }
514514
515+ function test_SetWithdrawGasLimit_BelowMinimumReverts () public {
516+ uint256 tooLowGasLimit = 99999 ; // Just below minimum of 100000
517+
518+ vm.expectRevert ("Gas limit below minimum " );
519+ router.setWithdrawGasLimit (tooLowGasLimit);
520+ }
521+
522+ function test_SetWithdrawGasLimit_AboveMaximumReverts () public {
523+ uint256 tooHighGasLimit = 10000001 ; // Just above maximum of 10000000
524+
525+ vm.expectRevert ("Gas limit above maximum " );
526+ router.setWithdrawGasLimit (tooHighGasLimit);
527+ }
528+
529+ function test_SetWithdrawGasLimit_AtMinimum () public {
530+ uint256 minimumGasLimit = 100000 ; // Exactly at minimum
531+
532+ // Set at minimum should work
533+ router.setWithdrawGasLimit (minimumGasLimit);
534+
535+ // Verify the gas limit was set
536+ assertEq (router.withdrawGasLimit (), minimumGasLimit);
537+ }
538+
539+ function test_SetWithdrawGasLimit_AtMaximum () public {
540+ uint256 maximumGasLimit = 10000000 ; // Exactly at maximum
541+
542+ // Set at maximum should work
543+ router.setWithdrawGasLimit (maximumGasLimit);
544+
545+ // Verify the gas limit was set
546+ assertEq (router.withdrawGasLimit (), maximumGasLimit);
547+ }
548+
515549 function test_SetWithdrawGasLimit_NonAdminReverts () public {
516550 uint256 newGasLimit = 200000 ;
517551 vm.prank (user1);
@@ -1094,10 +1128,50 @@ contract RouterTest is Test {
10941128 uint256 zeroGasLimit = 0 ;
10951129
10961130 // Attempt to set a zero gas limit
1097- vm.expectRevert ("Gas limit cannot be zero " );
1131+ vm.expectRevert ("Gas limit below minimum " );
10981132 router.setChainWithdrawGasLimit (chainId, zeroGasLimit);
10991133 }
11001134
1135+ function test_SetChainWithdrawGasLimit_BelowMinimumReverts () public {
1136+ uint256 chainId = 42161 ; // Arbitrum chain ID
1137+ uint256 tooLowGasLimit = 99999 ; // Just below minimum of 100000
1138+
1139+ // Attempt to set a gas limit below the minimum
1140+ vm.expectRevert ("Gas limit below minimum " );
1141+ router.setChainWithdrawGasLimit (chainId, tooLowGasLimit);
1142+ }
1143+
1144+ function test_SetChainWithdrawGasLimit_AboveMaximumReverts () public {
1145+ uint256 chainId = 42161 ; // Arbitrum chain ID
1146+ uint256 tooHighGasLimit = 10000001 ; // Just above maximum of 10000000
1147+
1148+ // Attempt to set a gas limit above the maximum
1149+ vm.expectRevert ("Gas limit above maximum " );
1150+ router.setChainWithdrawGasLimit (chainId, tooHighGasLimit);
1151+ }
1152+
1153+ function test_SetChainWithdrawGasLimit_AtMinimum () public {
1154+ uint256 chainId = 42161 ; // Arbitrum chain ID
1155+ uint256 minimumGasLimit = 100000 ; // Exactly at minimum
1156+
1157+ // Set at minimum should work
1158+ router.setChainWithdrawGasLimit (chainId, minimumGasLimit);
1159+
1160+ // Verify the custom gas limit was set
1161+ assertEq (router.chainWithdrawGasLimits (chainId), minimumGasLimit);
1162+ }
1163+
1164+ function test_SetChainWithdrawGasLimit_AtMaximum () public {
1165+ uint256 chainId = 42161 ; // Arbitrum chain ID
1166+ uint256 maximumGasLimit = 10000000 ; // Exactly at maximum
1167+
1168+ // Set at maximum should work
1169+ router.setChainWithdrawGasLimit (chainId, maximumGasLimit);
1170+
1171+ // Verify the custom gas limit was set
1172+ assertEq (router.chainWithdrawGasLimits (chainId), maximumGasLimit);
1173+ }
1174+
11011175 function test_SetChainWithdrawGasLimit_NonAdminReverts () public {
11021176 uint256 chainId = 42161 ; // Arbitrum chain ID
11031177 uint256 customGasLimit = 500000 ;
0 commit comments