diff --git a/apps/browser-extension-wallet/src/hooks/__tests__/useCollateral.test.tsx b/apps/browser-extension-wallet/src/hooks/__tests__/useCollateral.test.tsx index 77de83116..e907eea60 100644 --- a/apps/browser-extension-wallet/src/hooks/__tests__/useCollateral.test.tsx +++ b/apps/browser-extension-wallet/src/hooks/__tests__/useCollateral.test.tsx @@ -5,7 +5,6 @@ /* eslint-disable import/imports-first */ const mockUseMaxAda = jest.fn(); const mockUseBuitTxState = jest.fn(); -const mockToastNotify = jest.fn(); const mockUseSyncingTheFirstTime = jest.fn(); const mockCreateTxBuilder = jest.fn(); const mockUseWalletStore = jest.fn(); @@ -70,23 +69,15 @@ jest.mock('@hooks/useSyncingTheFirstTime', () => ({ useSyncingTheFirstTime: mockUseSyncingTheFirstTime })); -jest.mock('@lace/common', () => ({ - ...jest.requireActual('@lace/common'), - toast: { - notify: mockToastNotify - } -})); - const getWrapper = () => - ({ children }: { children: React.ReactNode }) => - ( - - - {children} - - - ); + ({ children }: { children: React.ReactNode }) => ( + + + {children} + + + ); describe('Testing useCollateral hook', () => { beforeEach(() => { @@ -262,7 +253,6 @@ describe('Testing useCollateral hook', () => { expect(mockSetUnspendable).not.toHaveBeenCalled(); expect(inspect).not.toHaveBeenCalled(); expect(mockSetBuiltTxData).not.toHaveBeenCalled(); - expect(mockToastNotify).not.toHaveBeenCalled(); }); mockUseMaxAda.mockReset(); @@ -280,7 +270,6 @@ describe('Testing useCollateral hook', () => { expect(mockSetUnspendable).not.toHaveBeenCalled(); expect(inspect).not.toHaveBeenCalled(); expect(mockSetBuiltTxData).not.toHaveBeenCalled(); - expect(mockToastNotify).not.toHaveBeenCalled(); }); }); @@ -311,7 +300,6 @@ describe('Testing useCollateral hook', () => { await waitFor(() => { expect(mockSubmitTx).toBeCalledWith(signedTx); - expect(mockToastNotify).toBeCalledWith({ text: 'Collateral added' }); expect(mockSetUnspendable).toBeCalledWith([utxo]); expect(mockSetBuiltTxData).not.toBeCalled(); }); @@ -333,7 +321,6 @@ describe('Testing useCollateral hook', () => { await waitFor(() => { expect(mockSubmitTx).toBeCalledWith(signedTx); - expect(mockToastNotify).toBeCalledWith({ text: 'Collateral added' }); expect(mockSetUnspendable).toBeCalledWith([utxo]); expect(mockSetBuiltTxData).toBeCalledWith({ uiTx: { diff --git a/packages/nami/src/features/ada-handle/config.ts b/packages/nami/src/features/ada-handle/config.ts index 5f682d1f8..105276b44 100644 --- a/packages/nami/src/features/ada-handle/config.ts +++ b/packages/nami/src/features/ada-handle/config.ts @@ -1,11 +1,13 @@ +/* eslint-disable @typescript-eslint/no-non-null-assertion */ import { Cardano } from '@cardano-sdk/core'; import { Wallet } from '@lace/cardano'; export const ADA_HANDLE_POLICY_ID = Wallet.ADA_HANDLE_POLICY_ID; export const isAdaHandleEnabled = process.env.USE_ADA_HANDLE === 'true'; export const HANDLE_SERVER_URLS: Record = { - [Cardano.NetworkMagics.Mainnet]: process.env.ADA_HANDLE_URL_MAINNET!, - [Cardano.NetworkMagics.Preprod]: process.env.ADA_HANDLE_URL_PREPROD!, - [Cardano.NetworkMagics.Preview]: process.env.ADA_HANDLE_URL_PREVIEW!, - [Cardano.NetworkMagics.Sanchonet]: process.env.ADA_HANDLE_URL_SANCHONET!, + [Cardano.NetworkMagics.Mainnet]: process.env.CARDANO_SERVICES_URL_MAINNET!, + [Cardano.NetworkMagics.Preprod]: process.env.CARDANO_SERVICES_URL_PREPROD!, + [Cardano.NetworkMagics.Preview]: process.env.CARDANO_SERVICES_URL_PREVIEW!, + [Cardano.NetworkMagics.Sanchonet]: + process.env.CARDANO_SERVICES_URL_SANCHONET!, }; diff --git a/packages/nami/src/features/ada-handle/useHandleResolver.ts b/packages/nami/src/features/ada-handle/useHandleResolver.ts index a38f10d49..6bd59e2be 100644 --- a/packages/nami/src/features/ada-handle/useHandleResolver.ts +++ b/packages/nami/src/features/ada-handle/useHandleResolver.ts @@ -1,7 +1,7 @@ -/* eslint-disable @typescript-eslint/no-non-null-assertion */ import { useMemo } from 'react'; import { handleHttpProvider } from '@cardano-sdk/cardano-services-client'; +import axiosFetchAdapter from '@shiroyasha9/axios-fetch-adapter'; import { HANDLE_SERVER_URLS } from './config'; @@ -13,6 +13,7 @@ export const useHandleResolver = ( return useMemo(() => { const serverUrl = HANDLE_SERVER_URLS[networkMagic]; return handleHttpProvider({ + adapter: axiosFetchAdapter, baseUrl: serverUrl, logger: console, });