aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2024-04-24 19:04:09 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2024-04-25 15:22:32 +0100
commitcae1a320027aefbbcefcccabd18fba11f5ecfba6 (patch)
treeea2568af2b31e4ff894a1ad93fa7dafd121f6b9f
parent2dd8db9c53ddfe9fca8dbfc2bebc75fe2c1be691 (diff)
downloadarti-cae1a320027aefbbcefcccabd18fba11f5ecfba6.tar.gz
arti-cae1a320027aefbbcefcccabd18fba11f5ecfba6.zip
Mark tor_dirmgr::storage::Store::consensus_by_meta cfg(test)
This seems to be used only in tests, since at least 2022.
-rw-r--r--crates/tor-dirmgr/src/storage.rs1
-rw-r--r--crates/tor-dirmgr/src/storage/sqlite.rs1
2 files changed, 2 insertions, 0 deletions
diff --git a/crates/tor-dirmgr/src/storage.rs b/crates/tor-dirmgr/src/storage.rs
index 524a85ed9..e52cbcd4b 100644
--- a/crates/tor-dirmgr/src/storage.rs
+++ b/crates/tor-dirmgr/src/storage.rs
@@ -263,6 +263,7 @@ pub(crate) trait Store: Send + 'static {
/// including its valid-after time and digest.
fn latest_consensus_meta(&self, flavor: ConsensusFlavor) -> Result<Option<ConsensusMeta>>;
/// Try to read the consensus corresponding to the provided metadata object.
+ #[cfg(test)]
fn consensus_by_meta(&self, cmeta: &ConsensusMeta) -> Result<InputString>;
/// Try to read the consensus whose SHA3-256 digests is the provided
/// value, and its metadata.
diff --git a/crates/tor-dirmgr/src/storage/sqlite.rs b/crates/tor-dirmgr/src/storage/sqlite.rs
index 343be00a7..d9a38145a 100644
--- a/crates/tor-dirmgr/src/storage/sqlite.rs
+++ b/crates/tor-dirmgr/src/storage/sqlite.rs
@@ -381,6 +381,7 @@ impl Store for SqliteStore {
Ok(None)
}
}
+ #[cfg(test)]
fn consensus_by_meta(&self, cmeta: &ConsensusMeta) -> Result<InputString> {
if let Some((text, _)) =
self.consensus_by_sha3_digest_of_signed_part(cmeta.sha3_256_of_signed())?