diff --git a/apps/guardian-ui/src/components/SetConfiguration.tsx b/apps/guardian-ui/src/components/SetConfiguration.tsx index 79f363c46..6b85bc02e 100644 --- a/apps/guardian-ui/src/components/SetConfiguration.tsx +++ b/apps/guardian-ui/src/components/SetConfiguration.tsx @@ -31,7 +31,6 @@ import { formatApiErrorMessage, getModuleParamsFromConfig, applyConfigGenModuleParams, - removeConfigGenModuleConsensusParams, } from '../utils/api'; import { isValidMeta, isValidNumber } from '../utils/validators'; import { NumberFormControl } from './NumberFormControl'; @@ -210,7 +209,7 @@ export const SetConfiguration: React.FC = ({ next }: Props) => { configs: { hostServerUrl, meta: {}, - modules: removeConfigGenModuleConsensusParams(moduleConfigs), + modules: moduleConfigs, }, }); } @@ -250,7 +249,9 @@ export const SetConfiguration: React.FC = ({ next }: Props) => { 0} + isInvalid={ + !!password && password !== confirmPassword && password.length > 0 + } > {t('set-config.confirm-password')} = ({ next }: Props) => { onChange={(ev) => setConfirmPassword(ev.currentTarget.value)} /> - {password !== confirmPassword && + {!!password && + password !== confirmPassword && password.length > 0 && t('set-config.error-password-mismatch')} diff --git a/apps/guardian-ui/src/setup/SetupContext.tsx b/apps/guardian-ui/src/setup/SetupContext.tsx index bf3d6dc1a..72c760345 100644 --- a/apps/guardian-ui/src/setup/SetupContext.tsx +++ b/apps/guardian-ui/src/setup/SetupContext.tsx @@ -285,6 +285,7 @@ export const SetupContextProvider: React.FC = ({ // Followers set their own connection name, and hosts server URL to connect to. await api.setConfigGenConnections(myName, configs.hostServerUrl); + console.log('configs', configs); // Followers submit ONLY their local config gen params. await api.setConfigGenParams(configs); diff --git a/apps/guardian-ui/src/utils/api.ts b/apps/guardian-ui/src/utils/api.ts index 2d3f3afdb..50526b549 100644 --- a/apps/guardian-ui/src/utils/api.ts +++ b/apps/guardian-ui/src/utils/api.ts @@ -46,19 +46,6 @@ export function applyConfigGenModuleParams( return newModuleParams; } -/** - * Filter out consensus module config gen params to only have local ones. - */ -export function removeConfigGenModuleConsensusParams( - moduleParams: ConfigGenParams['modules'] -): ConfigGenParams['modules'] { - const newParams = { ...moduleParams }; - Object.values(newParams).forEach((module) => { - module[1] = { local: module[1].local }; - }); - return newParams; -} - /** * Given a config, filter out all non-default modules */ diff --git a/packages/types/src/modules.ts b/packages/types/src/modules.ts index b52f64c26..b9aa1d745 100644 --- a/packages/types/src/modules.ts +++ b/packages/types/src/modules.ts @@ -57,34 +57,31 @@ export type ModuleConfig = { export type LnModuleParams = [ ModuleKind.Ln, { - consensus?: object; - local?: object; + consensus: object; + local: object; } ]; export type MintModuleParams = [ ModuleKind.Mint, { - consensus?: { mint_amounts: number[] }; - local?: object; + consensus: { mint_amounts: number[] }; + local: object; } ]; export type WalletModuleParams = [ ModuleKind.Wallet, { - consensus?: { + consensus: { finality_delay: number; network: Network; client_default_bitcoin_rpc: BitcoinRpc; }; - local?: { + local: { bitcoin_rpc: BitcoinRpc; }; } ]; -export type OtherModuleParams = [ - string, - { consensus?: object; local?: object } -]; +export type OtherModuleParams = [string, { consensus: object; local: object }]; export type AnyModuleParams = | LnModuleParams | MintModuleParams