diff --git a/apps/namadillo/src/registry/namadaAsset.ts b/apps/namadillo/src/registry/namadaAsset.ts index 86043e7b2..057cf6785 100644 --- a/apps/namadillo/src/registry/namadaAsset.ts +++ b/apps/namadillo/src/registry/namadaAsset.ts @@ -1,19 +1,21 @@ import { Asset } from "@chain-registry/types"; -import { localnetConfigAtom } from "atoms/integrations"; +import { localnetConfigAtom } from "atoms/integrations/atoms"; import { getDefaultStore } from "jotai"; import namadaShieldedSvg from "./assets/namada-shielded.svg"; +const ADDRESS = "tnam1qxp7u2vmlgcrpn9j0ml7hrtr79g2w2fdesteh7tu"; + // We can't return "satisfies Asset" from fn // eslint-disable-next-line @typescript-eslint/explicit-function-return-type export const namadaAsset = () => { const store = getDefaultStore(); const config = store.get(localnetConfigAtom); - const localNamAddress = config.data?.tokenAddress; + const address = config.data?.tokenAddress || ADDRESS; return { name: "Namada", base: "unam", - address: localNamAddress || "tnam1qxp7u2vmlgcrpn9j0ml7hrtr79g2w2fdesteh7tu", + address, display: "nam", symbol: "NAM", denom_units: [ diff --git a/apps/namadillo/src/setupTests.ts b/apps/namadillo/src/setupTests.ts index 70f3a0e47..864382a85 100644 --- a/apps/namadillo/src/setupTests.ts +++ b/apps/namadillo/src/setupTests.ts @@ -1,6 +1,11 @@ import "@testing-library/jest-dom"; +import { atom } from "jotai"; jest.mock("atoms/integrations", () => ({ getRestApiAddressByIndex: jest.fn(), getRpcByIndex: jest.fn(), })); + +jest.mock("atoms/integrations/atoms", () => ({ + localnetConfigAtom: atom({ data: undefined }), +}));