From 8a13d78bba36835ac37b18a56b37502abd18c0dd Mon Sep 17 00:00:00 2001 From: teor Date: Fri, 8 Dec 2023 10:27:43 +1000 Subject: [PATCH] Fix import conditional compilation --- zebra-state/src/service/finalized_state.rs | 5 ++++- zebra-state/src/service/finalized_state/disk_format.rs | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/zebra-state/src/service/finalized_state.rs b/zebra-state/src/service/finalized_state.rs index 977e1c529a8..151ed01253b 100644 --- a/zebra-state/src/service/finalized_state.rs +++ b/zebra-state/src/service/finalized_state.rs @@ -43,7 +43,7 @@ pub use disk_db::{DiskDb, DiskWriteBatch, ReadDisk, WriteDisk}; #[allow(unused_imports)] pub use disk_format::{ FromDisk, IntoDisk, OutputIndex, OutputLocation, RawBytes, TransactionIndex, - TransactionLocation, KV, MAX_ON_DISK_HEIGHT, + TransactionLocation, MAX_ON_DISK_HEIGHT, }; pub use zebra_db::ZebraDb; @@ -53,6 +53,9 @@ pub use disk_format::{ SaplingScanningKey, }; +#[cfg(any(test, feature = "proptest-impl"))] +pub use disk_format::KV; + /// The column families supported by the running `zebra-state` database code. /// /// Existing column families that aren't listed here are preserved when the database is opened. diff --git a/zebra-state/src/service/finalized_state/disk_format.rs b/zebra-state/src/service/finalized_state/disk_format.rs index 398953b94a6..0ce04431e54 100644 --- a/zebra-state/src/service/finalized_state/disk_format.rs +++ b/zebra-state/src/service/finalized_state/disk_format.rs @@ -22,15 +22,15 @@ mod tests; pub use block::{TransactionIndex, TransactionLocation, MAX_ON_DISK_HEIGHT}; pub use transparent::{OutputIndex, OutputLocation}; -#[allow(unused_imports)] -pub use tests::KV; - #[cfg(feature = "shielded-scan")] pub use scan::{ SaplingScannedDatabaseEntry, SaplingScannedDatabaseIndex, SaplingScannedResult, SaplingScanningKey, }; +#[cfg(any(test, feature = "proptest-impl"))] +pub use tests::KV; + /// Helper type for writing types to disk as raw bytes. /// Also used to convert key types to raw bytes for disk lookups. pub trait IntoDisk {