Skip to content

Commit

Permalink
fix: use type unknown instead of Keyring
Browse files Browse the repository at this point in the history
  • Loading branch information
mikesposito committed May 25, 2023
1 parent e060796 commit a0f250d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion packages/keyring-controller/src/KeyringController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -449,9 +449,14 @@ describe('KeyringController', () => {
describe('when existing type is provided', () => {
it('should return keyrings of the right type', async () => {
await withController(async ({ controller }) => {
const keyrings = controller.getKeyringsByType(KeyringTypes.hd);
const keyrings = controller.getKeyringsByType(
KeyringTypes.hd,
) as KeyringObject[];
expect(keyrings).toHaveLength(1);
expect(keyrings[0].type).toBe(KeyringTypes.hd);
expect(keyrings[0].getAccounts()).toStrictEqual(
controller.state.keyrings[0].accounts.map(normalize),
);
});
});
});
Expand Down
2 changes: 1 addition & 1 deletion packages/keyring-controller/src/KeyringController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ export class KeyringController extends BaseController<
* @param type - Keyring type name.
* @returns An array of keyrings of the given type.
*/
getKeyringsByType(type: KeyringTypes | string): Keyring[] {
getKeyringsByType(type: KeyringTypes | string): unknown[] {
return this.#keyring.getKeyringsByType(type);
}

Expand Down

0 comments on commit a0f250d

Please sign in to comment.