mithril_client_cli/commands/mithril_stake_distribution/
mod.rs

1//! Commands for the Mithril stake distribution artifact
2mod download;
3mod list;
4
5pub use download::*;
6pub use list::*;
7
8use crate::CommandContext;
9use clap::Subcommand;
10use mithril_client::MithrilResult;
11
12/// Mithril stake distribution management (alias: msd)
13#[derive(Subcommand, Debug, Clone)]
14pub enum MithrilStakeDistributionCommands {
15    /// List certified stake distributions
16    #[clap(arg_required_else_help = false)]
17    List(MithrilStakeDistributionListCommand),
18
19    /// Download and verify the given Mithril stake distribution
20    #[clap(arg_required_else_help = false)]
21    Download(MithrilStakeDistributionDownloadCommand),
22}
23
24impl MithrilStakeDistributionCommands {
25    /// Execute Mithril stake distribution command
26    pub async fn execute(&self, config_builder: CommandContext) -> MithrilResult<()> {
27        match self {
28            Self::List(cmd) => cmd.execute(config_builder).await,
29            Self::Download(cmd) => cmd.execute(config_builder).await,
30        }
31    }
32}