mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
Save some extra codesize.
This commit is contained in:
parent
80d09848b3
commit
38bec0b8de
|
@ -993,9 +993,7 @@ contract LendingPool is VersionedInitializable, ILendingPool {
|
||||||
address user,
|
address user,
|
||||||
uint256 amount
|
uint256 amount
|
||||||
) external override view returns (bool) {
|
) external override view returns (bool) {
|
||||||
if (_paused) {
|
whenNotPaused();
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return
|
return
|
||||||
GenericLogic.balanceDecreaseAllowed(
|
GenericLogic.balanceDecreaseAllowed(
|
||||||
asset,
|
asset,
|
||||||
|
|
|
@ -585,6 +585,7 @@ contract LendingPoolConfigurator is VersionedInitializable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dev pauses or unpauses LendingPool actions
|
* @dev pauses or unpauses LendingPool actions
|
||||||
|
* @param val the boolean value to set the current pause state of LendingPool
|
||||||
**/
|
**/
|
||||||
function setPoolPause(bool val) external onlyLendingPoolManager {
|
function setPoolPause(bool val) external onlyLendingPoolManager {
|
||||||
pool.setPause(val);
|
pool.setPause(val);
|
||||||
|
|
|
@ -3,7 +3,6 @@ pragma solidity ^0.6.8;
|
||||||
|
|
||||||
import {SafeMath} from '@openzeppelin/contracts/math/SafeMath.sol';
|
import {SafeMath} from '@openzeppelin/contracts/math/SafeMath.sol';
|
||||||
import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol';
|
import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol';
|
||||||
import {Pausable} from '@openzeppelin/contracts/utils/Pausable.sol';
|
|
||||||
import {
|
import {
|
||||||
VersionedInitializable
|
VersionedInitializable
|
||||||
} from '../libraries/openzeppelin-upgradeability/VersionedInitializable.sol';
|
} from '../libraries/openzeppelin-upgradeability/VersionedInitializable.sol';
|
||||||
|
|
|
@ -44,7 +44,7 @@ makeSuite('Pausable Pool', (testEnv: TestEnv) => {
|
||||||
// User 0 tries the transfer to User 1
|
// User 0 tries the transfer to User 1
|
||||||
await expect(
|
await expect(
|
||||||
aDai.connect(users[0].signer).transfer(users[1].address, amountDAItoDeposit)
|
aDai.connect(users[0].signer).transfer(users[1].address, amountDAItoDeposit)
|
||||||
).to.revertedWith(TRANSFER_NOT_ALLOWED);
|
).to.revertedWith(IS_PAUSED);
|
||||||
|
|
||||||
const pausedFromBalance = await aDai.balanceOf(users[0].address);
|
const pausedFromBalance = await aDai.balanceOf(users[0].address);
|
||||||
const pausedToBalance = await aDai.balanceOf(users[1].address);
|
const pausedToBalance = await aDai.balanceOf(users[1].address);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user