Skip to content

Commit 68a9bae

Browse files
committed
Adapt end-to-end tests to use new cardano-db command
1 parent 4d7b89b commit 68a9bae

File tree

3 files changed

+20
-18
lines changed

3 files changed

+20
-18
lines changed

mithril-test-lab/mithril-end-to-end/src/assertions/check.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::{
2-
attempt, utils::AttemptResult, CardanoTransactionCommand, Client, ClientCommand,
3-
MithrilStakeDistributionCommand, SnapshotCommand,
2+
attempt, utils::AttemptResult, CardanoDbCommand, CardanoTransactionCommand, Client,
3+
ClientCommand, MithrilStakeDistributionCommand,
44
};
55
use anyhow::{anyhow, Context};
66
use mithril_common::{
@@ -283,7 +283,7 @@ pub async fn assert_is_creating_certificate_with_enough_signers(
283283

284284
pub async fn assert_client_can_verify_snapshot(client: &mut Client, digest: &str) -> StdResult<()> {
285285
client
286-
.run(ClientCommand::Snapshot(SnapshotCommand::Download {
286+
.run(ClientCommand::CardanoDb(CardanoDbCommand::Download {
287287
digest: digest.to_string(),
288288
}))
289289
.await?;

mithril-test-lab/mithril-end-to-end/src/mithril/client.rs

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,30 @@ pub struct Client {
1010
}
1111

1212
#[derive(Debug)]
13-
pub enum SnapshotCommand {
13+
pub enum CardanoDbCommand {
1414
List(),
1515
Show { digest: String },
1616
Download { digest: String },
1717
}
1818

19-
impl SnapshotCommand {
19+
impl CardanoDbCommand {
2020
fn name(&self) -> String {
2121
match self {
22-
SnapshotCommand::List() => "list".to_string(),
23-
SnapshotCommand::Show { digest } => format!("show-{digest}"),
24-
SnapshotCommand::Download { digest } => format!("download-{digest}"),
22+
CardanoDbCommand::List() => "list".to_string(),
23+
CardanoDbCommand::Show { digest } => format!("show-{digest}"),
24+
CardanoDbCommand::Download { digest } => format!("download-{digest}"),
2525
}
2626
}
2727

2828
fn cli_arg(&self) -> Vec<String> {
2929
match self {
30-
SnapshotCommand::List() => {
31-
vec!["list".to_string()]
30+
CardanoDbCommand::List() => {
31+
vec!["snapshot".to_string(), "list".to_string()]
3232
}
33-
SnapshotCommand::Show { digest } => {
34-
vec!["show".to_string(), digest.clone()]
33+
CardanoDbCommand::Show { digest } => {
34+
vec!["snapshot".to_string(), "show".to_string(), digest.clone()]
3535
}
36-
SnapshotCommand::Download { digest } => {
36+
CardanoDbCommand::Download { digest } => {
3737
vec!["download".to_string(), digest.clone()]
3838
}
3939
}
@@ -105,15 +105,15 @@ impl CardanoTransactionCommand {
105105

106106
#[derive(Debug)]
107107
pub enum ClientCommand {
108-
Snapshot(SnapshotCommand),
108+
CardanoDb(CardanoDbCommand),
109109
MithrilStakeDistribution(MithrilStakeDistributionCommand),
110110
CardanoTransaction(CardanoTransactionCommand),
111111
}
112112

113113
impl ClientCommand {
114114
fn name(&self) -> String {
115115
match self {
116-
ClientCommand::Snapshot(cmd) => format!("snapshot-{}", cmd.name()),
116+
ClientCommand::CardanoDb(cmd) => format!("cardano-db-{}", cmd.name()),
117117
ClientCommand::MithrilStakeDistribution(cmd) => {
118118
format!("msd-{}", cmd.name())
119119
}
@@ -125,7 +125,9 @@ impl ClientCommand {
125125

126126
fn cli_arg(&self) -> Vec<String> {
127127
let mut args = match self {
128-
ClientCommand::Snapshot(cmd) => [vec!["snapshot".to_string()], cmd.cli_arg()].concat(),
128+
ClientCommand::CardanoDb(cmd) => {
129+
[vec!["cardano-db".to_string()], cmd.cli_arg()].concat()
130+
}
129131
ClientCommand::MithrilStakeDistribution(cmd) => [
130132
vec!["mithril-stake-distribution".to_string()],
131133
cmd.cli_arg(),

mithril-test-lab/mithril-end-to-end/src/mithril/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ mod signer;
88

99
pub use aggregator::{Aggregator, AggregatorConfig};
1010
pub use client::{
11-
CardanoTransactionCommand, Client, ClientCommand, MithrilStakeDistributionCommand,
12-
SnapshotCommand,
11+
CardanoDbCommand, CardanoTransactionCommand, Client, ClientCommand,
12+
MithrilStakeDistributionCommand,
1313
};
1414
pub use infrastructure::{MithrilInfrastructure, MithrilInfrastructureConfig};
1515
pub use relay_aggregator::RelayAggregator;

0 commit comments

Comments
 (0)