Expose node subcommands in Malus CLI (#6135)

* Expose the full Cli through malus

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

* fix lonely test

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
This commit is contained in:
Andrei Sandu
2022-10-11 15:07:28 +03:00
committed by GitHub
parent bc9da4d5d0
commit dc555b9510
3 changed files with 25 additions and 30 deletions
@@ -29,7 +29,7 @@ use polkadot_cli::{
OverseerConnector, OverseerGen, OverseerGenArgs, OverseerHandle, ParachainHost,
ProvideRuntimeApi,
},
RunCmd,
Cli,
};
use polkadot_node_subsystem::SpawnGlue;
use sp_core::traits::SpawnNamed;
@@ -40,7 +40,7 @@ use crate::{interceptor::*, variants::ReplaceValidationResult};
use std::sync::Arc;
#[derive(Clone, Debug, clap::Parser)]
#[derive(Debug, clap::Parser)]
#[clap(rename_all = "kebab-case")]
#[allow(missing_docs)]
pub struct DisputeAncestorOptions {
@@ -56,18 +56,14 @@ pub struct DisputeAncestorOptions {
pub fake_validation_error: FakeCandidateValidationError,
#[clap(flatten)]
pub cmd: RunCmd,
pub cli: Cli,
}
pub(crate) struct DisputeValidCandidates {
/// Fake validation config (applies to disputes as well).
opts: DisputeAncestorOptions,
}
impl DisputeValidCandidates {
pub fn new(opts: DisputeAncestorOptions) -> Self {
Self { opts }
}
pub fake_validation: FakeCandidateValidation,
/// Fake validation error config.
pub fake_validation_error: FakeCandidateValidationError,
}
impl OverseerGen for DisputeValidCandidates {
@@ -83,8 +79,8 @@ impl OverseerGen for DisputeValidCandidates {
{
let spawner = args.spawner.clone();
let validation_filter = ReplaceValidationResult::new(
self.opts.fake_validation,
self.opts.fake_validation_error,
self.fake_validation,
self.fake_validation_error,
SpawnGlue(spawner.clone()),
);