Skip to content

Commit

Permalink
fix: Replace NO_VARIABLE_RATE_LOAN_IN_RESERVE for NO_VARIABLE_RATE_DEBT
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelmtzinf committed Dec 27, 2021
1 parent be99a3c commit df9658f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion contracts/protocol/libraries/helpers/Errors.sol
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ library Errors {
string public constant NO_DEBT_OF_SELECTED_TYPE = '40'; // 'For repayment of a specific type of debt, the user needs to have debt that type'
string public constant NO_EXPLICIT_AMOUNT_TO_REPAY_ON_BEHALF = '41'; // 'To repay on behalf of a user an explicit amount to repay is needed'
string public constant NO_STABLE_RATE_LOAN_IN_RESERVE = '42'; // 'User does not have a stable rate loan in progress on this reserve'
string public constant NO_VARIABLE_RATE_LOAN_IN_RESERVE = '43'; // 'User does not have a variable rate loan in progress on this reserve'
string public constant NO_VARIABLE_RATE_DEBT = '43'; // 'User does not have variable rate debt in progress on this reserve'
string public constant UNDERLYING_BALANCE_ZERO = '44'; // 'The underlying balance needs to be greater than 0'
string public constant INTEREST_RATE_REBALANCE_CONDITIONS_NOT_MET = '45'; // 'Interest rate rebalance conditions were not met'
string public constant HEALTH_FACTOR_NOT_BELOW_THRESHOLD = '46'; // 'Health factor is not below the threshold'
Expand Down
2 changes: 1 addition & 1 deletion contracts/protocol/libraries/logic/ValidationLogic.sol
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ library ValidationLogic {
if (currentRateMode == DataTypes.InterestRateMode.STABLE) {
require(stableDebt > 0, Errors.NO_STABLE_RATE_LOAN_IN_RESERVE);
} else if (currentRateMode == DataTypes.InterestRateMode.VARIABLE) {
require(variableDebt > 0, Errors.NO_VARIABLE_RATE_LOAN_IN_RESERVE);
require(variableDebt > 0, Errors.NO_VARIABLE_RATE_DEBT);
/**
* user wants to swap to stable, before swapping we need to ensure that
* 1. stable borrow rate is enabled on the reserve
Expand Down
2 changes: 1 addition & 1 deletion helpers/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export enum ProtocolErrors {
NO_DEBT_OF_SELECTED_TYPE = '40', // 'For repayment of a specific type of debt, the user needs to have debt that type'
NO_EXPLICIT_AMOUNT_TO_REPAY_ON_BEHALF = '41', // 'To repay on behalf of a user an explicit amount to repay is needed'
NO_STABLE_RATE_LOAN_IN_RESERVE = '42', // 'User does not have a stable rate loan in progress on this reserve'
NO_VARIABLE_RATE_LOAN_IN_RESERVE = '43', // 'User does not have a variable rate loan in progress on this reserve'
NO_VARIABLE_RATE_DEBT = '43', // 'User does not have a variable rate loan in progress on this reserve'
UNDERLYING_BALANCE_ZERO = '44', // 'The underlying balance needs to be greater than 0'
INTEREST_RATE_REBALANCE_CONDITIONS_NOT_MET = '45', // 'Interest rate rebalance conditions were not met'
HEALTH_FACTOR_NOT_BELOW_THRESHOLD = '46', // 'Health factor is not below the threshold'
Expand Down

0 comments on commit df9658f

Please sign in to comment.