Skip to content

Commit

Permalink
fix: Remove isControlledFacilitator helper function
Browse files Browse the repository at this point in the history
  • Loading branch information
CheyenneAtapour committed Oct 14, 2024
1 parent 5f92f09 commit ce2361d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 24 deletions.
14 changes: 2 additions & 12 deletions src/test/TestGhoStewardsForkEthereum.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,10 @@ contract TestGhoStewardsForkEthereum is Test {
newGsmList[0] = gho_gsm_4626;
vm.prank(OWNER);
GHO_BUCKET_STEWARD.setControlledFacilitator(newGsmList, true);
assertTrue(_isControlledFacilitator(gho_gsm_4626));
assertTrue(GHO_BUCKET_STEWARD.isControlledFacilitator(gho_gsm_4626));
vm.prank(OWNER);
GHO_BUCKET_STEWARD.setControlledFacilitator(newGsmList, false);
assertFalse(_isControlledFacilitator(gho_gsm_4626));
assertFalse(GHO_BUCKET_STEWARD.isControlledFacilitator(gho_gsm_4626));
}

function testGhoCcipStewardUpdateBridgeLimit() public {
Expand Down Expand Up @@ -298,14 +298,4 @@ contract TestGhoStewardsForkEthereum is Test {
address rateStrategyAddress = POOL_DATA_PROVIDER.getInterestRateStrategyAddress(GHO_TOKEN);
return IDefaultInterestRateStrategyV2(rateStrategyAddress).getInterestRateDataBps(GHO_TOKEN);
}

function _isControlledFacilitator(address target) internal view returns (bool) {
address[] memory controlledFacilitators = GHO_BUCKET_STEWARD.getControlledFacilitators();
for (uint256 i = 0; i < controlledFacilitators.length; i++) {
if (controlledFacilitators[i] == target) {
return true;
}
}
return false;
}
}
14 changes: 2 additions & 12 deletions src/test/TestGhoStewardsForkRemote.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,10 @@ contract TestGhoStewardsForkRemote is Test {
newGsmList[0] = gho_gsm_4626;
vm.prank(OWNER);
GHO_BUCKET_STEWARD.setControlledFacilitator(newGsmList, true);
assertTrue(_isControlledFacilitator(gho_gsm_4626));
assertTrue(GHO_BUCKET_STEWARD.isControlledFacilitator(gho_gsm_4626));
vm.prank(OWNER);
GHO_BUCKET_STEWARD.setControlledFacilitator(newGsmList, false);
assertFalse(_isControlledFacilitator(gho_gsm_4626));
assertFalse(GHO_BUCKET_STEWARD.isControlledFacilitator(gho_gsm_4626));
}

function testGhoCcipStewardUpdateRateLimit() public {
Expand Down Expand Up @@ -348,14 +348,4 @@ contract TestGhoStewardsForkRemote is Test {
address rateStrategyAddress = POOL_DATA_PROVIDER.getInterestRateStrategyAddress(GHO_TOKEN);
return IDefaultInterestRateStrategyV2(rateStrategyAddress).getInterestRateDataBps(GHO_TOKEN);
}

function _isControlledFacilitator(address target) internal view returns (bool) {
address[] memory controlledFacilitators = GHO_BUCKET_STEWARD.getControlledFacilitators();
for (uint256 i = 0; i < controlledFacilitators.length; i++) {
if (controlledFacilitators[i] == target) {
return true;
}
}
return false;
}
}

0 comments on commit ce2361d

Please sign in to comment.