From 588b6bd1804ded4c7118d767a3998115d5047e7f Mon Sep 17 00:00:00 2001 From: zorzal Date: Mon, 18 Nov 2024 00:05:40 -0500 Subject: [PATCH] revert: decrement 1 in bounded inputs instead of restrict fuzzing range --- test/unit/HorizonAccountingExtension.t.sol | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/test/unit/HorizonAccountingExtension.t.sol b/test/unit/HorizonAccountingExtension.t.sol index d303e79..cb540d9 100644 --- a/test/unit/HorizonAccountingExtension.t.sol +++ b/test/unit/HorizonAccountingExtension.t.sol @@ -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); @@ -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);