From 30af6611e8b6aec158b8df46dcf554ad65ec6230 Mon Sep 17 00:00:00 2001 From: Ana Maksimovskikh Date: Tue, 26 Nov 2024 18:38:43 +0000 Subject: [PATCH 1/4] Set new tezos RPC nodes --- packages/tezos/src/Network.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/tezos/src/Network.ts b/packages/tezos/src/Network.ts index 6eb13f80e7..12273b4058 100644 --- a/packages/tezos/src/Network.ts +++ b/packages/tezos/src/Network.ts @@ -2,7 +2,7 @@ import { type Network } from "./types"; export const MAINNET: Network = { name: "mainnet", - rpcUrl: "https://prod.tcinfra.net/rpc/mainnet/", + rpcUrl: "https://rpc.tzbeta.net/", tzktApiUrl: "https://api.mainnet.tzkt.io", tzktExplorerUrl: "https://tzkt.io", buyTezUrl: "https://widget.wert.io", @@ -10,7 +10,7 @@ export const MAINNET: Network = { export const GHOSTNET: Network = { name: "ghostnet", - rpcUrl: "https://ghostnet.ecadinfra.com", + rpcUrl: "https://rpc.ghostnet.teztnets.com/", tzktApiUrl: "https://api.ghostnet.tzkt.io", tzktExplorerUrl: "https://ghostnet.tzkt.io", buyTezUrl: "https://faucet.ghostnet.teztnets.com/", From 232780eab00a7e0c0a3f89595a4de63138a397da Mon Sep 17 00:00:00 2001 From: Oleg Chendighelean Date: Mon, 2 Dec 2024 17:34:44 +0000 Subject: [PATCH 2/4] Update mainnet RPC URL and Content Security Policy --- apps/embed-iframe-mainnet/vercel.json | 2 +- packages/state/src/migrations.ts | 15 ++++++++++++++- packages/tezos/src/Network.ts | 4 ++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/apps/embed-iframe-mainnet/vercel.json b/apps/embed-iframe-mainnet/vercel.json index 86b0df71a1..e12aae34d0 100644 --- a/apps/embed-iframe-mainnet/vercel.json +++ b/apps/embed-iframe-mainnet/vercel.json @@ -8,7 +8,7 @@ "headers": [ { "key": "Content-Security-Policy", - "value": "default-src 'self'; style-src 'self' https://fonts.googleapis.com 'unsafe-inline'; font-src 'self' https://fonts.gstatic.com; script-src 'self'; object-src 'none'; connect-src 'self' https://umamiwallet.com https://www.googleapis.com https://graph.facebook.com https://kukai.eu.auth0.com https://fnd.web3auth.io https://*.node.web3auth.io https://*.tor.us https://prod.tcinfra.net https://api.mainnet.tzkt.io https://vitals.vercel-insights.com; img-src 'self' data:; frame-ancestors 'self' https://kanvas-poa.vercel.app https://kanvas-poa-git-poa-release-trili-tech.vercel.app" + "value": "default-src 'self'; style-src 'self' https://fonts.googleapis.com 'unsafe-inline'; font-src 'self' https://fonts.gstatic.com; script-src 'self'; object-src 'none'; connect-src 'self' https://umamiwallet.com https://www.googleapis.com https://graph.facebook.com https://mainnet.ecadinfra.com https://kukai.eu.auth0.com https://fnd.web3auth.io https://*.node.web3auth.io https://*.tor.us https://prod.tcinfra.net https://api.mainnet.tzkt.io https://vitals.vercel-insights.com; img-src 'self' data:; frame-ancestors 'self' https://kanvas-poa.vercel.app https://kanvas-poa-git-poa-release-trili-tech.vercel.app" } ] } diff --git a/packages/state/src/migrations.ts b/packages/state/src/migrations.ts index 322754caf0..19a40edf8e 100644 --- a/packages/state/src/migrations.ts +++ b/packages/state/src/migrations.ts @@ -5,7 +5,7 @@ import { fromPairs, identity } from "lodash"; import { announcementInitialState as announcementsInitialState } from "./slices/announcement"; -export const VERSION = 8; +export const VERSION = 9; export const mainStoreMigrations = { 0: (state: any) => @@ -65,6 +65,18 @@ export const mainStoreMigrations = { delete draft.assets["delegationLevels"]; }), 8: identity, + 9: (state: any) => + produce(state, (draft: any) => { + if (draft.networks.current.name === "mainnet") { + draft.networks.current.rpcUrl = "https://mainnet.ecadinfra.com"; + } + for (const network of draft.networks.available) { + if (network.name === "mainnet") { + network.rpcUrl = "https://mainnet.ecadinfra.com"; + break; + } + } + }), } as any; export const accountsMigrations = { @@ -104,4 +116,5 @@ export const accountsMigrations = { } }); }), + 9: identity, } as any; diff --git a/packages/tezos/src/Network.ts b/packages/tezos/src/Network.ts index 12273b4058..23895e0887 100644 --- a/packages/tezos/src/Network.ts +++ b/packages/tezos/src/Network.ts @@ -2,7 +2,7 @@ import { type Network } from "./types"; export const MAINNET: Network = { name: "mainnet", - rpcUrl: "https://rpc.tzbeta.net/", + rpcUrl: "https://mainnet.ecadinfra.com", tzktApiUrl: "https://api.mainnet.tzkt.io", tzktExplorerUrl: "https://tzkt.io", buyTezUrl: "https://widget.wert.io", @@ -10,7 +10,7 @@ export const MAINNET: Network = { export const GHOSTNET: Network = { name: "ghostnet", - rpcUrl: "https://rpc.ghostnet.teztnets.com/", + rpcUrl: "https://ghostnet.ecadinfra.com", tzktApiUrl: "https://api.ghostnet.tzkt.io", tzktExplorerUrl: "https://ghostnet.tzkt.io", buyTezUrl: "https://faucet.ghostnet.teztnets.com/", From 1cecc295fb9378c68850185e4b3db68b1962fe4a Mon Sep 17 00:00:00 2001 From: Oleg Chendighelean Date: Tue, 3 Dec 2024 12:28:01 +0000 Subject: [PATCH 3/4] Fix flaky test --- .../AccountCard/AccountBalance.test.tsx | 4 +- .../DeriveMnemonicAccountModal.test.tsx | 4 +- .../components/CopyButton/CopyButton.test.tsx | 6 +- .../MasterPasswordModal.test.tsx | 13 +++- .../Menu/AdvancedMenu/AdvancedMenu.test.tsx | 12 +++- .../ImportWallet/ImportBackupTab.test.tsx | 5 +- .../src/components/SendFlow/utils.test.tsx | 6 +- .../beacon/PermissionRequestModal.test.tsx | 6 +- apps/web/src/setupTests.ts | 59 ++++++++++++++++--- 9 files changed, 94 insertions(+), 21 deletions(-) diff --git a/apps/web/src/components/AccountCard/AccountBalance.test.tsx b/apps/web/src/components/AccountCard/AccountBalance.test.tsx index 49635fb960..3a0252f491 100644 --- a/apps/web/src/components/AccountCard/AccountBalance.test.tsx +++ b/apps/web/src/components/AccountCard/AccountBalance.test.tsx @@ -45,7 +45,9 @@ describe("", () => { expect(button).toBeVisible(); - await act(() => user.click(button)); + await waitFor(async () => { + await act(() => user.click(button)); + }); await waitFor(() => expect( diff --git a/apps/web/src/components/AccountSelectorModal/DeriveMnemonicAccountModal/DeriveMnemonicAccountModal.test.tsx b/apps/web/src/components/AccountSelectorModal/DeriveMnemonicAccountModal/DeriveMnemonicAccountModal.test.tsx index 661058f9c0..0ef066de4c 100644 --- a/apps/web/src/components/AccountSelectorModal/DeriveMnemonicAccountModal/DeriveMnemonicAccountModal.test.tsx +++ b/apps/web/src/components/AccountSelectorModal/DeriveMnemonicAccountModal/DeriveMnemonicAccountModal.test.tsx @@ -67,7 +67,9 @@ describe("", () => { await act(() => user.type(screen.getByLabelText("Account name (Optional)"), newAccount.label)); await act(() => user.click(screen.getByRole("button", { name: "Continue" }))); await act(() => user.type(screen.getByLabelText("Password"), "test-password")); - await act(() => user.click(screen.getByRole("button", { name: "Submit" }))); + await waitFor(async () => { + await act(() => user.click(screen.getByRole("button", { name: "Submit" }))); + }); expect(mockDeriveMnemonicAccount).toHaveBeenCalledWith({ fingerPrint: account.seedFingerPrint, diff --git a/apps/web/src/components/CopyButton/CopyButton.test.tsx b/apps/web/src/components/CopyButton/CopyButton.test.tsx index 8dea221700..be7642b094 100644 --- a/apps/web/src/components/CopyButton/CopyButton.test.tsx +++ b/apps/web/src/components/CopyButton/CopyButton.test.tsx @@ -1,5 +1,5 @@ import { CopyButton } from "./CopyButton"; -import { act, render, screen, userEvent } from "../../testUtils"; +import { act, render, screen, userEvent, waitFor } from "../../testUtils"; describe("", () => { it("copies the value to the clipboard", async () => { @@ -8,7 +8,9 @@ describe("", () => { render(Copy); - await act(() => user.click(screen.getByTestId("copy-button"))); + await waitFor(async () => { + await act(() => user.click(screen.getByTestId("copy-button"))); + }); expect(navigator.clipboard.writeText).toHaveBeenCalledWith("hello"); }); diff --git a/apps/web/src/components/MasterPasswordModal/MasterPasswordModal.test.tsx b/apps/web/src/components/MasterPasswordModal/MasterPasswordModal.test.tsx index 365114648d..2c9d52aada 100644 --- a/apps/web/src/components/MasterPasswordModal/MasterPasswordModal.test.tsx +++ b/apps/web/src/components/MasterPasswordModal/MasterPasswordModal.test.tsx @@ -1,5 +1,5 @@ import { MasterPasswordModal } from "./MasterPasswordModal"; -import { renderInModal, screen, userEvent } from "../../testUtils"; +import { renderInModal, screen, userEvent, waitFor } from "../../testUtils"; const mockOnSubmit = jest.fn(); @@ -9,9 +9,16 @@ describe("", () => { await renderInModal(); await user.type(screen.getByLabelText("Password"), "testpassword"); - await user.click(screen.getByRole("button", { name: "Submit" })); + await waitFor( + async () => { + await user.click(screen.getByRole("button", { name: "Submit" })); + }, + { + timeout: 5000, + } + ); - expect(mockOnSubmit).toHaveBeenCalledWith({ password: "testpassword" }); + await waitFor(() => expect(mockOnSubmit).toHaveBeenCalledWith({ password: "testpassword" })); }); it("shows validation error when submitting without a password", async () => { diff --git a/apps/web/src/components/Menu/AdvancedMenu/AdvancedMenu.test.tsx b/apps/web/src/components/Menu/AdvancedMenu/AdvancedMenu.test.tsx index eed3e7152e..582f26d16a 100644 --- a/apps/web/src/components/Menu/AdvancedMenu/AdvancedMenu.test.tsx +++ b/apps/web/src/components/Menu/AdvancedMenu/AdvancedMenu.test.tsx @@ -2,7 +2,13 @@ import { mockImplicitAccount } from "@umami/core"; import { type UmamiStore, accountsActions, addTestAccount, makeStore } from "@umami/state"; import { AdvancedMenu } from "./AdvancedMenu"; -import { dynamicDrawerContextMock, renderInDrawer, screen, userEvent } from "../../../testUtils"; +import { + dynamicDrawerContextMock, + renderInDrawer, + screen, + userEvent, + waitFor, +} from "../../../testUtils"; import { ChangePasswordMenu } from "../ChangePasswordMenu/ChangePasswordMenu"; import { ErrorLogsMenu } from "../ErrorLogsMenu/ErrorLogsMenu"; import { NetworkMenu } from "../NetworkMenu/NetworkMenu"; @@ -35,7 +41,9 @@ describe("", () => { await renderInDrawer(, store); - await userEvent.click(screen.getByText(label)); + await waitFor(async () => { + await userEvent.click(screen.getByText(label)); + }); expect(openWith).toHaveBeenCalledWith(); }); }); diff --git a/apps/web/src/components/Onboarding/ImportWallet/ImportBackupTab.test.tsx b/apps/web/src/components/Onboarding/ImportWallet/ImportBackupTab.test.tsx index 22b4281cad..911c3a2875 100644 --- a/apps/web/src/components/Onboarding/ImportWallet/ImportBackupTab.test.tsx +++ b/apps/web/src/components/Onboarding/ImportWallet/ImportBackupTab.test.tsx @@ -57,7 +57,10 @@ describe("", () => { await act(() => user.upload(screen.getByTestId("file-input"), file)); await act(() => user.type(screen.getByLabelText("Password"), "wrong password")); - await act(() => user.click(screen.getByRole("button", { name: "Import Wallet" }))); + + await waitFor(async () => { + await act(() => user.click(screen.getByRole("button", { name: "Import Wallet" }))); + }); await waitFor(() => expect(mockToast).toHaveBeenCalledTimes(1)); expect(mockToast).toHaveBeenCalledWith({ diff --git a/apps/web/src/components/SendFlow/utils.test.tsx b/apps/web/src/components/SendFlow/utils.test.tsx index a35d98e515..5a3e3f3cd4 100644 --- a/apps/web/src/components/SendFlow/utils.test.tsx +++ b/apps/web/src/components/SendFlow/utils.test.tsx @@ -58,7 +58,11 @@ describe("SendFlow utils", () => { render(); await waitFor(() => expect(screen.getByText("Preview")).toBeEnabled()); - await act(() => user.click(screen.getByText("Preview"))); + + await waitFor(async () => { + await act(() => user.click(screen.getByText("Preview"))); + }); + expect(mockSingle).toHaveBeenCalled(); }); }); diff --git a/apps/web/src/components/beacon/PermissionRequestModal.test.tsx b/apps/web/src/components/beacon/PermissionRequestModal.test.tsx index beb817633a..15d62908a8 100644 --- a/apps/web/src/components/beacon/PermissionRequestModal.test.tsx +++ b/apps/web/src/components/beacon/PermissionRequestModal.test.tsx @@ -4,7 +4,7 @@ import { type PermissionRequestOutput, PermissionScope, } from "@airgap/beacon-wallet"; -import { fireEvent } from "@testing-library/react"; +import { fireEvent, waitFor } from "@testing-library/react"; import { mockMnemonicAccount } from "@umami/core"; import { type UmamiStore, WalletClient, addTestAccounts, makeStore } from "@umami/state"; @@ -85,7 +85,9 @@ describe("", () => { // grant permission const grantButton = screen.getByRole("button", { name: "Allow" }); expect(grantButton).toBeEnabled(); - await act(() => user.click(grantButton)); + await waitFor(async () => { + await act(() => user.click(grantButton)); + }); expect(store.getState().beacon).toEqual({ [SENDER_ID]: { diff --git a/apps/web/src/setupTests.ts b/apps/web/src/setupTests.ts index 2556a09cb9..3d9b9aced9 100644 --- a/apps/web/src/setupTests.ts +++ b/apps/web/src/setupTests.ts @@ -6,6 +6,45 @@ import { mockToast } from "@umami/state"; import { mockLocalStorage } from "@umami/test-utils"; import { setupJestCanvasMock } from "jest-canvas-mock"; +const writeText = jest.fn(); + +Object.assign(navigator, { + clipboard: { + writeText, + }, +}); + +const XMLHttpRequestMock = jest.fn(() => ({ + open: jest.fn(), + send: jest.fn(), + setRequestHeader: jest.fn(), + readyState: 4, + status: 200, + responseText: "", + onload: jest.fn(), + onerror: jest.fn(), + ontimeout: jest.fn(), + upload: { + onprogress: jest.fn(), + }, +})); + +Object.defineProperties(XMLHttpRequestMock, { + UNSENT: { value: 0 }, + OPENED: { value: 1 }, + HEADERS_RECEIVED: { value: 2 }, + LOADING: { value: 3 }, + DONE: { value: 4 }, +}); + +XMLHttpRequestMock.prototype = { + open: jest.fn(), + send: jest.fn(), + setRequestHeader: jest.fn(), +}; + +global.XMLHttpRequest = XMLHttpRequestMock as unknown as typeof XMLHttpRequest; + const mockIntersectionObserver = class MockIntersectionObserver { callback: jest.Mock; options: jest.Mock; @@ -30,14 +69,6 @@ jest.doMock("@chakra-ui/react", () => ({ useColorMode: () => ({ colorMode: "light", toggleColorMode: jest.fn() }), })); -Object.defineProperties(global, { - crypto: { value: webcrypto, writable: true }, - TextDecoder: { value: TextDecoder, writable: true }, - TextEncoder: { value: TextEncoder, writable: true }, - IntersectionObserver: { value: mockIntersectionObserver, writable: true, configurable: true }, - fetch: { value: jest.fn(), writable: true }, -}); - jest.mock("./utils/persistor", () => ({ pause: jest.fn(), })); @@ -48,6 +79,18 @@ beforeEach(() => { Object.defineProperty(window, "localStorage", { value: mockLocalStorage(), }); + + Object.defineProperties(global, { + crypto: { value: webcrypto, writable: true }, + TextDecoder: { value: TextDecoder, writable: true }, + TextEncoder: { value: TextEncoder, writable: true }, + IntersectionObserver: { value: mockIntersectionObserver, writable: true, configurable: true }, + fetch: { value: jest.fn(), writable: true }, + }); +}); + +afterEach(() => { + jest.clearAllMocks(); }); // TODO: fix act warnings From b0820d2afed552c643ac70cff607cd2dde3c7351 Mon Sep 17 00:00:00 2001 From: Oleg Chendighelean Date: Tue, 3 Dec 2024 15:37:59 +0000 Subject: [PATCH 4/4] Update rpc urls and add tests --- apps/embed-iframe-mainnet/vercel.json | 2 +- apps/embed-iframe/vercel.json | 2 +- packages/state/src/migrations.test.ts | 61 +++++++++++++++++++++++++++ packages/state/src/migrations.ts | 9 ++-- packages/tezos/src/Network.ts | 4 +- 5 files changed, 71 insertions(+), 7 deletions(-) diff --git a/apps/embed-iframe-mainnet/vercel.json b/apps/embed-iframe-mainnet/vercel.json index e12aae34d0..145f3187ea 100644 --- a/apps/embed-iframe-mainnet/vercel.json +++ b/apps/embed-iframe-mainnet/vercel.json @@ -8,7 +8,7 @@ "headers": [ { "key": "Content-Security-Policy", - "value": "default-src 'self'; style-src 'self' https://fonts.googleapis.com 'unsafe-inline'; font-src 'self' https://fonts.gstatic.com; script-src 'self'; object-src 'none'; connect-src 'self' https://umamiwallet.com https://www.googleapis.com https://graph.facebook.com https://mainnet.ecadinfra.com https://kukai.eu.auth0.com https://fnd.web3auth.io https://*.node.web3auth.io https://*.tor.us https://prod.tcinfra.net https://api.mainnet.tzkt.io https://vitals.vercel-insights.com; img-src 'self' data:; frame-ancestors 'self' https://kanvas-poa.vercel.app https://kanvas-poa-git-poa-release-trili-tech.vercel.app" + "value": "default-src 'self'; style-src 'self' https://fonts.googleapis.com 'unsafe-inline'; font-src 'self' https://fonts.gstatic.com; script-src 'self'; object-src 'none'; connect-src 'self' https://umamiwallet.com https://www.googleapis.com https://graph.facebook.com https://mainnet.tezos.ecadinfra.com https://kukai.eu.auth0.com https://fnd.web3auth.io https://*.node.web3auth.io https://*.tor.us https://prod.tcinfra.net https://api.mainnet.tzkt.io https://vitals.vercel-insights.com; img-src 'self' data:; frame-ancestors 'self' https://kanvas-poa.vercel.app https://kanvas-poa-git-poa-release-trili-tech.vercel.app" } ] } diff --git a/apps/embed-iframe/vercel.json b/apps/embed-iframe/vercel.json index 089c5f32c6..01f8069a79 100644 --- a/apps/embed-iframe/vercel.json +++ b/apps/embed-iframe/vercel.json @@ -8,7 +8,7 @@ "headers": [ { "key": "Content-Security-Policy", - "value": "default-src 'self'; style-src 'self' https://fonts.googleapis.com 'unsafe-inline'; font-src 'self' https://fonts.gstatic.com; script-src 'self'; object-src 'none'; connect-src 'self' https://umamiwallet.com https://www.googleapis.com https://graph.facebook.com https://kukai.eu.auth0.com https://fnd.web3auth.io https://*.node.web3auth.io https://*.tor.us https://ghostnet.ecadinfra.com https://api.ghostnet.tzkt.io https://vitals.vercel-insights.com; img-src 'self' data:" + "value": "default-src 'self'; style-src 'self' https://fonts.googleapis.com 'unsafe-inline'; font-src 'self' https://fonts.gstatic.com; script-src 'self'; object-src 'none'; connect-src 'self' https://umamiwallet.com https://www.googleapis.com https://graph.facebook.com https://kukai.eu.auth0.com https://fnd.web3auth.io https://*.node.web3auth.io https://*.tor.us https://ghostnet.tezos.ecadinfra.com https://api.ghostnet.tzkt.io https://vitals.vercel-insights.com; img-src 'self' data:" } ] } diff --git a/packages/state/src/migrations.test.ts b/packages/state/src/migrations.test.ts index 6911b77999..ba4b28d34c 100644 --- a/packages/state/src/migrations.test.ts +++ b/packages/state/src/migrations.test.ts @@ -1,5 +1,6 @@ import { mockLedgerAccount, mockMnemonicAccount, mockSecretKeyAccount } from "@umami/core"; import { mockImplicitAddress } from "@umami/tezos"; +import { produce } from "immer"; import { accountsMigrations, mainStoreMigrations } from "./migrations"; @@ -97,6 +98,66 @@ describe("migrations", () => { assets: { accountStates: {}, block: { level: 5 } }, }); }); + + describe("9", () => { + const migration = mainStoreMigrations[9]; + + it("should update rpcUrl for mainnet", () => { + const initialState = { + networks: { + current: { name: "mainnet", rpcUrl: "" }, + available: [ + { name: "mainnet", rpcUrl: "" }, + { name: "ghostnet", rpcUrl: "" }, + { name: "testnet", rpcUrl: "" }, + ], + }, + }; + + const expectedState = { + networks: { + current: { name: "mainnet", rpcUrl: "https://mainnet.tezos.ecadinfra.com" }, + available: [ + { name: "mainnet", rpcUrl: "https://mainnet.tezos.ecadinfra.com" }, + { name: "ghostnet", rpcUrl: "https://ghostnet.tezos.ecadinfra.com" }, + { name: "testnet", rpcUrl: "" }, // Unchanged + ], + }, + }; + + const migratedState = produce(initialState, (draft: any) => migration(draft)); + + expect(migratedState).toEqual(expectedState); + }); + + it("should update rpcUrl for ghostnet", () => { + const initialState = { + networks: { + current: { name: "ghostnet", rpcUrl: "" }, + available: [ + { name: "mainnet", rpcUrl: "" }, + { name: "ghostnet", rpcUrl: "" }, + { name: "testnet", rpcUrl: "" }, + ], + }, + }; + + const expectedState = { + networks: { + current: { name: "ghostnet", rpcUrl: "https://ghostnet.tezos.ecadinfra.com" }, + available: [ + { name: "mainnet", rpcUrl: "https://mainnet.tezos.ecadinfra.com" }, + { name: "ghostnet", rpcUrl: "https://ghostnet.tezos.ecadinfra.com" }, + { name: "testnet", rpcUrl: "" }, // Unchanged + ], + }, + }; + + const migratedState = produce(initialState, (draft: any) => migration(draft)); + + expect(migratedState).toEqual(expectedState); + }); + }); }); describe("account migrations", () => { diff --git a/packages/state/src/migrations.ts b/packages/state/src/migrations.ts index 19a40edf8e..e563a456db 100644 --- a/packages/state/src/migrations.ts +++ b/packages/state/src/migrations.ts @@ -68,12 +68,15 @@ export const mainStoreMigrations = { 9: (state: any) => produce(state, (draft: any) => { if (draft.networks.current.name === "mainnet") { - draft.networks.current.rpcUrl = "https://mainnet.ecadinfra.com"; + draft.networks.current.rpcUrl = "https://mainnet.tezos.ecadinfra.com"; + } else if (draft.networks.current.name === "ghostnet") { + draft.networks.current.rpcUrl = "https://ghostnet.tezos.ecadinfra.com"; } for (const network of draft.networks.available) { if (network.name === "mainnet") { - network.rpcUrl = "https://mainnet.ecadinfra.com"; - break; + network.rpcUrl = "https://mainnet.tezos.ecadinfra.com"; + } else if (network.name === "ghostnet") { + network.rpcUrl = "https://ghostnet.tezos.ecadinfra.com"; } } }), diff --git a/packages/tezos/src/Network.ts b/packages/tezos/src/Network.ts index 23895e0887..1d28850f67 100644 --- a/packages/tezos/src/Network.ts +++ b/packages/tezos/src/Network.ts @@ -2,7 +2,7 @@ import { type Network } from "./types"; export const MAINNET: Network = { name: "mainnet", - rpcUrl: "https://mainnet.ecadinfra.com", + rpcUrl: "https://mainnet.tezos.ecadinfra.com", tzktApiUrl: "https://api.mainnet.tzkt.io", tzktExplorerUrl: "https://tzkt.io", buyTezUrl: "https://widget.wert.io", @@ -10,7 +10,7 @@ export const MAINNET: Network = { export const GHOSTNET: Network = { name: "ghostnet", - rpcUrl: "https://ghostnet.ecadinfra.com", + rpcUrl: "https://ghostnet.tezos.ecadinfra.com", tzktApiUrl: "https://api.ghostnet.tzkt.io", tzktExplorerUrl: "https://ghostnet.tzkt.io", buyTezUrl: "https://faucet.ghostnet.teztnets.com/",