Skip to content

Commit

Permalink
fix: typecheck
Browse files Browse the repository at this point in the history
  • Loading branch information
vvava committed Jan 16, 2025
1 parent e7c5b83 commit da51f55
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/background/services/accounts/AccountsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@ export class AccountsService implements OnLock, OnUnlock {
this.networkService,
);

if (!addresses[NetworkVMType.EVM]) {
throw new Error('The account has no EVM address');
}

return {
addressC: addresses[NetworkVMType.EVM],
addressBTC: addresses[NetworkVMType.BITCOIN],
Expand Down Expand Up @@ -375,6 +379,10 @@ export class AccountsService implements OnLock, OnUnlock {
ledgerService: this.ledgerService,
});

if (!addresses[NetworkVMType.EVM] || !addresses[NetworkVMType.BITCOIN]) {
throw new Error('The account has no EVM or BTC address');
}

const id = crypto.randomUUID();

this.accounts = {
Expand Down
2 changes: 1 addition & 1 deletion src/background/services/secrets/SecretsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ export class SecretsService implements OnUnlock {
walletId: string;
ledgerService: LedgerService;
networkService: NetworkService;
}): Promise<Record<NetworkVMType, string>> {
}): Promise<Record<NetworkVMType, string | undefined>> {
const secrets = await this.getWalletAccountsSecretsById(walletId);

if (
Expand Down

0 comments on commit da51f55

Please sign in to comment.