Skip to content

Commit f737dee

Browse files
authored
feat(cli): Return locked warning in wallet:accounts and wallet:which (#5344)
1 parent d456d62 commit f737dee

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

ironfish-cli/src/commands/wallet/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ export class AccountsCommand extends IronfishCommand {
2525

2626
const response = await client.wallet.getAccountsStatus()
2727

28+
if (response.content.locked) {
29+
this.log('Your wallet is locked. Unlock the wallet to access your accounts')
30+
this.exit(0)
31+
}
32+
2833
if (response.content.accounts.length === 0) {
2934
this.log('you have no accounts')
3035
return []

ironfish-cli/src/commands/wallet/which.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ export class WhichCommand extends IronfishCommand {
2525

2626
const client = await this.connectRpc()
2727

28+
const response = await client.wallet.getAccountsStatus()
29+
if (response.content.locked) {
30+
this.log('Your wallet is locked. Unlock the wallet to access your accounts')
31+
this.exit(0)
32+
}
33+
2834
const {
2935
content: {
3036
accounts: [accountName],

0 commit comments

Comments
 (0)