From f4aeebb0bc36904810ae4f5600af30634ffaff60 Mon Sep 17 00:00:00 2001 From: DJO <790521+Alenar@users.noreply.github.com> Date: Tue, 13 Feb 2024 11:38:55 +0100 Subject: [PATCH] Add support for new commands for the client in e2e runner --- .../mithril-end-to-end/src/mithril/client.rs | 37 ++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/mithril-test-lab/mithril-end-to-end/src/mithril/client.rs b/mithril-test-lab/mithril-end-to-end/src/mithril/client.rs index 3a6180b6c24..627ca74c3a0 100644 --- a/mithril-test-lab/mithril-end-to-end/src/mithril/client.rs +++ b/mithril-test-lab/mithril-end-to-end/src/mithril/client.rs @@ -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; @@ -22,10 +22,18 @@ pub enum MithrilStakeDistributionCommand { Download { hash: String }, } +#[derive(Debug)] +pub enum CardanoTransactionCommand { + ListSets, + ShowSets { hash: String }, + Certify { tx_hashes: Vec }, +} + #[derive(Debug)] pub enum ClientCommand { Snapshot(SnapshotCommand), MithrilStakeDistribution(MithrilStakeDistributionCommand), + CardanoTransaction(CardanoTransactionCommand), } impl Client { @@ -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