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 e3f41ed commit ef058aa
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ jobs:
fail-fast: false
matrix:
era: ${{ fromJSON(needs.build-ubuntu-X64.outputs.eras) }}
run_id: [1,2,3,4,5,6,7,8,9,10]
run_id: [1,2,3]
steps:
- name: Checkout sources
uses: actions/checkout@v3
Expand Down
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 ef058aa

Please sign in to comment.