diff --git a/Dockerfile.dev b/Dockerfile.dev index 4a9a42290..14c01d026 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -15,7 +15,7 @@ ENV PYTHON=/usr/bin/python3 ENV NODE_OPTIONS=--max_old_space_size=3072 # Copy package files and install node modules -COPY package*.json yarn.lock ./ +COPY package*.json ./ RUN npm install -g node-gyp RUN yarn install --ignore-scripts --frozen-lockfile RUN yarn upgrade @keep-network/coverage-pools@sepolia \ diff --git a/src/components/Modal/MapOperatorToStakingProviderModal/MapOperatorToStakingProviderForm.tsx b/src/components/Modal/MapOperatorToStakingProviderModal/MapOperatorToStakingProviderForm.tsx index 30cd35388..9ca5fd9d4 100644 --- a/src/components/Modal/MapOperatorToStakingProviderModal/MapOperatorToStakingProviderForm.tsx +++ b/src/components/Modal/MapOperatorToStakingProviderModal/MapOperatorToStakingProviderForm.tsx @@ -32,7 +32,7 @@ const validateInputtedOperatorAddress = async ( operator: string ) => Promise, mappedOperatorTbtc: string, - mappedOperatorRandomBeacon: string, + mappedOperatorRandomBeacon: string ): Promise => { let validationMsg: string | undefined = "" @@ -102,13 +102,21 @@ const MapOperatorToStakingProviderForm = withFormik< } = props const errors: FormikErrors = {} + console.log("tbtc", mappedOperatorTbtc) + console.log("random beacon", mappedOperatorRandomBeacon) + console.log("taco", mappedOperatorTaco) + errors.operator = validateETHAddress(values.operator) - if (!errors.operator && mappedOperatorTbtc !== undefined && mappedOperatorRandomBeacon !== undefined) { + if ( + !errors.operator && + mappedOperatorTbtc !== undefined && + mappedOperatorRandomBeacon !== undefined + ) { errors.operator = await validateInputtedOperatorAddress( values.operator, checkIfOperatorIsMappedToAnotherStakingProvider, mappedOperatorTbtc, - mappedOperatorRandomBeacon, + mappedOperatorRandomBeacon ) } if (!errors.operator && mappedOperatorTaco !== undefined) { @@ -118,10 +126,14 @@ const MapOperatorToStakingProviderForm = withFormik< await checkIfOperatorIsMappedToAnotherStakingProvider(values.operator) validationMsg = undefined if (isOperatorMappedToAnotherStakingProvider) { - validationMsg = "Operator is already mapped to another staking provider." + validationMsg = + "Operator is already mapped to another staking provider." } } catch (error) { - console.error("`MapOperatorToStakingProviderForm` validation error.", error) + console.error( + "`MapOperatorToStakingProviderForm` validation error.", + error + ) validationMsg = (error as Error)?.message } errors.operator = validationMsg diff --git a/src/components/Modal/MapOperatorToStakingProviderModal/index.tsx b/src/components/Modal/MapOperatorToStakingProviderModal/index.tsx index d2a619a37..b572e66cd 100644 --- a/src/components/Modal/MapOperatorToStakingProviderModal/index.tsx +++ b/src/components/Modal/MapOperatorToStakingProviderModal/index.tsx @@ -43,7 +43,9 @@ const MapOperatorToStakingProviderModal: FC< BaseModalProps & MapOperatorToStakingProviderModalProps > = () => { const { account } = useWeb3React() - const formRef = + const formRefTbtc = + useRef>(null) + const formRefTaco = useRef>(null) const { closeModal, openModal } = useModal() const threshold = useThreshold() @@ -88,6 +90,16 @@ const MapOperatorToStakingProviderModal: FC< ) } + const handleSubmit = async () => { + if (formRefTbtc.current) { + await formRefTbtc.current.handleSubmit() + } + + if (formRefTaco.current) { + await formRefTaco.current.handleSubmit() + } + } + return ( <> Operator Address Mapping @@ -132,7 +144,7 @@ const MapOperatorToStakingProviderModal: FC< )} Taco (requires 1tx) Dismiss - diff --git a/src/enums/env.ts b/src/enums/env.ts index 0c75a4c52..856e5ad87 100644 --- a/src/enums/env.ts +++ b/src/enums/env.ts @@ -20,7 +20,7 @@ const envVariables = [ "DAPP_DEVELOPMENT_TESTNET_CONTRACTS", ] as const -export type EnvVariableKey = typeof envVariables[number] +export type EnvVariableKey = (typeof envVariables)[number] // In order not to break the previous enum API, so using eg. // `EnvVariable.ETH_HOSTNAME_HTTP` is still valid. diff --git a/src/hooks/useFetchExternalPoolData.ts b/src/hooks/useFetchExternalPoolData.ts index 37e589c8f..8b326621b 100644 --- a/src/hooks/useFetchExternalPoolData.ts +++ b/src/hooks/useFetchExternalPoolData.ts @@ -16,7 +16,7 @@ const pools = { } as const type ExternalPool = keyof typeof pools -type ExternalPoolId = typeof pools[T][number] +type ExternalPoolId = (typeof pools)[T][number] const fetchCurvePool: ( poolId: ExternalPoolId<"curve"> diff --git a/src/static/icons/tokenIconMap.ts b/src/static/icons/tokenIconMap.ts index 3e0c4d042..c725551a0 100644 --- a/src/static/icons/tokenIconMap.ts +++ b/src/static/icons/tokenIconMap.ts @@ -9,7 +9,7 @@ const tokenIcons = [ "T_CIRCLE_BRAND", ] as const -export type TokenIcon = typeof tokenIcons[number] +export type TokenIcon = (typeof tokenIcons)[number] const tokenIconMap: Record = { KEEP_CIRCLE_BRAND: KeepCircleBrand,