arnaucube
arnaucube/miden-cryptoPublic Self-hosted repository
fix: misspelled variant name in TieredSmtProofError
Bobbin Threadbare bobbinth@protonmail.com
Fri, 04 Aug 2023 22:46:23 -0700
commit

b3e7578ab228c82936a57ae98e7d62987d4357aa

parent

5c6a20cb6094fba6b2e915c87cf44409b2659b3f

2 files changed, 16 insertions(+), 17 deletions(-)

jump to
M src/merkle/tiered_smt/error.rs → src/merkle/tiered_smt/error.rs

@@ -3,11 +3,11 @@

#[derive(Debug, PartialEq, Eq)] pub enum TieredSmtProofError { EntriesEmpty, - PathTooLong, - NotATierPath(u8), - MultipleEntriesOutsideLastTier, EmptyValueNotAllowed, - UnmatchingPrefixes(u64, u64), + MismatchedPrefixes(u64, u64), + MultipleEntriesOutsideLastTier, + NotATierPath(u8), + PathTooLong, } impl Display for TieredSmtProofError {

@@ -16,30 +16,29 @@ match self {

TieredSmtProofError::EntriesEmpty => { write!(f, "Missing entries for tiered sparse merkle tree proof") } - TieredSmtProofError::PathTooLong => { + TieredSmtProofError::EmptyValueNotAllowed => { write!( f, - "Path longer than maximum depth of 64 for tiered sparse merkle tree proof" + "The empty value [0, 0, 0, 0] is not allowed inside a tiered sparse merkle tree" ) } + TieredSmtProofError::MismatchedPrefixes(first, second) => { + write!(f, "Not all leaves have the same prefix. First {first} second {second}") + } + TieredSmtProofError::MultipleEntriesOutsideLastTier => { + write!(f, "Multiple entries are only allowed for the last tier (depth 64)") + } TieredSmtProofError::NotATierPath(got) => { write!( f, - "Path length does not correspond to a tier. Got {} Expected one of 16,32,48,64", - got + "Path length does not correspond to a tier. Got {got} Expected one of 16, 32, 48, 64" ) } - TieredSmtProofError::MultipleEntriesOutsideLastTier => { - write!(f, "Multiple entries are only allowed for the last tier (depth 64)") - } - TieredSmtProofError::EmptyValueNotAllowed => { + TieredSmtProofError::PathTooLong => { write!( f, - "The empty value [0,0,0,0] is not allowed inside a tiered sparse merkle tree" + "Path longer than maximum depth of 64 for tiered sparse merkle tree proof" ) - } - TieredSmtProofError::UnmatchingPrefixes(first, second) => { - write!(f, "Not all leaves have the same prefix. First {} second {}", first, second) } } }
M src/merkle/tiered_smt/proof.rs → src/merkle/tiered_smt/proof.rs

@@ -68,7 +68,7 @@ return Err(TieredSmtProofError::EmptyValueNotAllowed);

} let current = get_key_prefix(&entry.0); if prefix != current { - return Err(TieredSmtProofError::UnmatchingPrefixes(prefix, current)); + return Err(TieredSmtProofError::MismatchedPrefixes(prefix, current)); } } }