mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 11:07:56 +00:00
Subkey should not import the entire world. (#7845)
There is no reason for subkey to import the default Substrate node to support a feature that would only be usable for the Substrate node. Subkey itself should be more the default key management binary for Substrate related chains. If certain chains require some special functionality, they can easily stick together their own "my-chain-key".
This commit is contained in:
@@ -21,8 +21,6 @@ use sc_cli::{
|
||||
Error, VanityCmd, SignCmd, VerifyCmd, GenerateNodeKeyCmd, GenerateCmd, InspectKeyCmd,
|
||||
InspectNodeKeyCmd
|
||||
};
|
||||
use substrate_frame_cli::ModuleIdCmd;
|
||||
use sp_core::crypto::Ss58Codec;
|
||||
|
||||
#[derive(Debug, StructOpt)]
|
||||
#[structopt(
|
||||
@@ -44,9 +42,6 @@ pub enum Subkey {
|
||||
/// Print the peer ID corresponding to the node key in the given file
|
||||
InspectNodeKey(InspectNodeKeyCmd),
|
||||
|
||||
/// Inspect a module ID address
|
||||
ModuleId(ModuleIdCmd),
|
||||
|
||||
/// Sign a message, with a given (secret) key.
|
||||
Sign(SignCmd),
|
||||
|
||||
@@ -58,21 +53,14 @@ pub enum Subkey {
|
||||
}
|
||||
|
||||
/// Run the subkey command, given the apropriate runtime.
|
||||
pub fn run<R>() -> Result<(), Error>
|
||||
where
|
||||
R: frame_system::Config,
|
||||
R::AccountId: Ss58Codec
|
||||
{
|
||||
pub fn run() -> Result<(), Error> {
|
||||
match Subkey::from_args() {
|
||||
Subkey::GenerateNodeKey(cmd) => cmd.run()?,
|
||||
Subkey::Generate(cmd) => cmd.run()?,
|
||||
Subkey::Inspect(cmd) => cmd.run()?,
|
||||
Subkey::InspectNodeKey(cmd) => cmd.run()?,
|
||||
Subkey::ModuleId(cmd) => cmd.run::<R>()?,
|
||||
Subkey::Vanity(cmd) => cmd.run()?,
|
||||
Subkey::Verify(cmd) => cmd.run()?,
|
||||
Subkey::Sign(cmd) => cmd.run()?,
|
||||
};
|
||||
|
||||
Ok(())
|
||||
Subkey::GenerateNodeKey(cmd) => cmd.run(),
|
||||
Subkey::Generate(cmd) => cmd.run(),
|
||||
Subkey::Inspect(cmd) => cmd.run(),
|
||||
Subkey::InspectNodeKey(cmd) => cmd.run(),
|
||||
Subkey::Vanity(cmd) => cmd.run(),
|
||||
Subkey::Verify(cmd) => cmd.run(),
|
||||
Subkey::Sign(cmd) => cmd.run(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,8 +18,6 @@
|
||||
|
||||
//! Subkey utility, based on node_runtime.
|
||||
|
||||
use node_runtime::Runtime;
|
||||
|
||||
fn main() -> Result<(), sc_cli::Error> {
|
||||
subkey::run::<Runtime>()
|
||||
subkey::run()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user