From cf984afb87802665c8e750f74dccc4b7c167c5f7 Mon Sep 17 00:00:00 2001 From: Alexey Shekhirin Date: Wed, 16 Oct 2024 21:55:32 +0100 Subject: [PATCH] chore(hash-builder): use `RlpNode::as_hash` (#59) --- src/hash_builder/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hash_builder/mod.rs b/src/hash_builder/mod.rs index 66783e2..8ddd860 100644 --- a/src/hash_builder/mod.rs +++ b/src/hash_builder/mod.rs @@ -170,8 +170,8 @@ impl HashBuilder { fn current_root(&self) -> B256 { if let Some(node_ref) = self.stack.last() { - if node_ref.len() == B256::len_bytes() + 1 { - B256::from_slice(&node_ref[1..]) + if let Some(hash) = node_ref.as_hash() { + hash } else { keccak256(node_ref) }