@@ -5,7 +5,6 @@ use std::{
5
5
} ;
6
6
7
7
use async_trait:: async_trait;
8
- use config:: Config ;
9
8
use flate2:: read:: GzDecoder ;
10
9
use mithril_common:: {
11
10
certificate_chain:: CertificateVerifier ,
@@ -81,9 +80,6 @@ pub trait SnapshotService: Sync + Send {
81
80
82
81
/// Service used by the Command to perform business oriented tasks.
83
82
pub struct MithrilClientSnapshotService {
84
- /// Configuration settings
85
- config : Arc < Config > ,
86
-
87
83
/// Snapshot HTTP client
88
84
snapshot_client : Arc < SnapshotClient > ,
89
85
@@ -100,14 +96,12 @@ pub struct MithrilClientSnapshotService {
100
96
impl MithrilClientSnapshotService {
101
97
/// Create a new instance of the service.
102
98
pub fn new (
103
- config : Arc < Config > ,
104
99
snapshot_client : Arc < SnapshotClient > ,
105
100
certificate_client : Arc < CertificateClient > ,
106
101
certificate_verifier : Arc < dyn CertificateVerifier > ,
107
102
immutable_digester : Arc < dyn ImmutableDigester > ,
108
103
) -> Self {
109
104
Self {
110
- config,
111
105
snapshot_client,
112
106
certificate_client,
113
107
certificate_verifier,
@@ -198,7 +192,6 @@ impl SnapshotService for MithrilClientSnapshotService {
198
192
. download ( snapshot, pathdir)
199
193
. await
200
194
. map_err ( |e| format ! ( "Could not download file in '{}': {e}" , pathdir. display( ) ) ) ?;
201
- let db_pathdir = Path :: new ( & self . config . get_string ( "download_dir" ) ?) . join ( "db" ) ;
202
195
203
196
self . unpack_snapshot ( & filepath, & unpack_dir)
204
197
. await
@@ -211,12 +204,12 @@ impl SnapshotService for MithrilClientSnapshotService {
211
204
} ) ?;
212
205
let unpacked_snapshot_digest = self
213
206
. immutable_digester
214
- . compute_digest ( & db_pathdir , & certificate. beacon )
207
+ . compute_digest ( & unpack_dir , & certificate. beacon )
215
208
. await
216
209
. map_err ( |e| {
217
210
format ! (
218
211
"Could not compute digest in '{}': {e}" ,
219
- db_pathdir . display( )
212
+ unpack_dir . display( )
220
213
)
221
214
} ) ?;
222
215
0 commit comments