Skip to content

Commit 27657e3

Browse files
committed
remove unused vars
1 parent 811d079 commit 27657e3

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-10
lines changed

eslint-warning-thresholds.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,10 @@
213213
},
214214
"packages/keyring-controller/src/KeyringController.test.ts": {
215215
"import-x/namespace": 14,
216-
"jest/no-conditional-in-test": 8
216+
"jest/no-conditional-in-test": 7
217217
},
218218
"packages/keyring-controller/src/KeyringController.ts": {
219-
"@typescript-eslint/no-unsafe-enum-comparison": 4,
219+
"@typescript-eslint/no-unsafe-enum-comparison": 3,
220220
"@typescript-eslint/no-unused-vars": 1
221221
},
222222
"packages/keyring-controller/tests/mocks/mockKeyring.ts": {
@@ -260,7 +260,6 @@
260260
"import-x/order": 1
261261
},
262262
"packages/multichain/src/adapters/caip-permission-adapter-eth-accounts.ts": {
263-
"@typescript-eslint/no-unsafe-enum-comparison": 1,
264263
"jsdoc/tag-lines": 5
265264
},
266265
"packages/multichain/src/adapters/caip-permission-adapter-permittedChains.test.ts": {
@@ -325,7 +324,7 @@
325324
"jsdoc/require-returns": 1
326325
},
327326
"packages/multichain/src/scope/supported.ts": {
328-
"@typescript-eslint/no-unsafe-enum-comparison": 6
327+
"@typescript-eslint/no-unsafe-enum-comparison": 3
329328
},
330329
"packages/multichain/src/scope/validation.ts": {
331330
"jsdoc/tag-lines": 2

packages/keyring-controller/src/KeyringController.test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2511,11 +2511,9 @@ describe('KeyringController', () => {
25112511
await withController(async ({ controller, encryptor }) => {
25122512
const newPassword = 'new-password';
25132513
const keyFromPasswordSpy = jest.spyOn(encryptor, 'keyFromPassword');
2514-
const spiedEncryptionFn = jest.spyOn(encryptor, 'encryptWithKey');
25152514

25162515
await controller.changePassword(newPassword);
25172516

2518-
// we pick the first argument of the first call
25192517
expect(keyFromPasswordSpy).toHaveBeenCalledWith(
25202518
newPassword,
25212519
controller.state.encryptionSalt,
@@ -3022,7 +3020,7 @@ describe('KeyringController', () => {
30223020
});
30233021

30243022
it('should throw error if vault unlocked has an unexpected shape', async () => {
3025-
await withController(async ({ controller, initialState, encryptor }) => {
3023+
await withController(async ({ controller, encryptor }) => {
30263024
jest.spyOn(encryptor, 'decryptWithKey').mockResolvedValueOnce([
30273025
{
30283026
foo: 'bar',
@@ -3036,7 +3034,7 @@ describe('KeyringController', () => {
30363034
});
30373035

30383036
it('should throw error if encryptionKey is of an unexpected type', async () => {
3039-
await withController(async ({ controller, initialState }) => {
3037+
await withController(async ({ controller }) => {
30403038
await expect(
30413039
controller.submitEncryptionKey(
30423040
// @ts-expect-error we are testing the case of a user using

packages/keyring-controller/src/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export enum KeyringControllerError {
33
KeyringNotFound = 'KeyringController - Keyring not found.',
44
UnsafeDirectKeyringAccess = 'KeyringController - Returning keyring instances is unsafe',
55
WrongPasswordType = 'KeyringController - Password must be of type string.',
6-
WrongEncryptionKeyType = 'KeyringController - Password must be of type string.',
6+
WrongEncryptionKeyType = 'KeyringController - Encryption key must be of type string.',
77
InvalidEmptyPassword = 'KeyringController - Password cannot be empty.',
88
NoFirstAccount = 'KeyringController - First Account not found.',
99
DuplicatedAccount = 'KeyringController - The account you are trying to import is a duplicate',

packages/keyring-controller/tests/mocks/mockEncryptor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export default class MockEncryptor implements ExportableKeyEncryptor {
6464
};
6565
}
6666

67-
async decryptWithKey(key: unknown, text: string) {
67+
async decryptWithKey(_key: unknown, _text: string) {
6868
return JSON.parse(this.cacheVal || '') ?? {};
6969
}
7070

0 commit comments

Comments
 (0)