Skip to content

Commit

Permalink
final minor cleanup items
Browse files Browse the repository at this point in the history
  • Loading branch information
levicook committed Jul 16, 2021
1 parent a6e2d6c commit 7f9b773
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 19 deletions.
7 changes: 2 additions & 5 deletions orchestrator/gorc/src/commands/keys/cosmos.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
//! `cosmos keys` subcommand
mod add;
mod delete;
mod import;
mod list;
mod show;
mod rename;
mod show;

use abscissa_core::{Command, Options, Runnable};

Expand All @@ -14,7 +12,7 @@ pub enum CosmosKeysCmd {
#[options(help = "add [name]")]
Add(add::AddCosmosKeyCmd),

#[options(help = "import [name] [mnemnoic]")]
#[options(help = "import [name] (bip39-mnemnoic)")]
Import(import::ImportCosmosKeyCmd),

#[options(help = "delete [name]")]
Expand All @@ -29,4 +27,3 @@ pub enum CosmosKeysCmd {
#[options(help = "show [name]")]
Show(show::ShowCosmosKeyCmd),
}

4 changes: 2 additions & 2 deletions orchestrator/gorc/src/commands/keys/cosmos/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ impl Runnable for ImportCosmosKeyCmd {

let mnemonic = match self.args.get(1) {
Some(mnemonic) => mnemonic.clone(),
None => rpassword::read_password_from_tty(Some("> Enter your bip39 mnemonic:\n"))
None => rpassword::read_password_from_tty(Some("> Enter your bip39-mnemonic:\n"))
.expect("Could not read mnemonic"),
};

let mnemonic = bip32::Mnemonic::new(mnemonic.trim_end(), Default::default())
let mnemonic = bip32::Mnemonic::new(mnemonic.trim(), Default::default())
.expect("Could not parse mnemonic");

let seed = mnemonic.to_seed("");
Expand Down
2 changes: 1 addition & 1 deletion orchestrator/gorc/src/commands/keys/cosmos/show.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl Runnable for ShowCosmosKeyCmd {
.expect("Could not parse private key");

let address = key
.to_address("cosmos")
.to_address(config.cosmos.prefix.trim())
.expect("Could not generate public key");

println!("{}\t{}", name, address)
Expand Down
13 changes: 3 additions & 10 deletions orchestrator/gorc/src/commands/keys/eth.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//! `eth keys` subcommands
mod add;
mod delete;
mod import;
Expand All @@ -11,10 +9,10 @@ use abscissa_core::{Command, Options, Runnable};

#[derive(Command, Debug, Options, Runnable)]
pub enum EthKeysCmd {
#[options(help = "add [name] (password)")]
#[options(help = "add [name]")]
Add(add::AddEthKeyCmd),

#[options(help = "import [name] (mnemonic) (password)")]
#[options(help = "import [name] (bip39-mnemonic)")]
Import(import::ImportEthKeyCmd),

#[options(help = "delete [name]")]
Expand All @@ -28,9 +26,4 @@ pub enum EthKeysCmd {

#[options(help = "show [name]")]
Show(show::ShowEthKeyCmd),
}

impl EthKeysCmd {
//fn run(&self){
//}
}
}
2 changes: 1 addition & 1 deletion orchestrator/gorc/src/commands/keys/eth/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl Runnable for ImportEthKeyCmd {

let mnemonic = match self.args.get(1) {
Some(mnemonic) => mnemonic.clone(),
None => rpassword::read_password_from_tty(Some("> Enter your bip39 mnemonic:\n"))
None => rpassword::read_password_from_tty(Some("> Enter your bip39-mnemonic:\n"))
.expect("Could not read mnemonic"),
};

Expand Down

0 comments on commit 7f9b773

Please sign in to comment.