Skip to content

Commit

Permalink
fix: cc tests fixed exculding botList
Browse files Browse the repository at this point in the history
  • Loading branch information
0xmikko committed May 15, 2023
1 parent 50f8022 commit d15f310
Show file tree
Hide file tree
Showing 9 changed files with 2,400 additions and 2,400 deletions.
10 changes: 5 additions & 5 deletions contracts/credit/CreditConfiguratorV3.sol
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ contract CreditConfigurator is ICreditConfigurator, ACLNonReentrantTrait {
/// DEPLOYED FOR NEW CREDIT MANAGER

/// Sets limits and fees for the Credit Manager
_setParams(
_setFees(
DEFAULT_FEE_INTEREST,
DEFAULT_FEE_LIQUIDATION,
PERCENTAGE_FACTOR - DEFAULT_LIQUIDATION_PREMIUM,
Expand All @@ -115,7 +115,7 @@ contract CreditConfigurator is ICreditConfigurator, ACLNonReentrantTrait {
); // F:[CC-1]

/// Adds collateral tokens and sets their liquidation thresholds
/// The underlying must not be in this list, since its LT is set separately in _setParams
/// The underlying must not be in this list, since its LT is set separately in _setFees
uint256 len = opts.collateralTokens.length;
for (uint256 i = 0; i < len;) {
address token = opts.collateralTokens[i].token;
Expand Down Expand Up @@ -488,7 +488,7 @@ contract CreditConfigurator is ICreditConfigurator, ACLNonReentrantTrait {
|| (_liquidationPremiumExpired + _feeLiquidationExpired) >= PERCENTAGE_FACTOR
) revert IncorrectParameterException(); // FT:[CC-23]

_setParams(
_setFees(
_feeInterest,
_feeLiquidation,
PERCENTAGE_FACTOR - _liquidationPremium,
Expand All @@ -498,7 +498,7 @@ contract CreditConfigurator is ICreditConfigurator, ACLNonReentrantTrait {
}

/// @dev Does sanity checks on fee params and sets them in CreditManagerV3
function _setParams(
function _setFees(
uint16 _feeInterest,
uint16 _feeLiquidation,
uint16 _liquidationDiscount,
Expand Down Expand Up @@ -531,7 +531,7 @@ contract CreditConfigurator is ICreditConfigurator, ACLNonReentrantTrait {
|| (_liquidationDiscountExpired != _liquidationDiscountExpiredCurrent)
) {
// updates params in creditManager
creditManager.setParams({
creditManager.setFees({
_feeInterest: _feeInterest,
_feeLiquidation: _feeLiquidation,
_liquidationDiscount: _liquidationDiscount,
Expand Down
2 changes: 1 addition & 1 deletion contracts/credit/CreditManagerV3.sol
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,7 @@ contract CreditManagerV3 is ICreditManagerV3, SanityCheckTrait, ReentrancyGuard
/// during expired account liquidations
/// @param _liquidationDiscountExpired Multiplier that reduces the effective totalValue during expired account liquidations,
/// allowing the liquidator to take the unaccounted for remainder as premium. Equal to (1 - liquidationPremiumExpired)
function setParams(
function setFees(
uint16 _feeInterest,
uint16 _feeLiquidation,
uint16 _liquidationDiscount,
Expand Down
1,554 changes: 777 additions & 777 deletions contracts/test/integration/credit/CreditConfigurator.t.sol

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions contracts/test/integration/credit/CreditManager.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1414,7 +1414,7 @@ contract CreditManagerTest is Test, ICreditManagerV3Events, BalanceHelper {
function test_CM_43_calcClosePayments_test() public {
// vm.prank(CONFIGURATOR);

// creditManager.setParams(
// creditManager.setFees(
// 1000, // feeInterest: 10% , it doesn't matter this test
// 200, // feeLiquidation: 2%, it doesn't matter this test
// 9500, // liquidationPremium: 5%, it doesn't matter this test
Expand Down Expand Up @@ -1801,16 +1801,16 @@ contract CreditManagerTest is Test, ICreditManagerV3Events, BalanceHelper {
// SET PARAMS
//

/// @dev [CM-51]: setParams sets configuration properly
function test_CM_51_setParams_sets_configuration_properly() public {
/// @dev [CM-51]: setFees sets configuration properly
function test_CM_51_setFees_sets_configuration_properly() public {
uint16 s_feeInterest = 8733;
uint16 s_feeLiquidation = 1233;
uint16 s_liquidationPremium = 1220;
uint16 s_feeLiquidationExpired = 1221;
uint16 s_liquidationPremiumExpired = 7777;

vm.prank(CONFIGURATOR);
creditManager.setParams(
creditManager.setFees(
s_feeInterest, s_feeLiquidation, s_liquidationPremium, s_feeLiquidationExpired, s_liquidationPremiumExpired
);
(
Expand Down
2 changes: 1 addition & 1 deletion contracts/test/suites/CreditManagerTestSuite.sol
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ contract CreditManagerTestSuite is PoolDeployer {
vm.startPrank(CONFIGURATOR);
creditManager.setCreditFacade(creditFacade);

creditManager.setParams(
creditManager.setFees(
DEFAULT_FEE_INTEREST,
DEFAULT_FEE_LIQUIDATION,
PERCENTAGE_FACTOR - DEFAULT_LIQUIDATION_PREMIUM,
Expand Down
170 changes: 85 additions & 85 deletions contracts/test/unit/credit/CreditConfigurator.t.sol

Large diffs are not rendered by default.

Loading

0 comments on commit d15f310

Please sign in to comment.