Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mina86 committed Aug 5, 2023
1 parent 1fff0da commit c439acc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions sealable-trie/src/bits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,9 @@ impl<'a> Slice<'a> {
/// Returns `None` if the slice is empty or too long and won’t fit in the
/// destination buffer.
pub(crate) fn try_encode_into(&self, dest: &mut [u8; 36]) -> Option<usize> {
if self.length == 0 {
return None;
}
let bytes = self.bytes();
if bytes.is_empty() || bytes.len() > nodes::MAX_EXTENSION_KEY_SIZE {
return None;
Expand Down
6 changes: 3 additions & 3 deletions sealable-trie/src/trie/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fn test_sanity() {
trie.print();
println!("----");

// trie.set(b"2", &make_hash(2), None).unwrap();
// trie.print();
// println!("----");
trie.set(b"2", &make_hash(2), None).unwrap();
trie.print();
println!("----");
}

0 comments on commit c439acc

Please sign in to comment.