From 823980f0befc3b08622d12761240e73d70c11be2 Mon Sep 17 00:00:00 2001 From: Hayden Fowler Date: Thu, 5 Sep 2024 12:07:16 +1000 Subject: [PATCH] ID-2334 Removed preload call from Magic SDK --- packages/passport/sdk/src/Passport.int.test.ts | 1 - packages/passport/sdk/src/magicAdapter.test.ts | 6 ------ packages/passport/sdk/src/magicAdapter.ts | 1 - 3 files changed, 8 deletions(-) diff --git a/packages/passport/sdk/src/Passport.int.test.ts b/packages/passport/sdk/src/Passport.int.test.ts index 0cb5a821fd..b7e915bf91 100644 --- a/packages/passport/sdk/src/Passport.int.test.ts +++ b/packages/passport/sdk/src/Passport.int.test.ts @@ -93,7 +93,6 @@ describe('Passport', () => { (Magic as jest.Mock).mockImplementation(() => ({ openid: { loginWithOIDC: mockLoginWithOidc }, rpcProvider: { request: mockMagicRequest }, - preload: jest.fn(), })); }); diff --git a/packages/passport/sdk/src/magicAdapter.test.ts b/packages/passport/sdk/src/magicAdapter.test.ts index 762f99621d..9b4c1dcf11 100644 --- a/packages/passport/sdk/src/magicAdapter.test.ts +++ b/packages/passport/sdk/src/magicAdapter.test.ts @@ -23,7 +23,6 @@ describe('MagicWallet', () => { magicProviderId: providerId, } as PassportConfiguration; const idToken = 'e30=.e30=.e30='; - const preload = jest.fn(); beforeEach(() => { jest.resetAllMocks(); @@ -35,7 +34,6 @@ describe('MagicWallet', () => { logout: logoutMock, }, rpcProvider, - preload, })); }); @@ -56,7 +54,6 @@ describe('MagicWallet', () => { }); it('starts initialising the magicClient', () => { jest.spyOn(window.document, 'readyState', 'get').mockReturnValue('complete'); - preload.mockResolvedValue(Promise.resolve()); const magicAdapter = new MagicAdapter(config); // @ts-ignore expect(magicAdapter.lazyMagicClient).toBeDefined(); @@ -83,7 +80,6 @@ describe('MagicWallet', () => { describe('login', () => { it('should call loginWithOIDC and initialise the provider with the correct arguments', async () => { - preload.mockResolvedValue(Promise.resolve()); const magicAdapter = new MagicAdapter(config); const magicProvider = await magicAdapter.login(idToken); @@ -101,7 +97,6 @@ describe('MagicWallet', () => { }); it('should throw a PassportError when an error is thrown', async () => { - preload.mockResolvedValue(Promise.resolve()); const magicAdapter = new MagicAdapter(config); loginWithOIDCMock.mockImplementation(() => { @@ -121,7 +116,6 @@ describe('MagicWallet', () => { describe('logout', () => { it('calls the logout function', async () => { - preload.mockResolvedValue(Promise.resolve()); const magicAdapter = new MagicAdapter(config); await magicAdapter.login(idToken); await magicAdapter.logout(); diff --git a/packages/passport/sdk/src/magicAdapter.ts b/packages/passport/sdk/src/magicAdapter.ts index 7e0d512e0d..d33afe4cfb 100644 --- a/packages/passport/sdk/src/magicAdapter.ts +++ b/packages/passport/sdk/src/magicAdapter.ts @@ -24,7 +24,6 @@ export default class MagicAdapter { extensions: [new OpenIdExtension()], network: MAINNET, // We always connect to mainnet to ensure addresses are the same across envs }); - client.preload(); return client; }); }