From c2a8c148bc15bdcb48d3f83a320a14234a1a15c0 Mon Sep 17 00:00:00 2001 From: CheyenneAtapour Date: Tue, 30 Jul 2024 16:14:46 -0700 Subject: [PATCH] test: fuzz rate limit update --- src/test/TestGhoCcipSteward.t.sol | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/test/TestGhoCcipSteward.t.sol b/src/test/TestGhoCcipSteward.t.sol index 69a159a5..551d4db8 100644 --- a/src/test/TestGhoCcipSteward.t.sol +++ b/src/test/TestGhoCcipSteward.t.sol @@ -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 + ); + } }