Skip to content

Commit

Permalink
Fixed crash from ext_nodes --> hash_nodes
Browse files Browse the repository at this point in the history
- Assumption was that an extension node could never point to a hash
  node, but this can actually happen.
  • Loading branch information
BGluth committed Jan 11, 2024
1 parent b824c59 commit 7fc3c3f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/trie_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,7 @@ fn collapse_ext_node_if_needed<N: PartialTrie>(
nibbles: leaf_nibbles,
value,
} => leaf(ext_nibbles.merge_nibbles(leaf_nibbles), value.clone()),
Node::Hash(_) => extension(*ext_nibbles, child.clone()),
_ => panic!(
"Extension managed to get a child node type that is impossible! (child: {})",
TrieNodeType::from(child)
Expand Down

0 comments on commit 7fc3c3f

Please sign in to comment.