refactor: changed the order of requirements in validateDropReserve for easier testing

This commit is contained in:
Hadrien Charlanes 2021-06-07 09:49:51 +02:00
parent 68b7384146
commit 46d14e9124

View File

@ -483,7 +483,6 @@ library ValidationLogic {
* @param reserve The reserve object
**/
function validateDropReserve(DataTypes.ReserveData storage reserve) external view {
require(IERC20(reserve.aTokenAddress).totalSupply() == 0, Errors.RL_ATOKEN_SUPPLY_NOT_ZERO);
require(
IERC20(reserve.stableDebtTokenAddress).totalSupply() == 0,
Errors.RL_STABLE_DEBT_NOT_ZERO
@ -492,5 +491,6 @@ library ValidationLogic {
IERC20(reserve.variableDebtTokenAddress).totalSupply() == 0,
Errors.RL_VARIABLE_DEBT_SUPPLY_NOT_ZERO
);
require(IERC20(reserve.aTokenAddress).totalSupply() == 0, Errors.RL_ATOKEN_SUPPLY_NOT_ZERO);
}
}