Skip to content

Commit

Permalink
test: fuzz rate limit update
Browse files Browse the repository at this point in the history
  • Loading branch information
CheyenneAtapour committed Jul 30, 2024
1 parent 236e093 commit c2a8c14
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/test/TestGhoCcipSteward.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,28 @@ contract TestGhoCcipSteward is TestGhoBase {
rateLimitConfig.rate
);
}

function testUpdateRateLimitFuzz(
uint128 outboundCapacity,
uint128 outboundRate,
uint128 inboundCapacity,
uint128 inboundRate
) public {
// Capacity must be striclty greater than rate
outboundRate = uint128(bound(outboundRate, 1, type(uint128).max - 1));
outboundCapacity = uint128(bound(outboundCapacity, outboundRate + 1, type(uint128).max));
inboundRate = uint128(bound(inboundRate, 1, type(uint128).max - 1));
inboundCapacity = uint128(bound(inboundCapacity, inboundRate + 1, type(uint128).max));

vm.prank(RISK_COUNCIL);
GHO_CCIP_STEWARD.updateRateLimit(
2,
rateLimitConfig.isEnabled,
outboundCapacity,
outboundRate,
rateLimitConfig.isEnabled,
inboundCapacity,
inboundRate
);
}
}

0 comments on commit c2a8c14

Please sign in to comment.