mithril_client_cli/commands/cardano_transaction/
mod.rs1mod certify;
3mod snapshot_list;
4mod snapshot_show;
5
6pub use certify::*;
7pub use snapshot_list::*;
8pub use snapshot_show::*;
9
10use crate::CommandContext;
11use clap::Subcommand;
12use mithril_client::MithrilResult;
13
14#[derive(Subcommand, Debug, Clone)]
16#[command(about = "Cardano transactions management (alias: ctx)")]
17pub enum CardanoTransactionCommands {
18 #[clap(subcommand)]
20 Snapshot(CardanoTransactionSnapshotCommands),
21
22 #[clap(arg_required_else_help = false)]
24 Certify(CardanoTransactionsCertifyCommand),
25}
26
27#[derive(Subcommand, Debug, Clone)]
29pub enum CardanoTransactionSnapshotCommands {
30 #[clap(arg_required_else_help = false)]
32 List(CardanoTransactionSnapshotListCommand),
33
34 #[clap(arg_required_else_help = false)]
36 Show(CardanoTransactionsSnapshotShowCommand),
37}
38
39impl CardanoTransactionCommands {
40 pub async fn execute(&self, config_builder: CommandContext) -> MithrilResult<()> {
42 match self {
43 Self::Snapshot(cmd) => cmd.execute(config_builder).await,
44 Self::Certify(cmd) => cmd.execute(config_builder).await,
45 }
46 }
47}
48
49impl CardanoTransactionSnapshotCommands {
50 pub async fn execute(&self, config_builder: CommandContext) -> MithrilResult<()> {
52 match self {
53 Self::List(cmd) => cmd.execute(config_builder).await,
54 Self::Show(cmd) => cmd.execute(config_builder).await,
55 }
56 }
57}