diff --git a/pallas-hardano/src/storage/immutable/mod.rs b/pallas-hardano/src/storage/immutable/mod.rs index 1e53f7d..e6c4e4f 100644 --- a/pallas-hardano/src/storage/immutable/mod.rs +++ b/pallas-hardano/src/storage/immutable/mod.rs @@ -324,7 +324,7 @@ mod tests { use pallas_network::miniprotocols::Point; use pallas_traverse::MultiEraBlock; - use tracing::trace; + use tracing::{trace, warn}; #[test] fn chunk_binary_search_test() { @@ -581,7 +581,14 @@ mod tests { let path = Path::new("../test_data/full_snapshots"); - let dir = std::fs::read_dir(path).expect("can't access full_snapshots dir"); + let dir = match std::fs::read_dir(path) { + Ok(x) => x, + Err(_) => { + warn!("full_snapshot folder not available"); + return; + } + }; + for snapshot in dir { let snapshot = snapshot.unwrap(); let immutable = snapshot.path().join("immutable"); diff --git a/pallas-hardano/src/storage/immutable/primary.rs b/pallas-hardano/src/storage/immutable/primary.rs index 1bbebe3..88aa266 100644 --- a/pallas-hardano/src/storage/immutable/primary.rs +++ b/pallas-hardano/src/storage/immutable/primary.rs @@ -3,10 +3,8 @@ use std::{ io::{BufReader, Read}, }; -use binary_layout::prelude::*; - // See https://input-output-hk.github.io/ouroboros-consensus/pdfs/report.pdf, section 8.2.2 -define_layout!(layout, BigEndian, { +binary_layout::define_layout!(layout, BigEndian, { secondary_offset: u32, }); diff --git a/pallas-hardano/src/storage/immutable/secondary.rs b/pallas-hardano/src/storage/immutable/secondary.rs index 34712bc..50bb61e 100644 --- a/pallas-hardano/src/storage/immutable/secondary.rs +++ b/pallas-hardano/src/storage/immutable/secondary.rs @@ -6,12 +6,10 @@ use std::{ pub type PrimaryIndex = super::primary::Reader; -use binary_layout::prelude::*; - use crate::storage::immutable::{primary, secondary}; // See https://input-output-hk.github.io/ouroboros-consensus/pdfs/report.pdf, section 8.2.2 -define_layout!(layout, BigEndian, { +binary_layout::define_layout!(layout, BigEndian, { block_offset: u64, header_offset: u16, header_size: u16,