-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* handle gzip and exceptions more efficiently * wip * unzip archives on the fly, and patch know manifest errors in archive * fmt * fix * patch scan * clippy * add fixtures for gz bug * patch manifest location * display * patch unzip paths * patch glob pattern * clean * patch scan dirs test --------- Co-authored-by: Reginald Tempo <[email protected]> Co-authored-by: Reginald Fitz Forte <[email protected]> Co-authored-by: Beauregard MacDiminuendo <[email protected]> Co-authored-by: Vale LeBrock <[email protected]> Co-authored-by: Gabi O'Bittern <gabi_o'[email protected]> Co-authored-by: Lucietta O'Hind <lucietta_o'[email protected]> Co-authored-by: Beauregard Polecat <[email protected]> Co-authored-by: Nella Fitz Mezzo <[email protected]> Co-authored-by: xyz <xyz> Co-authored-by: Gianna Saint Hart <[email protected]> Co-authored-by: Rupert O'Lento <rupert_o'[email protected]> Co-authored-by: Mariella Ritardando <[email protected]> Co-authored-by: Isa Sforzando <[email protected]> Co-authored-by: Sandra De Staccato <[email protected]>
- Loading branch information
1 parent
d1fa113
commit d212934
Showing
9 changed files
with
120 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file added
BIN
+798 Bytes
tests/fixtures/v7/transaction_95700001-.46cf/95700001-95800000.proof.gz
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
has .gz in manifest bug |
Binary file added
BIN
+119 Bytes
tests/fixtures/v7/transaction_95700001-.46cf/transaction.manifest.gz
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,37 @@ | ||
mod support; | ||
use libra_forensic_db::unzip_temp; | ||
use libra_storage::read_tx_chunk::load_tx_chunk_manifest; | ||
|
||
#[ignore] | ||
#[test] | ||
fn test_unzip() { | ||
let archive_path = support::fixtures::v7_tx_manifest_fixtures_path(); | ||
let (_, temp_unzipped_dir) = unzip_temp::make_temp_unzipped(&archive_path, false).unwrap(); | ||
let (_, temp_unzipped_dir) = | ||
unzip_temp::test_helper_temp_unzipped(&archive_path, false).unwrap(); | ||
|
||
assert!(temp_unzipped_dir.path().exists()); | ||
assert!(temp_unzipped_dir | ||
.path() | ||
.join("transaction.manifest") | ||
.exists()) | ||
} | ||
|
||
#[tokio::test] | ||
async fn test_extract_tx_with_gz_bug_from_archive() -> anyhow::Result<()> { | ||
let fixture_path = support::fixtures::v7_tx_manifest_fixtures_path(); | ||
let fixture_path = fixture_path.parent().unwrap(); | ||
|
||
let (archive_path, temppath_opt) = | ||
unzip_temp::maybe_handle_gz(&fixture_path.join("transaction_95700001-.46cf"))?; | ||
|
||
let temp_unzipped = temppath_opt.unwrap(); | ||
assert!(temp_unzipped.path().exists()); | ||
|
||
let manifest = load_tx_chunk_manifest(&archive_path.join("transaction.manifest"))?; | ||
|
||
let chunk_path = temp_unzipped.path().join(&manifest.chunks[0].transactions); | ||
|
||
assert!(chunk_path.exists()); | ||
|
||
Ok(()) | ||
} |