cli: fix errors.

This commit is contained in:
Christopher Jeffrey 2017-08-05 14:41:28 -07:00
parent ae1c040cd7
commit 2fea1319d9
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -81,6 +81,10 @@ CLI.prototype.getWIF = async function getWIF() {
const address = this.config.str(0);
const passphrase = this.config.str('passphrase');
const key = await this.wallet.getWIF(address, passphrase);
if (!key) {
this.log('Key not found.');
return;
}
this.log(key.privateKey);
};
@ -101,6 +105,10 @@ CLI.prototype.removeSharedKey = async function removeSharedKey() {
CLI.prototype.getSharedKeys = async function getSharedKeys() {
const acct = this.config.str([0, 'account']);
const account = await this.wallet.getAccount(acct);
if (!account) {
this.log('Account not found.');
return;
}
this.log(account.keys);
};