@@ -6,14 +6,19 @@ use std::sync::Arc;
6
6
use slog:: Logger ;
7
7
8
8
#[ cfg( feature = "fs" ) ]
9
- use mithril_common:: messages:: { CardanoDatabaseSnapshotMessage , CertificateMessage } ;
9
+ use mithril_common:: {
10
+ crypto_helper:: MKProof ,
11
+ messages:: { CardanoDatabaseSnapshotMessage , CertificateMessage } ,
12
+ } ;
10
13
11
14
#[ cfg( feature = "fs" ) ]
12
15
use mithril_cardano_node_internal_database:: entities:: ImmutableFile ;
13
16
14
17
use crate :: aggregator_client:: AggregatorClient ;
15
18
#[ cfg( feature = "fs" ) ]
16
- use crate :: cardano_database_client:: VerifiedDigests ;
19
+ use crate :: cardano_database_client:: {
20
+ VerifiedDigests , proving:: ComputeCardanoDatabaseMessageError ,
21
+ } ;
17
22
#[ cfg( feature = "fs" ) ]
18
23
use crate :: feedback:: FeedbackSender ;
19
24
#[ cfg( feature = "fs" ) ]
@@ -111,6 +116,29 @@ impl CardanoDatabaseClient {
111
116
. await
112
117
}
113
118
119
+ /// Verify a local cardano database
120
+ #[ cfg( feature = "fs" ) ]
121
+ pub async fn verify_cardano_database (
122
+ & self ,
123
+ certificate : & CertificateMessage ,
124
+ cardano_database_snapshot : & CardanoDatabaseSnapshotMessage ,
125
+ immutable_file_range : & ImmutableFileRange ,
126
+ allow_missing : bool ,
127
+ database_dir : & Path ,
128
+ verified_digests : & VerifiedDigests ,
129
+ ) -> Result < MKProof , ComputeCardanoDatabaseMessageError > {
130
+ self . artifact_prover
131
+ . verify_cardano_database (
132
+ certificate,
133
+ cardano_database_snapshot,
134
+ immutable_file_range,
135
+ allow_missing,
136
+ database_dir,
137
+ verified_digests,
138
+ )
139
+ . await
140
+ }
141
+
114
142
/// Checks if immutable directory exists with at least one immutable in it
115
143
#[ cfg( feature = "fs" ) ]
116
144
pub fn check_has_immutables ( & self , database_dir : & Path ) -> MithrilResult < ( ) > {
0 commit comments