Skip to content

Commit

Permalink
fix: Clean code style of mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelmtzinf committed Dec 3, 2021
1 parent 6fe84b6 commit 60a03e3
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions contracts/mocks/helpers/MockPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ contract MockPool {
_addressesProvider = provider;
}

function addReserveToReservesList(address _reserve) external {
_reserveList.push(_reserve);
function addReserveToReservesList(address reserve) external {
_reserveList.push(reserve);
}

function getReservesList() external view returns (address[] memory) {
Expand Down
6 changes: 3 additions & 3 deletions contracts/mocks/oracle/CLAggregators/MockAggregator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ contract MockAggregator {

event AnswerUpdated(int256 indexed current, uint256 indexed roundId, uint256 timestamp);

constructor(int256 _initialAnswer) {
_latestAnswer = _initialAnswer;
emit AnswerUpdated(_initialAnswer, 0, block.timestamp);
constructor(int256 initialAnswer) {
_latestAnswer = initialAnswer;
emit AnswerUpdated(initialAnswer, 0, block.timestamp);
}

function latestAnswer() external view returns (int256) {
Expand Down
20 changes: 10 additions & 10 deletions contracts/mocks/oracle/PriceOracle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@ contract PriceOracle is IPriceOracle {
mapping(address => uint256) prices;
uint256 ethPriceUsd;

event AssetPriceUpdated(address _asset, uint256 _price, uint256 timestamp);
event EthPriceUpdated(uint256 _price, uint256 timestamp);
event AssetPriceUpdated(address asset, uint256 price, uint256 timestamp);
event EthPriceUpdated(uint256 price, uint256 timestamp);

function getAssetPrice(address _asset) external view override returns (uint256) {
return prices[_asset];
function getAssetPrice(address asset) external view override returns (uint256) {
return prices[asset];
}

function setAssetPrice(address _asset, uint256 _price) external override {
prices[_asset] = _price;
emit AssetPriceUpdated(_asset, _price, block.timestamp);
function setAssetPrice(address asset, uint256 price) external override {
prices[asset] = price;
emit AssetPriceUpdated(asset, price, block.timestamp);
}

function getEthUsdPrice() external view returns (uint256) {
return ethPriceUsd;
}

function setEthUsdPrice(uint256 _price) external {
ethPriceUsd = _price;
emit EthPriceUpdated(_price, block.timestamp);
function setEthUsdPrice(uint256 price) external {
ethPriceUsd = price;
emit EthPriceUpdated(price, block.timestamp);
}
}
4 changes: 2 additions & 2 deletions contracts/mocks/tests/MockReserveInterestRateStrategy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {DataTypes} from '../../protocol/libraries/types/DataTypes.sol';
contract MockReserveInterestRateStrategy is IReserveInterestRateStrategy {
uint256 public immutable OPTIMAL_UTILIZATION_RATE;
uint256 public immutable EXCESS_UTILIZATION_RATE;
IPoolAddressesProvider public immutable addressesProvider;
IPoolAddressesProvider public immutable ADDRESSES_PROVIDER;
uint256 internal immutable _baseVariableBorrowRate;
uint256 internal immutable _variableRateSlope1;
uint256 internal immutable _variableRateSlope2;
Expand All @@ -31,7 +31,7 @@ contract MockReserveInterestRateStrategy is IReserveInterestRateStrategy {
) {
OPTIMAL_UTILIZATION_RATE = optimalUtilizationRate;
EXCESS_UTILIZATION_RATE = WadRayMath.RAY - optimalUtilizationRate;
addressesProvider = provider;
ADDRESSES_PROVIDER = provider;
_baseVariableBorrowRate = baseVariableBorrowRate;
_variableRateSlope1 = variableRateSlope1;
_variableRateSlope2 = variableRateSlope2;
Expand Down

0 comments on commit 60a03e3

Please sign in to comment.