mithril_client_cli/commands/cardano_stake_distribution/
mod.rs

1//! Commands for the Cardano 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/// Cardano stake distribution management (alias: csd)
13#[derive(Subcommand, Debug, Clone)]
14#[command(about = "Cardano stake distribution management (alias: csd)")]
15pub enum CardanoStakeDistributionCommands {
16    /// List certified Cardano stake distributions
17    #[clap(arg_required_else_help = false)]
18    List(CardanoStakeDistributionListCommand),
19
20    /// Download and verify the given Cardano stake distribution
21    #[clap(arg_required_else_help = true)]
22    Download(CardanoStakeDistributionDownloadCommand),
23}
24
25impl CardanoStakeDistributionCommands {
26    /// Execute Cardano stake distribution command
27    pub async fn execute(&self, config_builder: CommandContext) -> MithrilResult<()> {
28        match self {
29            Self::List(cmd) => cmd.execute(config_builder).await,
30            Self::Download(cmd) => cmd.execute(config_builder).await,
31        }
32    }
33}