Skip to content

Commit 2f0b6e7

Browse files
committed
test(e2): add run of cdb snapshot list --epoch latest-5
1 parent 87662dd commit 2f0b6e7

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use slog_scope::info;
77

88
use mithril_common::{
99
StdResult,
10-
entities::{Epoch, TransactionHash},
10+
entities::{Epoch, EpochSpecifier, TransactionHash},
1111
messages::{
1212
CardanoDatabaseDigestListMessage, CardanoDatabaseSnapshotListMessage,
1313
CardanoDatabaseSnapshotMessage, CardanoStakeDistributionListMessage,
@@ -558,6 +558,13 @@ pub async fn assert_client_can_verify_cardano_database(
558558
client
559559
.run(ClientCommand::CardanoDbV2(CardanoDbV2Command::List))
560560
.await?;
561+
client
562+
.run(ClientCommand::CardanoDbV2(
563+
CardanoDbV2Command::ListPerEpoch {
564+
epoch_specifier: EpochSpecifier::LatestMinusOffset(5),
565+
},
566+
))
567+
.await?;
561568
client
562569
.run(ClientCommand::CardanoDbV2(CardanoDbV2Command::Show {
563570
hash: hash.to_string(),

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

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
use crate::utils::MithrilCommand;
2-
use crate::{ANCILLARY_MANIFEST_VERIFICATION_KEY, GENESIS_VERIFICATION_KEY};
31
use anyhow::{Context, anyhow};
4-
use mithril_common::{StdResult, entities::TransactionHash};
52
use std::collections::HashMap;
63
use std::path::{Path, PathBuf};
74

5+
use mithril_common::StdResult;
6+
use mithril_common::entities::{EpochSpecifier, TransactionHash};
7+
8+
use crate::utils::MithrilCommand;
9+
use crate::{ANCILLARY_MANIFEST_VERIFICATION_KEY, GENESIS_VERIFICATION_KEY};
10+
811
#[derive(Debug)]
912
pub struct Client {
1013
command: MithrilCommand,
@@ -50,6 +53,7 @@ impl CardanoDbCommand {
5053
#[derive(Debug)]
5154
pub enum CardanoDbV2Command {
5255
List,
56+
ListPerEpoch { epoch_specifier: EpochSpecifier },
5357
Show { hash: String },
5458
Download { hash: String },
5559
}
@@ -58,6 +62,9 @@ impl CardanoDbV2Command {
5862
fn name(&self) -> String {
5963
match self {
6064
CardanoDbV2Command::List => "list".to_string(),
65+
CardanoDbV2Command::ListPerEpoch { epoch_specifier } => {
66+
format!("list-epoch-{epoch_specifier}")
67+
}
6168
CardanoDbV2Command::Show { hash } => format!("show-{hash}"),
6269
CardanoDbV2Command::Download { hash } => format!("download-{hash}"),
6370
}
@@ -68,6 +75,14 @@ impl CardanoDbV2Command {
6875
CardanoDbV2Command::List => {
6976
vec!["snapshot".to_string(), "list".to_string()]
7077
}
78+
CardanoDbV2Command::ListPerEpoch { epoch_specifier } => {
79+
vec![
80+
"snapshot".to_string(),
81+
"list".to_string(),
82+
"--epoch".to_string(),
83+
epoch_specifier.to_string(),
84+
]
85+
}
7186
CardanoDbV2Command::Show { hash } => {
7287
vec!["snapshot".to_string(), "show".to_string(), hash.clone()]
7388
}

0 commit comments

Comments
 (0)