mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-30 21:17:56 +00:00
Fix base-path handling in key insert (#7775)
This fixes the handling of base-path when using `key insert`. Before the base-path wasn't setup correctly, as done when starting a node. This resulted in putting the keys into the wrong directory. This pr fixes this by creating the correct base-path/config dir for the keystore. Besides that it also removes the insert command from `subkey` as it doesn't make that much sense. If requested, we could bring it back later.
This commit is contained in:
@@ -17,11 +17,11 @@
|
||||
|
||||
//! Key related CLI utilities
|
||||
|
||||
use crate::Error;
|
||||
use crate::{Error, SubstrateCli};
|
||||
use structopt::StructOpt;
|
||||
|
||||
use super::{
|
||||
insert::InsertCmd,
|
||||
insert_key::InsertKeyCmd,
|
||||
inspect_key::InspectKeyCmd,
|
||||
generate::GenerateCmd,
|
||||
inspect_node_key::InspectNodeKeyCmd,
|
||||
@@ -45,17 +45,17 @@ pub enum KeySubcommand {
|
||||
InspectNodeKey(InspectNodeKeyCmd),
|
||||
|
||||
/// Insert a key to the keystore of a node.
|
||||
Insert(InsertCmd),
|
||||
Insert(InsertKeyCmd),
|
||||
}
|
||||
|
||||
impl KeySubcommand {
|
||||
/// run the key subcommands
|
||||
pub fn run(&self) -> Result<(), Error> {
|
||||
pub fn run<C: SubstrateCli>(&self, cli: &C) -> Result<(), Error> {
|
||||
match self {
|
||||
KeySubcommand::GenerateNodeKey(cmd) => cmd.run(),
|
||||
KeySubcommand::Generate(cmd) => cmd.run(),
|
||||
KeySubcommand::InspectKey(cmd) => cmd.run(),
|
||||
KeySubcommand::Insert(cmd) => cmd.run(),
|
||||
KeySubcommand::Insert(cmd) => cmd.run(cli),
|
||||
KeySubcommand::InspectNodeKey(cmd) => cmd.run(),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user