Skip to content

Commit

Permalink
fix: remove type casting
Browse files Browse the repository at this point in the history
  • Loading branch information
montelaidev committed May 31, 2024
1 parent db08b3c commit 8d35e9d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/accounts-controller/src/AccountsController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,13 @@ function createExpectedInternalAccount({
importTime?: number;
lastSelected?: number;
}): InternalAccount {
const accountTypeToMethods = {
const accountTypeToMethods: Record<InternalAccountType, string[]> = {
[`${EthAccountType.Eoa}`]: [...Object.values(EthMethod)],
[`${EthAccountType.Erc4337}`]: [...Object.values(EthErc4337Method)],
[`${BtcAccountType.P2wpkh}`]: [...Object.values(BtcMethod)],
};

const methods =
accountTypeToMethods[type as unknown as keyof typeof accountTypeToMethods];
const methods = accountTypeToMethods[type];

const account = {
id,
Expand Down

0 comments on commit 8d35e9d

Please sign in to comment.