1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
mod adversary;
mod all;
mod tx_only;

use crate::mjolnir_lib::MjolnirError;
pub use adversary::Adversary;
pub use all::AllFragments;
use clap::Parser;
pub use tx_only::TxOnly;
#[derive(Parser, Debug)]
pub enum Standard {
    /// Put load on endpoint using transaction fragments only.
    TxOnly(tx_only::TxOnly),
    /// Put load on endpoint using all supported fragment types
    All(all::AllFragments),
    /// Put load on endpoint using invalid fragments
    #[clap(subcommand)]
    Adversary(adversary::Adversary),
}

impl Standard {
    pub fn exec(&self) -> Result<(), MjolnirError> {
        match self {
            Standard::TxOnly(tx_only_command) => tx_only_command.exec(),
            Standard::All(all_command) => all_command.exec(),
            Standard::Adversary(adversary) => adversary.exec(),
        }
    }
}