Skip to content

Commit c2467d9

Browse files
chore(suite): fix lint assertions
1 parent b7471de commit c2467d9

3 files changed

Lines changed: 10 additions & 8 deletions

File tree

packages/suite/jest.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ module.exports = {
4040
],
4141
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
4242
moduleNameMapper: {
43-
'^@suite/(.+)': '<rootDir>/../../suite/$1',
4443
'^@suite-common/(.+)': '<rootDir>/../../suite-common/$1',
4544
'^@trezor/(?!network-)(.+)': '<rootDir>/../$1',
4645
'^src/(.+)': '<rootDir>/src/$1',

packages/suite/src/storage/migrations/versions/__tests__/26.8.0.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import '@suite-common/test-utils/src/globalOverrides';
22
import { type IDBPDatabase, deleteDB, openDB } from 'idb';
33

4+
import { type AccountKey } from '@suite-common/wallet-types';
5+
46
import { type SuiteDBSchema } from 'src/storage/definitions';
57

68
import migration from '../26.8.0';
@@ -26,6 +28,8 @@ describe('migration 26.8.0', () => {
2628
db.createObjectStore('receive');
2729
},
2830
});
31+
const accountKey = 'btc-account-key' as AccountKey;
32+
2933
await db.put(
3034
'receive',
3135
{
@@ -41,13 +45,13 @@ describe('migration 26.8.0', () => {
4145
address: 'fresh-btc-address',
4246
},
4347
},
44-
'btc-account-key',
48+
accountKey,
4549
);
4650
db.close();
4751

4852
const migratedDb = await runMigration();
4953

50-
expect(await migratedDb.get('receive', 'btc-account-key')).toEqual({
54+
expect(await migratedDb.get('receive', accountKey)).toEqual({
5155
touchedAddresses: [
5256
{
5357
path: 'btc-path',

packages/suite/src/views/wallet/sign-verify/index.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useEffect, useState } from 'react';
22
import { type FieldError } from 'react-hook-form';
33

4-
import { selectSelectedAccount, selectSelectedAccountKey } from '@suite/account';
4+
import { selectFullSelectedAccount, selectSelectedAccountKey } from '@suite/account';
55
import { useDevice } from '@suite/device';
66
import { Translation, type TranslationKey, useTranslation } from '@suite/intl';
77
import { type ReceiveRootState, selectTouchedAddresses } from '@suite-common/receive';
@@ -41,9 +41,8 @@ const SignVerify = () => {
4141
const [page, setPage] = useState<'sign' | 'verify'>('sign');
4242
const [isCompleted, setIsCompleted] = useState(false);
4343

44-
const selectedAccount = useSelector(selectSelectedAccount);
44+
const selectedAccount = useSelector(selectFullSelectedAccount);
4545
const selectedAccountKey = useSelector(selectSelectedAccountKey);
46-
const selectedNetwork = useSelector(state => state.wallet.selectedAccount.network);
4746
const touchedAddresses = useSelector((state: ReceiveRootState) =>
4847
selectTouchedAddresses(state, selectedAccountKey),
4948
);
@@ -65,11 +64,11 @@ const SignVerify = () => {
6564
pathField,
6665
isElectrumField,
6766
cardanoPubKeyCoseField,
68-
} = useSignVerifyForm(isSignPage, selectedAccount!);
67+
} = useSignVerifyForm(isSignPage, selectedAccount.account!);
6968

7069
const { isLocked, device } = useDevice();
7170
const { translationString } = useTranslation();
72-
const { canCopy, copy } = useCopySignedMessage(formValues, selectedNetwork);
71+
const { canCopy, copy } = useCopySignedMessage(formValues, selectedAccount.network);
7372

7473
const getErrorMessage = (error?: FieldError) =>
7574
error ? translationString(error.message as TranslationKey) : undefined;

0 commit comments

Comments
 (0)