From 7fc3c3f54b3cec9c6fc5ffc5230910bd1cb77f76 Mon Sep 17 00:00:00 2001 From: BGluth Date: Thu, 11 Jan 2024 09:40:30 -0700 Subject: [PATCH] Fixed crash from `ext_nodes` --> `hash_nodes` - Assumption was that an extension node could never point to a hash node, but this can actually happen. --- src/trie_ops.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/trie_ops.rs b/src/trie_ops.rs index 3743baf..4b7bc6a 100644 --- a/src/trie_ops.rs +++ b/src/trie_ops.rs @@ -545,6 +545,7 @@ fn collapse_ext_node_if_needed( 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)