Skip to content

Commit

Permalink
fix: Improve consistency of function naming of CalldataLogic
Browse files Browse the repository at this point in the history
  • Loading branch information
LHerskind committed Feb 25, 2022
1 parent 93f2b85 commit 1a5517d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
15 changes: 7 additions & 8 deletions contracts/protocol/libraries/logic/CalldataLogic.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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) {
Expand All @@ -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) {
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions contracts/protocol/pool/L2Pool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Expand All @@ -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
);
Expand All @@ -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
);
Expand All @@ -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);
}
}

0 comments on commit 1a5517d

Please sign in to comment.