feat: added handling of bottom tier to TieredSmt

This commit is contained in:
Bobbin Threadbare
2023-05-14 02:29:42 -07:00
parent 51ce07cc34
commit b768eade4d
7 changed files with 654 additions and 217 deletions

View File

@@ -92,12 +92,12 @@ impl SimpleSmt {
for (key, value) in entries {
let old_value = tree.update_leaf(key, value)?;
if old_value != EMPTY_WORD || empty_entries.contains(&key) {
return Err(MerkleError::DuplicateValuesForKey(key));
return Err(MerkleError::DuplicateValuesForIndex(key));
}
// if we've processed an empty entry, add the key to the set of empty entry keys, and
// if this key was already in the set, return an error
if value == EMPTY_WORD && !empty_entries.insert(key) {
return Err(MerkleError::DuplicateValuesForKey(key));
return Err(MerkleError::DuplicateValuesForIndex(key));
}
}
Ok(tree)