Skip to content

Commit

Permalink
Change RangeProofError to RangeTooSmall
Browse files Browse the repository at this point in the history
This is the only kind of RangeProofError
From review comments
  • Loading branch information
rkuris committed Nov 14, 2023
1 parent 3ca1a91 commit 11ceb0f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion firewood/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ impl<S: ShaleStore<Node> + Send + Sync> api::DbView for DbRev<S> {

// 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,
};

Expand Down
4 changes: 2 additions & 2 deletions firewood/src/v2/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ pub enum Error {
#[error("Internal error")]
InternalError(Box<dyn std::error::Error + Send>),

#[error("RangeProofError")]
RangeProofError(String),
#[error("Range too small")]
RangeTooSmall,
}

/// A range proof, consisting of a proof of the first key and the last key,
Expand Down

0 comments on commit 11ceb0f

Please sign in to comment.