From d657a4fb002d2208b17d1635745ded73c4a1362e Mon Sep 17 00:00:00 2001 From: Ron Kuris Date: Tue, 14 Nov 2023 18:59:21 +0000 Subject: [PATCH] Change RangeProofError to RangeTooSmall This is the only kind of RangeProofError From review comments --- firewood/src/db.rs | 2 +- firewood/src/v2/api.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/firewood/src/db.rs b/firewood/src/db.rs index 2541e2898..61667f207 100644 --- a/firewood/src/db.rs +++ b/firewood/src/db.rs @@ -351,7 +351,7 @@ impl + Send + Sync> api::DbView for DbRev { // remove the last key from middle and do a proof on it let last_key = match middle.pop() { - None => return Err(api::Error::RangeProofError("Range too small".to_owned())), + None => return Err(api::Error::RangeTooSmall), Some((last_key, _)) => self.single_key_proof(last_key).await, }; diff --git a/firewood/src/v2/api.rs b/firewood/src/v2/api.rs index 9272576e8..558e1022b 100644 --- a/firewood/src/v2/api.rs +++ b/firewood/src/v2/api.rs @@ -73,8 +73,8 @@ pub enum Error { #[error("Internal error")] InternalError(Box), - #[error("RangeProofError")] - RangeProofError(String), + #[error("Range too small")] + RangeTooSmall, } /// A range proof, consisting of a proof of the first key and the last key,