mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 07:37:57 +00:00
Companion for substrate#10632 (#4689)
* Companion for substrate#10632 Signed-off-by: koushiro <koushiro.cqx@gmail.com> * cargo format Signed-off-by: koushiro <koushiro.cqx@gmail.com> * Fix bags-list Signed-off-by: koushiro <koushiro.cqx@gmail.com> * Update Substrate * Fix Signed-off-by: koushiro <koushiro.cqx@gmail.com> * Fix bridges test * FMT Co-authored-by: Keith Yeung <kungfukeith11@gmail.com> Co-authored-by: Bastian Köcher <info@kchr.de>
This commit is contained in:
@@ -16,9 +16,9 @@
|
||||
|
||||
//! A malus or nemesis node launch code.
|
||||
|
||||
use clap::{AppSettings, Parser};
|
||||
use color_eyre::eyre;
|
||||
use polkadot_cli::{Cli, RunCmd};
|
||||
use structopt::StructOpt;
|
||||
|
||||
pub(crate) mod interceptor;
|
||||
pub(crate) mod shared;
|
||||
@@ -28,9 +28,9 @@ mod variants;
|
||||
use variants::*;
|
||||
|
||||
/// Define the different variants of behavior.
|
||||
#[derive(Debug, StructOpt)]
|
||||
#[structopt(about = "Malus - the nemesis of polkadot.")]
|
||||
#[structopt(rename_all = "kebab-case")]
|
||||
#[derive(Debug, Parser)]
|
||||
#[clap(about = "Malus - the nemesis of polkadot.", version)]
|
||||
#[clap(rename_all = "kebab-case")]
|
||||
enum NemesisVariant {
|
||||
/// Suggest a candidate with an invalid proof of validity.
|
||||
SuggestGarbageCandidate(RunCmd),
|
||||
@@ -40,18 +40,18 @@ enum NemesisVariant {
|
||||
DisputeAncestor(RunCmd),
|
||||
|
||||
#[allow(missing_docs)]
|
||||
#[structopt(name = "prepare-worker", setting = structopt::clap::AppSettings::Hidden)]
|
||||
#[clap(name = "prepare-worker", setting = AppSettings::Hidden)]
|
||||
PvfPrepareWorker(polkadot_cli::ValidationWorkerCommand),
|
||||
|
||||
#[allow(missing_docs)]
|
||||
#[structopt(name = "execute-worker", setting = structopt::clap::AppSettings::Hidden)]
|
||||
#[clap(name = "execute-worker", setting = AppSettings::Hidden)]
|
||||
PvfExecuteWorker(polkadot_cli::ValidationWorkerCommand),
|
||||
}
|
||||
|
||||
#[derive(Debug, StructOpt)]
|
||||
#[derive(Debug, Parser)]
|
||||
#[allow(missing_docs)]
|
||||
struct MalusCli {
|
||||
#[structopt(subcommand)]
|
||||
#[clap(subcommand)]
|
||||
pub variant: NemesisVariant,
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ impl MalusCli {
|
||||
|
||||
fn main() -> eyre::Result<()> {
|
||||
color_eyre::install()?;
|
||||
let cli = MalusCli::from_args();
|
||||
let cli = MalusCli::parse();
|
||||
cli.launch()?;
|
||||
Ok(())
|
||||
}
|
||||
@@ -110,7 +110,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn subcommand_works() {
|
||||
let cli = MalusCli::from_iter_safe(IntoIterator::into_iter([
|
||||
let cli = MalusCli::try_parse_from(IntoIterator::into_iter([
|
||||
"malus",
|
||||
"dispute-ancestor",
|
||||
"--bob",
|
||||
|
||||
Reference in New Issue
Block a user