diff --git a/generator/features/eModesUpdates.ts b/generator/features/eModesUpdates.ts index 22a1ea618..9ecfe3083 100644 --- a/generator/features/eModesUpdates.ts +++ b/generator/features/eModesUpdates.ts @@ -3,28 +3,32 @@ import {addressInput, eModesSelect, percentInput, stringInput} from '../prompts' import {EModeCategoryUpdate} from './types'; import {confirm} from '@inquirer/prompts'; -async function fetchEmodeCategoryUpdate(disableKeepCurrent?: T, eModeCategory?: string): Promise { +async function fetchEmodeCategoryUpdate( + disableKeepCurrent?: T, + eModeCategory?: string +): Promise { return { - eModeCategory: eModeCategory ?? await stringInput({message: 'eModeCategory', disableKeepCurrent}), + eModeCategory: + eModeCategory ?? (await stringInput({message: 'eModeCategory', disableKeepCurrent})), ltv: await percentInput({ message: 'ltv', - disableKeepCurrent + disableKeepCurrent, }), liqThreshold: await percentInput({ message: 'liqThreshold', - disableKeepCurrent + disableKeepCurrent, }), liqBonus: await percentInput({ message: 'liqBonus', - disableKeepCurrent + disableKeepCurrent, }), priceSource: await addressInput({ message: 'Price Source', - disableKeepCurrent + disableKeepCurrent, }), label: await stringInput({ message: 'label', - disableKeepCurrent + disableKeepCurrent, }), }; } @@ -32,7 +36,10 @@ async function fetchEmodeCategoryUpdate(disableKeepCurrent?: async function subCli(pool: PoolIdentifier) { const answers: EmodeUpdates = []; - const shouldAddNewCategory = await confirm({message: 'Do you wish to add a new emode category?', default: false}); + const shouldAddNewCategory = await confirm({ + message: 'Do you wish to add a new emode category?', + default: false, + }); if (shouldAddNewCategory) { let more: boolean = true; while (more) { @@ -41,7 +48,10 @@ async function subCli(pool: PoolIdentifier) { } } - const shouldAmendCategory = await confirm({message: 'Do you wish to amend existing emode category?', default: false}); + const shouldAmendCategory = await confirm({ + message: 'Do you wish to amend existing emode category?', + default: false, + }); if (shouldAmendCategory) { const eModeCategories = await eModesSelect({ message: 'Select the eModes you want to amend', @@ -83,7 +93,9 @@ export const eModeUpdates: FeatureModule = { liqThreshold: ${cfg.liqThreshold}, liqBonus: ${cfg.liqBonus}, priceSource: ${cfg.priceSource}, - label: ${cfg.label == 'EngineFlags.KEEP_CURRENT_STRING' ? cfg.label : `"${cfg.label}"`} + label: ${ + cfg.label == 'EngineFlags.KEEP_CURRENT_STRING' ? cfg.label : `"${cfg.label}"` + } });` ) .join('\n')} diff --git a/generator/prompts.ts b/generator/prompts.ts index 9f6d6705d..9fa25ce3e 100644 --- a/generator/prompts.ts +++ b/generator/prompts.ts @@ -54,13 +54,13 @@ function translateJsAddressToSol(value: string) { function translateJsBoolToSol(value: string) { switch (value) { case ENGINE_FLAGS.ENABLED: - return `EngineFlags.ENABLED` + return `EngineFlags.ENABLED`; case ENGINE_FLAGS.DISABLED: - return `EngineFlags.DISABLED` + return `EngineFlags.DISABLED`; case ENGINE_FLAGS.KEEP_CURRENT: - return `EngineFlags.KEEP_CURRENT` + return `EngineFlags.KEEP_CURRENT`; default: - return value + return value; } }