Skip to content

Commit

Permalink
add extension to downloaded snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
ghubertpalo committed Jul 11, 2023
1 parent a8febdd commit 109f7ac
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mithril-client/src/aggregator_client/snapshot_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl SnapshotClient {
) -> StdResult<PathBuf> {
let filepath = PathBuf::new()
.join(download_dir)
.join(format!("snapshot-{}", snapshot.digest));
.join(format!("snapshot-{}.tar.gz", snapshot.digest));

for url in snapshot.locations.as_slice() {
if self.http_client.probe(url).await.is_ok() {
Expand Down
14 changes: 11 additions & 3 deletions mithril-client/src/services/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,11 @@ mod tests {

let (_, verifier) = setup_genesis();
let genesis_verification_key = verifier.to_verification_key();
build_dummy_snapshot("digest-10", "1234567890".repeat(124).as_str(), &test_path);
build_dummy_snapshot(
"digest-10.tar.gz",
"1234567890".repeat(124).as_str(),
&test_path,
);
let filepath = snapshot_service
.download(
&snapshot,
Expand Down Expand Up @@ -551,7 +555,11 @@ mod tests {

let (_, verifier) = setup_genesis();
let genesis_verification_key = verifier.to_verification_key();
build_dummy_snapshot("digest-10", "1234567890".repeat(124).as_str(), &test_path);
build_dummy_snapshot(
"digest-10.tar.gz",
"1234567890".repeat(124).as_str(),
&test_path,
);
let err = snapshot_service
.download(
&signed_entity,
Expand All @@ -577,7 +585,7 @@ mod tests {
"Expected a SnapshotServiceError when snapshot can not be verified. Got {err:?}: '{err}'"
);
}
let filepath = test_path.join("snapshot-digest-10");
let filepath = test_path.join("snapshot-digest-10.tar.gz");
assert!(filepath.exists());
let unpack_dir = filepath
.parent()
Expand Down

0 comments on commit 109f7ac

Please sign in to comment.