diff --git a/src/contexts/NetworkContext.tsx b/src/contexts/NetworkContext.tsx index 8c7b79d..4b18b87 100644 --- a/src/contexts/NetworkContext.tsx +++ b/src/contexts/NetworkContext.tsx @@ -215,7 +215,7 @@ const NetworkContextProvider = ({ children }: NetworkContextProps) => { const descriptor = descriptorName[network] const typedApi = client.getTypedApi(descriptor) - const descriptorPeople = descriptorPeopleName[peopleNetwork!] + const descriptorPeople = descriptorPeopleName[peopleNetwork] const typedPeopleApi = peopleClient.getTypedApi(descriptorPeople) setClient(client) diff --git a/src/lib/types.ts b/src/lib/types.ts index 748d84a..58ad240 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -43,10 +43,6 @@ export type ExplorerType = { event?: string } -export type PeopleNetworkType = { - nodes: NameUrl[] -} - export type NetworkType = { name: string specName: string diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 3ec3eaa..0164138 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -1,21 +1,13 @@ import { type ClassValue, clsx } from 'clsx' import { House } from 'lucide-react' import networks from '@/assets/networks.json' -import peopleNetworks from '@/assets/peopleNetworks.json' import { twMerge } from 'tailwind-merge' -import type { NetworkType, PeopleNetworkType, RouterType, Vote } from './types' -import { - ApiType, - NetworksFromConfig, - SupportedPeopleNetworkNames, -} from '@/contexts/NetworkContext' +import type { NetworkType, RouterType, Vote } from './types' +import { ApiType, NetworksFromConfig } from '@/contexts/NetworkContext' import { DEFAULT_TIME, lockPeriod, ONE_DAY, THRESHOLD } from './constants' import { bnMin } from './bnMin' -const randomFromInterval = (min: number, max: number) => - Math.floor(Math.random() * (max - min + 1) + min) - export const cn = (...inputs: ClassValue[]) => { return twMerge(clsx(inputs)) } @@ -32,16 +24,6 @@ export const getChainInformation = (networkName: NetworksFromConfig) => { } } -export const getPeopleChainInformation = ( - peopleName: SupportedPeopleNetworkNames, -) => { - const peopleNetwork: PeopleNetworkType = peopleNetworks[peopleName] - const pick = randomFromInterval(0, peopleNetwork.nodes.length - 1) - return { - wsEndpoint: peopleNetwork.nodes[pick].url, - } -} - export const getVoteFromNumber = (input: number): Vote => ({ aye: Boolean(input & 0b1000_0000), conviction: input & 0b0111_1111, diff --git a/src/pages/Delegate/index.tsx b/src/pages/Delegate/index.tsx index 4070ff6..5a1b6f1 100644 --- a/src/pages/Delegate/index.tsx +++ b/src/pages/Delegate/index.tsx @@ -101,8 +101,6 @@ export const Delegate = () => { setAmountVisible('0') }, [api]) - if (!delegate || !api) return
No delegate found
- const onChangeAmount = ( e: React.ChangeEvent, decimals: number,