From 1a5517d28b531d673e6ac81e59b552d1280e7d7e Mon Sep 17 00:00:00 2001 From: Lasse Herskind Date: Fri, 25 Feb 2022 14:51:09 +0000 Subject: [PATCH] fix: Improve consistency of function naming of CalldataLogic --- .../protocol/libraries/logic/CalldataLogic.sol | 15 +++++++-------- contracts/protocol/pool/L2Pool.sol | 8 ++++---- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/contracts/protocol/libraries/logic/CalldataLogic.sol b/contracts/protocol/libraries/logic/CalldataLogic.sol index db0cd6f8d..5ef53e030 100644 --- a/contracts/protocol/libraries/logic/CalldataLogic.sol +++ b/contracts/protocol/libraries/logic/CalldataLogic.sol @@ -211,11 +211,10 @@ library CalldataLogic { * @return The address of the underlying reserve * @return The interest rate mode, 1 for stable 2 for variable debt */ - function decodeSwapBorrowRateMode(mapping(uint256 => address) storage reservesList, bytes32 args) - internal - view - returns (address, uint256) - { + function decodeSwapBorrowRateModeParams( + mapping(uint256 => address) storage reservesList, + bytes32 args + ) internal view returns (address, uint256) { uint16 assetId; uint256 interestRateMode; @@ -234,7 +233,7 @@ library CalldataLogic { * @return The address of the underlying reserve * @return The address of the user to rebalance */ - function decodeRebalanceStableBorrowRate( + function decodeRebalanceStableBorrowRateParams( mapping(uint256 => address) storage reservesList, bytes32 args ) internal view returns (address, address) { @@ -254,7 +253,7 @@ library CalldataLogic { * @return The address of the underlying reserve * @return True if to set using as collateral, false otherwise */ - function decodeSetUserUseReserveAsCollateral( + function decodeSetUserUseReserveAsCollateralParams( mapping(uint256 => address) storage reservesList, bytes32 args ) internal view returns (address, bool) { @@ -278,7 +277,7 @@ library CalldataLogic { * @return The amount of debt to cover * @return True if receiving aTokens, false otherwise */ - function decodeLiquidationCall( + function decodeLiquidationCallParams( mapping(uint256 => address) storage reservesList, bytes32 args1, bytes32 args2 diff --git a/contracts/protocol/pool/L2Pool.sol b/contracts/protocol/pool/L2Pool.sol index 4c302a211..0e2b5a1ce 100644 --- a/contracts/protocol/pool/L2Pool.sol +++ b/contracts/protocol/pool/L2Pool.sol @@ -96,7 +96,7 @@ contract L2Pool is Pool, IL2Pool { /// @inheritdoc IL2Pool function swapBorrowRateMode(bytes32 args) external override { - (address asset, uint256 interestRateMode) = CalldataLogic.decodeSwapBorrowRateMode( + (address asset, uint256 interestRateMode) = CalldataLogic.decodeSwapBorrowRateModeParams( _reservesList, args ); @@ -105,7 +105,7 @@ contract L2Pool is Pool, IL2Pool { /// @inheritdoc IL2Pool function rebalanceStableBorrowRate(bytes32 args) external override { - (address asset, address user) = CalldataLogic.decodeRebalanceStableBorrowRate( + (address asset, address user) = CalldataLogic.decodeRebalanceStableBorrowRateParams( _reservesList, args ); @@ -114,7 +114,7 @@ contract L2Pool is Pool, IL2Pool { /// @inheritdoc IL2Pool function setUserUseReserveAsCollateral(bytes32 args) external override { - (address asset, bool useAsCollateral) = CalldataLogic.decodeSetUserUseReserveAsCollateral( + (address asset, bool useAsCollateral) = CalldataLogic.decodeSetUserUseReserveAsCollateralParams( _reservesList, args ); @@ -129,7 +129,7 @@ contract L2Pool is Pool, IL2Pool { address user, uint256 debtToCover, bool receiveAToken - ) = CalldataLogic.decodeLiquidationCall(_reservesList, args1, args2); + ) = CalldataLogic.decodeLiquidationCallParams(_reservesList, args1, args2); liquidationCall(collateralAsset, debtAsset, user, debtToCover, receiveAToken); } }