From 0a6c7be95e6ece64ba53fa80a8c3e5103f72671e Mon Sep 17 00:00:00 2001 From: kyranjamie Date: Tue, 13 Jul 2021 10:12:22 +0200 Subject: [PATCH] chore: fix type errors --- app/hooks/use-prepare-ledger.ts | 8 ++------ app/store/stacking/stacking.actions.ts | 2 +- app/tests/restore-wallet.spec.ts | 5 +---- app/utils/blast-undo-stack.ts | 2 +- 4 files changed, 5 insertions(+), 12 deletions(-) diff --git a/app/hooks/use-prepare-ledger.ts b/app/hooks/use-prepare-ledger.ts index 8b1b4d823..787cc4015 100644 --- a/app/hooks/use-prepare-ledger.ts +++ b/app/hooks/use-prepare-ledger.ts @@ -3,15 +3,11 @@ import { LedgerError } from '@zondax/ledger-blockstack'; import compareVersions from 'compare-versions'; import { Observable } from 'rxjs'; import { filter } from 'rxjs/operators'; -import { - EARLIEST_SUPPORTED_LEDGER_VERSION, - LATEST_LEDGER_VERSION_MAJOR, - LATEST_LEDGER_VERSION_MINOR, -} from '@constants/index'; +import { EARLIEST_SUPPORTED_LEDGER_VERSION } from '@constants/index'; +import { isTestnet } from '@utils/network-utils'; import type { LedgerMessageEvents } from '../main/register-ledger-listeners'; import { useListenLedgerEffect } from './use-listen-ledger-effect'; -import { isTestnet } from '@utils/network-utils'; import { messages$ } from './use-message-events'; import { useCheckForUpdates } from './use-check-for-updates'; diff --git a/app/store/stacking/stacking.actions.ts b/app/store/stacking/stacking.actions.ts index 6a7d0b30a..07d879523 100644 --- a/app/store/stacking/stacking.actions.ts +++ b/app/store/stacking/stacking.actions.ts @@ -42,7 +42,7 @@ export const fetchStackerInfo = createAsyncThunk( network.coreApiUrl = node.url; const stackingClient = new StackingClient(address, network as any); const [error, resp] = await safeAwait(stackingClient.getStatus()); - if (resp) return resp; + if (resp) return resp as any; if (error) return { error }; throw new Error(); } diff --git a/app/tests/restore-wallet.spec.ts b/app/tests/restore-wallet.spec.ts index b4d50aade..b893ed2b5 100644 --- a/app/tests/restore-wallet.spec.ts +++ b/app/tests/restore-wallet.spec.ts @@ -10,7 +10,6 @@ import { getTestConfigPath } from './get-test-config-path'; import { createGlobalFeature, resetWallet } from './features/global.feature'; import { HomeFeature } from './features/home.feature'; import { initSoftwareWallet } from './features/onboarding.feature'; -import path from 'path'; const PASSWORD = 'hello9*&^*^*dkfskjdfskljdfsj'; const SEED_PHRASE = @@ -30,7 +29,7 @@ describe('Restore wallet flow', () => { afterEach(async () => await app.close()); - test('Restore wallet', async done => { + test('Restore wallet', async () => { await initSoftwareWallet(page)(SEED_PHRASE, PASSWORD); const globalFeature = createGlobalFeature(page); @@ -69,7 +68,5 @@ describe('Restore wallet flow', () => { await resetWallet(page); await delay(1000); await page.screenshot({ path: 'screenshots/finished-page.png' }); - - done(); }, 120_0000); }); diff --git a/app/utils/blast-undo-stack.ts b/app/utils/blast-undo-stack.ts index b7c580173..bdfb877d5 100644 --- a/app/utils/blast-undo-stack.ts +++ b/app/utils/blast-undo-stack.ts @@ -8,5 +8,5 @@ export function blastUndoStackToRemovePasswordFromMemory(element: HTMLInputEleme for (let i = 0; i < 256; i++) document.execCommand('undo'); const newFakeValue = '0'.repeat(pwLength); element.value = newFakeValue; - global.gc(); + global.gc?.(); }