Skip to content

Commit

Permalink
refactor(configEngine): rename asset to assets for consistency wi…
Browse files Browse the repository at this point in the history
…th other methods (#26)
  • Loading branch information
sakulstra committed Sep 19, 2024
1 parent 4beb9b8 commit f02fcb2
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,10 @@ contract AaveV3ConfigEngine is IAaveV3ConfigEngine {
}

/// @inheritdoc IAaveV3ConfigEngine
function updateAssetEMode(AssetEModeUpdate[] calldata updates) external {
function updateAssetsEMode(AssetEModeUpdate[] calldata updates) external {
EMODE_ENGINE.functionDelegateCall(
abi.encodeWithSelector(
EModeEngine.executeAssetEModeUpdate.selector,
EModeEngine.executeAssetsEModeUpdate.selector,
_getEngineConstants(),
updates
)
Expand Down
8 changes: 4 additions & 4 deletions src/contracts/extensions/v3-config-engine/AaveV3Payload.sol
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ abstract contract AaveV3Payload {
IEngine.BorrowUpdate[] memory borrows = borrowsUpdates();
IEngine.RateStrategyUpdate[] memory rates = rateStrategiesUpdates();
IEngine.PriceFeedUpdate[] memory priceFeeds = priceFeedsUpdates();
IEngine.AssetEModeUpdate[] memory assetEModes = assetEModeUpdates();
IEngine.AssetEModeUpdate[] memory assetsEModes = assetsEModeUpdates();
IEngine.CapsUpdate[] memory caps = capsUpdates();

if (eModeCategories.length != 0) {
Expand Down Expand Up @@ -98,9 +98,9 @@ abstract contract AaveV3Payload {
);
}

if (assetEModes.length != 0) {
if (assetsEModes.length != 0) {
address(CONFIG_ENGINE).functionDelegateCall(
abi.encodeWithSelector(CONFIG_ENGINE.updateAssetEMode.selector, assetEModes)
abi.encodeWithSelector(CONFIG_ENGINE.updateAssetsEMode.selector, assetsEModes)
);
}

Expand Down Expand Up @@ -152,7 +152,7 @@ abstract contract AaveV3Payload {
{}

/// @dev to be defined in the child with a list of assets for which eMode collateral to update
function assetEModeUpdates() public view virtual returns (IEngine.AssetEModeUpdate[] memory) {}
function assetsEModeUpdates() public view virtual returns (IEngine.AssetEModeUpdate[] memory) {}

/// @dev to be defined in the child with a list of set of parameters of rate strategies
function rateStrategiesUpdates()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ interface IAaveV3ConfigEngine {
* @param updates `EModeCollateralUpdate[]` list of declarative updates containing the new parameters
* More information on the documentation of the struct.
*/
function updateAssetEMode(AssetEModeUpdate[] memory updates) external;
function updateAssetsEMode(AssetEModeUpdate[] calldata updates) external;

function DEFAULT_INTEREST_RATE_STRATEGY() external view returns (address);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ library EModeEngine {
using PercentageMath for uint256;
using SafeCast for uint256;

function executeAssetEModeUpdate(
function executeAssetsEModeUpdate(
IEngine.EngineConstants calldata engineConstants,
IEngine.AssetEModeUpdate[] memory updates
) external {
require(updates.length != 0, 'AT_LEAST_ONE_UPDATE_REQUIRED');

_configAssetEMode(engineConstants.poolConfigurator, updates);
_configAssetsEMode(engineConstants.poolConfigurator, updates);
}

function executeEModeCategoriesUpdate(
Expand All @@ -29,7 +29,7 @@ library EModeEngine {
_configEModeCategories(engineConstants.poolConfigurator, engineConstants.pool, updates);
}

function _configAssetEMode(
function _configAssetsEMode(
IPoolConfigurator poolConfigurator,
IEngine.AssetEModeUpdate[] memory updates
) internal {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ contract AaveV3MockAssetEModeUpdate is AaveV3Payload {
ASSET_2_ADDRESS = asset2Address;
}

function assetEModeUpdates() public view override returns (IEngine.AssetEModeUpdate[] memory) {
function assetsEModeUpdates() public view override returns (IEngine.AssetEModeUpdate[] memory) {
IEngine.AssetEModeUpdate[] memory eModeUpdate = new IEngine.AssetEModeUpdate[](2);

eModeUpdate[0] = IEngine.AssetEModeUpdate({
Expand Down

0 comments on commit f02fcb2

Please sign in to comment.