mod certify;
mod snapshot_list;
mod snapshot_show;
pub use certify::*;
pub use snapshot_list::*;
pub use snapshot_show::*;
use crate::CommandContext;
use clap::Subcommand;
use mithril_client::MithrilResult;
#[derive(Subcommand, Debug, Clone)]
#[command(about = "Cardano transactions management (alias: ctx)")]
pub enum CardanoTransactionCommands {
#[clap(subcommand)]
Snapshot(CardanoTransactionSnapshotCommands),
#[clap(arg_required_else_help = false)]
Certify(CardanoTransactionsCertifyCommand),
}
#[derive(Subcommand, Debug, Clone)]
pub enum CardanoTransactionSnapshotCommands {
#[clap(arg_required_else_help = false)]
List(CardanoTransactionSnapshotListCommand),
#[clap(arg_required_else_help = false)]
Show(CardanoTransactionsSnapshotShowCommand),
}
impl CardanoTransactionCommands {
pub async fn execute(&self, config_builder: CommandContext) -> MithrilResult<()> {
match self {
Self::Snapshot(cmd) => cmd.execute(config_builder).await,
Self::Certify(cmd) => cmd.execute(config_builder).await,
}
}
}
impl CardanoTransactionSnapshotCommands {
pub async fn execute(&self, config_builder: CommandContext) -> MithrilResult<()> {
match self {
Self::List(cmd) => cmd.execute(config_builder).await,
Self::Show(cmd) => cmd.execute(config_builder).await,
}
}
}