Skip to content

Commit

Permalink
revert: decrement 1 in bounded inputs instead of restrict fuzzing range
Browse files Browse the repository at this point in the history
  • Loading branch information
xorsal committed Nov 18, 2024
1 parent 8b25aaa commit 588b6bd
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions test/unit/HorizonAccountingExtension.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -826,16 +826,14 @@ contract HorizonAccountingExtension_Unit_ClaimEscalationReward is HorizonAccount
uint256 _bondSize,
uint256 _amount
) public {
vm.assume(_amount >= _bondSize);

vm.assume(_pledger != _slashedUser);
vm.assume(_slashedUser != _notSlashedUser);

// bound input parameters
_pledgesForDispute = bound(_pledgesForDispute, 1, type(uint64).max);
_pledgesAgainstDispute = bound(_pledgesAgainstDispute, 1, type(uint64).max);
_amount = bound(_amount, type(uint16).max, type(uint64).max);
_bondSize = bound(_bondSize, 1, type(uint16).max);
_pledgesForDispute = bound(_pledgesForDispute, 1, type(uint64).max - 1);
_pledgesAgainstDispute = bound(_pledgesAgainstDispute, 1, type(uint64).max - 1);
_amount = bound(_amount, type(uint16).max, type(uint64).max - 1);
_bondSize = bound(_bondSize, 1, type(uint16).max - 1);

_setUpHappyPath(_pledgesForDispute, _pledgesAgainstDispute, _bondSize, _amount);

Expand Down Expand Up @@ -907,15 +905,13 @@ contract HorizonAccountingExtension_Unit_ClaimEscalationReward is HorizonAccount
uint256 _bondSize,
uint256 _amount
) public {
vm.assume(_amount >= _bondSize);

vm.assume(_pledger != _slashedUser);
vm.assume(_slashedUser != _notSlashedUser);
// bound input parameters
_pledgesForDispute = bound(_pledgesForDispute, 1, type(uint64).max);
_pledgesAgainstDispute = bound(_pledgesAgainstDispute, 1, type(uint64).max);
_amount = bound(_amount, type(uint16).max, type(uint64).max);
_bondSize = bound(_bondSize, 1, type(uint16).max);
_pledgesForDispute = bound(_pledgesForDispute, 1, type(uint64).max - 1);
_pledgesAgainstDispute = bound(_pledgesAgainstDispute, 1, type(uint64).max - 1);
_amount = bound(_amount, type(uint16).max, type(uint64).max - 1);
_bondSize = bound(_bondSize, 1, type(uint16).max - 1);

_setUpHappyPath(_pledgesForDispute, _pledgesAgainstDispute, _bondSize, _amount);

Expand Down

0 comments on commit 588b6bd

Please sign in to comment.