mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
test: added requirements in update premium functions of configurator
This commit is contained in:
parent
7e6565fed4
commit
22bbb96261
|
@ -514,6 +514,14 @@ contract LendingPoolConfigurator is VersionedInitializable, ILendingPoolConfigur
|
||||||
override
|
override
|
||||||
onlyPoolAdmin
|
onlyPoolAdmin
|
||||||
{
|
{
|
||||||
|
require(
|
||||||
|
flashloanPremiumTotal < PercentageMath.PERCENTAGE_FACTOR,
|
||||||
|
Errors.LPC_FLASHLOAN_PREMIUM_INVALID
|
||||||
|
);
|
||||||
|
require(
|
||||||
|
flashloanPremiumTotal >= _pool.FLASHLOAN_PREMIUM_TO_PROTOCOL(),
|
||||||
|
Errors.LPC_FLASHLOAN_PREMIUMS_MISMATCH
|
||||||
|
);
|
||||||
_pool.updateFlashloanPremiums(flashloanPremiumTotal, _pool.FLASHLOAN_PREMIUM_TO_PROTOCOL());
|
_pool.updateFlashloanPremiums(flashloanPremiumTotal, _pool.FLASHLOAN_PREMIUM_TO_PROTOCOL());
|
||||||
emit FlashloanPremiumTotalUpdated(flashloanPremiumTotal);
|
emit FlashloanPremiumTotalUpdated(flashloanPremiumTotal);
|
||||||
}
|
}
|
||||||
|
@ -524,6 +532,14 @@ contract LendingPoolConfigurator is VersionedInitializable, ILendingPoolConfigur
|
||||||
override
|
override
|
||||||
onlyPoolAdmin
|
onlyPoolAdmin
|
||||||
{
|
{
|
||||||
|
require(
|
||||||
|
flashloanPremiumToProtocol < PercentageMath.PERCENTAGE_FACTOR,
|
||||||
|
Errors.LPC_FLASHLOAN_PREMIUM_INVALID
|
||||||
|
);
|
||||||
|
require(
|
||||||
|
flashloanPremiumToProtocol <= _pool.FLASHLOAN_PREMIUM_TOTAL(),
|
||||||
|
Errors.LPC_FLASHLOAN_PREMIUMS_MISMATCH
|
||||||
|
);
|
||||||
_pool.updateFlashloanPremiums(_pool.FLASHLOAN_PREMIUM_TOTAL(), flashloanPremiumToProtocol);
|
_pool.updateFlashloanPremiums(_pool.FLASHLOAN_PREMIUM_TOTAL(), flashloanPremiumToProtocol);
|
||||||
emit FlashloanPremiumToProcolUpdated(flashloanPremiumToProtocol);
|
emit FlashloanPremiumToProcolUpdated(flashloanPremiumToProtocol);
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,6 +113,8 @@ library Errors {
|
||||||
string public constant RL_STABLE_DEBT_NOT_ZERO = '89';
|
string public constant RL_STABLE_DEBT_NOT_ZERO = '89';
|
||||||
string public constant RL_VARIABLE_DEBT_SUPPLY_NOT_ZERO = '90';
|
string public constant RL_VARIABLE_DEBT_SUPPLY_NOT_ZERO = '90';
|
||||||
string public constant LP_CALLER_NOT_EOA = '91';
|
string public constant LP_CALLER_NOT_EOA = '91';
|
||||||
|
string public constant LPC_FLASHLOAN_PREMIUMS_MISMATCH = '95';
|
||||||
|
string public constant LPC_FLASHLOAN_PREMIUM_INVALID = '96';
|
||||||
|
|
||||||
enum CollateralManagerErrors {
|
enum CollateralManagerErrors {
|
||||||
NO_ERROR,
|
NO_ERROR,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user