Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: revert some naming changes on engine #26

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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