diff --git a/__tests__/identityKey.test.ts b/__tests__/identityKey.test.ts index 4e5ba18..2aedca1 100644 --- a/__tests__/identityKey.test.ts +++ b/__tests__/identityKey.test.ts @@ -54,9 +54,6 @@ describe("IdentityKey", () => { // The polkadot cipher shouldn't be affected. expect(IdentityKey.getChainCipher(identityKey, polkadotChainId, "polkadot")).toBe(polkadotCipher); - - // Cannot update a cipher of a chain that does not exist. - expect(() => IdentityKey.updateCipher(identityKey, 42, "polkadot")).toThrow("Cannot find chainId"); }); test("Encryption and decryption works", () => { diff --git a/src/components/Modals/ShareIdentity/index.tsx b/src/components/Modals/ShareIdentity/index.tsx index 4d06b0e..7d7b1e4 100644 --- a/src/components/Modals/ShareIdentity/index.tsx +++ b/src/components/Modals/ShareIdentity/index.tsx @@ -47,7 +47,7 @@ export const ShareIdentityModal = ({ setChains(result); } getChains(); - }, []); + }, [getAllChains, identityNo]); useEffect(() => { if (identityNo === null) return; @@ -78,7 +78,7 @@ export const ShareIdentityModal = ({ } catch (e: any) { toastError(`Failed to get the identity key. Error: ${e.message}`); } - }, [checks, identityNo, chains, sharedKey]); + }, [checks, identityNo, chains, sharedKey, toastError]); useEffect(() => setChecks({}), [open]); diff --git a/src/contexts/RelayApi/index.tsx b/src/contexts/RelayApi/index.tsx index 6f414aa..888f37f 100644 --- a/src/contexts/RelayApi/index.tsx +++ b/src/contexts/RelayApi/index.tsx @@ -72,13 +72,15 @@ const defaultValue = { type Relay = { relay: "polkadot" | "kusama", - setRelay(value: string): void + // eslint-disable-next-line @typescript-eslint/no-unused-vars + setRelay(_value: string): void } const DEFAULT_RELAY = "kusama"; const RelayContext = React.createContext( - { relay: "polkadot", setRelay: (_: string) => { } } as Relay + // eslint-disable-next-line @typescript-eslint/no-empty-function, @typescript-eslint/no-unused-vars + { relay: "polkadot", setRelay: (_value: string) => { } } as Relay ); const RelayContextProvider = (props: any) => { @@ -128,4 +130,4 @@ const RelayApiContextProvider = (props: any) => { const useRelayApi = () => useContext(RelayApiContext); -export { RelayApiContextProvider, RelayContextProvider, useRelay,useRelayApi }; +export { RelayApiContextProvider, RelayContextProvider, useRelay, useRelayApi }; diff --git a/src/pages/transfer.tsx b/src/pages/transfer.tsx index ea7e477..b65b84c 100644 --- a/src/pages/transfer.tsx +++ b/src/pages/transfer.tsx @@ -30,7 +30,7 @@ import { getTeleportableAssets } from '@/utils/xcmTransfer/teleportableRoutes'; import { Fungible } from '@/utils/xcmTransfer/types'; import { chainsSupportingXcmExecute } from '@/consts'; -import { RelayContextProvider, useRelay, useRelayApi } from '@/contexts/RelayApi'; +import { useRelay, useRelayApi } from '@/contexts/RelayApi'; import { useToast } from '@/contexts/Toast'; import { useIdentity } from '@/contracts'; import { useAddressBook } from '@/contracts/addressbook/context'; @@ -102,7 +102,6 @@ const TransferPage = () => { } } else { const chaindata = new Chaindata(); - console.log(relay); const chain = await chaindata.getChain(sourceChainId, relay); const _assets = []; @@ -110,7 +109,6 @@ const TransferPage = () => { const allTokens = (await chaindata.getTokens((chain.id === "kusama" || chain.id === "polkadot") ? null : relay)); const tokens = allTokens.filter((token) => { const prefix = `${chain.id}-${token.data.type}`; - console.log(`${chain.id}-${token.data.type}`); const isPartOfSourceChain = token.data.id.startsWith(prefix); return isPartOfSourceChain; }); @@ -136,7 +134,7 @@ const TransferPage = () => { } setLoadingAssets(false); - }, [sourceChainId, destChainId, relayApi, relay]); + }, [sourceChainId, destChainId, chains]); useEffect(() => { loadAssets(); @@ -515,13 +513,4 @@ const TransferPage = () => { ); }; - -const TransferPageWrapped = () => { - return ( - - - - ) -} - -export default TransferPageWrapped; +export default TransferPage;