Skip to content

Commit

Permalink
Add support for new commands for the client in e2e runner
Browse files Browse the repository at this point in the history
  • Loading branch information
Alenar committed Feb 13, 2024
1 parent 222c5a9 commit 21705fc
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion mithril-test-lab/mithril-end-to-end/src/mithril/client.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::utils::MithrilCommand;
use anyhow::{anyhow, Context};
use mithril_common::StdResult;
use mithril_common::{entities::TransactionHash, StdResult};
use std::collections::HashMap;
use std::path::Path;

Expand All @@ -22,10 +22,18 @@ pub enum MithrilStakeDistributionCommand {
Download { hash: String },
}

#[derive(Debug)]
pub enum CardanoTransactionCommand {
ListSets,
ShowSets { hash: String },
Certify { tx_hashes: Vec<TransactionHash> },
}

#[derive(Debug)]
pub enum ClientCommand {
Snapshot(SnapshotCommand),
MithrilStakeDistribution(MithrilStakeDistributionCommand),
CardanoTransaction(CardanoTransactionCommand),
}

impl Client {
Expand Down Expand Up @@ -62,6 +70,33 @@ impl Client {
hash,
],
},
ClientCommand::CardanoTransaction(subcommand) => match subcommand {
CardanoTransactionCommand::ListSets => {
vec![
"--unstable".to_string(),
"cardano-transaction".to_string(),
"sets".to_string(),
"list".to_string(),
]
}
CardanoTransactionCommand::ShowSets { hash } => {
vec![
"--unstable".to_string(),
"cardano-transaction".to_string(),
"sets".to_string(),
"show".to_string(),
hash,
]
}
CardanoTransactionCommand::Certify { tx_hashes } => {
vec![
"--unstable".to_string(),
"cardano-transaction".to_string(),
"certify".to_string(),
tx_hashes.join(","),
]
}
},
};

let exit_status = self
Expand Down

0 comments on commit 21705fc

Please sign in to comment.