1- use crate :: utils:: MithrilCommand ;
2- use crate :: { ANCILLARY_MANIFEST_VERIFICATION_KEY , GENESIS_VERIFICATION_KEY } ;
31use anyhow:: { Context , anyhow} ;
4- use mithril_common:: { StdResult , entities:: TransactionHash } ;
52use std:: collections:: HashMap ;
63use 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 ) ]
912pub struct Client {
1013 command : MithrilCommand ,
@@ -50,6 +53,7 @@ impl CardanoDbCommand {
5053#[ derive( Debug ) ]
5154pub 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