1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
mod adversary;
mod tx_only;

use crate::mjolnir_lib::MjolnirError;
use clap::Parser;
pub use tx_only::TxOnly;
#[derive(Parser, Debug)]
pub enum Batch {
    /// Prints nodes related data, like stats,fragments etc.
    TxOnly(tx_only::TxOnly),
    #[clap(subcommand)]
    Adversary(adversary::Adversary),
}

impl Batch {
    pub fn exec(&self) -> Result<(), MjolnirError> {
        match self {
            Batch::TxOnly(tx_only_command) => tx_only_command.exec(),
            Batch::Adversary(adversary_command) => adversary_command.exec(),
        }
    }
}