mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
Merge branch '122-remove-setreservedecimals-from-lendingpoolconfiguration' into 'master'
Resolve "Remove setReserveDecimals() from lendingPoolConfigurator" Closes #122 See merge request aave-tech/protocol-v2!140
This commit is contained in:
commit
ce62734786
|
@ -554,21 +554,6 @@ contract LendingPoolConfigurator is VersionedInitializable {
|
|||
emit ReserveLiquidationBonusChanged(asset, bonus);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev updates the reserve decimals
|
||||
* @param asset the address of the reserve
|
||||
* @param decimals the new number of decimals
|
||||
**/
|
||||
function setReserveDecimals(address asset, uint256 decimals) external onlyPoolAdmin {
|
||||
ReserveConfiguration.Map memory currentConfig = pool.getConfiguration(asset);
|
||||
|
||||
currentConfig.setDecimals(decimals);
|
||||
|
||||
pool.setConfiguration(asset, currentConfig.data);
|
||||
|
||||
emit ReserveDecimalsChanged(asset, decimals);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev sets the interest rate strategy of a reserve
|
||||
* @param asset the address of the reserve
|
||||
|
|
|
@ -48,16 +48,6 @@ makeSuite('LendingPoolConfigurator', (testEnv: TestEnv) => {
|
|||
).to.be.revertedWith(RC_INVALID_LIQ_BONUS);
|
||||
});
|
||||
|
||||
it('Reverts trying to set an invalid reserve decimals', async () => {
|
||||
const {configurator, weth} = testEnv;
|
||||
|
||||
const invalidDecimals = 256;
|
||||
|
||||
await expect(configurator.setReserveDecimals(weth.address, invalidDecimals)).to.be.revertedWith(
|
||||
RC_INVALID_DECIMALS
|
||||
);
|
||||
});
|
||||
|
||||
it('Reverts trying to set an invalid reserve factor', async () => {
|
||||
const {configurator, weth} = testEnv;
|
||||
|
||||
|
@ -508,14 +498,6 @@ makeSuite('LendingPoolConfigurator', (testEnv: TestEnv) => {
|
|||
).to.be.revertedWith(CALLER_NOT_POOL_ADMIN);
|
||||
});
|
||||
|
||||
it('Check the onlyAaveAdmin on setReserveDecimals', async () => {
|
||||
const {configurator, users, weth} = testEnv;
|
||||
await expect(
|
||||
configurator.connect(users[2].signer).setReserveDecimals(weth.address, '80'),
|
||||
CALLER_NOT_POOL_ADMIN
|
||||
).to.be.revertedWith(CALLER_NOT_POOL_ADMIN);
|
||||
});
|
||||
|
||||
it('Check the onlyAaveAdmin on setLiquidationBonus', async () => {
|
||||
const {configurator, users, weth} = testEnv;
|
||||
await expect(
|
||||
|
|
Loading…
Reference in New Issue
Block a user