From a3f30f974467056495cd67396187ad6e832c8f28 Mon Sep 17 00:00:00 2001 From: Alice <121383428+Rozengarden@users.noreply.github.com> Date: Mon, 18 Sep 2023 15:27:07 +0000 Subject: [PATCH] Feat/moar generator fix (#298) * Fix for generating collaterals updates * Smoll Fix to Collatupdate generator EModeCategory would be set to KEEP_CURRENT instead of EngineFlags.KEEP_CURRENT --- generator/features/collateralUpdates.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/generator/features/collateralUpdates.ts b/generator/features/collateralUpdates.ts index 4875860a..c20cf65c 100644 --- a/generator/features/collateralUpdates.ts +++ b/generator/features/collateralUpdates.ts @@ -79,26 +79,26 @@ export const collateralUpdates: FeatureModule = { code: { dependencies: [DEPENDENCIES.Assets, DEPENDENCIES.Engine], fn: [ - `function capsUpdates() public pure override returns (IEngine.CapsUpdate[] memory) { + `function collateralsUpdates() public pure override returns (IEngine.CollateralUpdate[] memory) { IEngine.CollateralUpdate[] memory collateralUpdate = new IEngine.CollateralUpdate[](${ cfg[chain].length }); ${cfg[chain] .map( - (cfg, ix) => `capsUpdate[${ix}] = IEngine.CapsUpdate({ + (cfg, ix) => `collateralUpdate[${ix}] = IEngine.CollateralUpdate({ asset: Aave${opt.protocolVersion}${chain}Assets.${cfg.asset}_UNDERLYING, ltv: ${jsPercentToSol(cfg.ltv)}, liqThreshold: ${jsPercentToSol(cfg.liqThreshold)}, liqBonus: ${jsPercentToSol(cfg.liqBonus)}, debtCeiling: ${jsNumberToSol(cfg.debtCeiling)}, liqProtocolFee: ${jsPercentToSol(cfg.liqProtocolFee)}, - eModeCategory: ${cfg.eModeCategory} + eModeCategory: ${(cfg.eModeCategory === ENGINE_FLAGS.KEEP_CURRENT) ? `EngineFlags.KEEP_CURRENT` : cfg.eModeCategory} });` ) .join('\n')} - return capsUpdate; + return collateralUpdate; }`, ], },