From 9da6ec982cea74c7da8261a02968b999e96cf527 Mon Sep 17 00:00:00 2001 From: fmoletta Date: Fri, 1 Nov 2024 18:57:41 -0300 Subject: [PATCH] Cite sources --- crates/storage/trie/trie.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/storage/trie/trie.rs b/crates/storage/trie/trie.rs index 7e923a641..675702130 100644 --- a/crates/storage/trie/trie.rs +++ b/crates/storage/trie/trie.rs @@ -306,6 +306,7 @@ fn compact_nibbles_to_bytes(compact: &Vec) -> (Vec, bool) { (bytes, last_is_half) } +// Code taken from https://github.com/ethereum/go-ethereum/blob/a1093d98eb3260f2abf340903c2d968b2b891c11/trie/encoding.go#L82 fn compact_to_hex(compact: &Vec) -> Vec { if compact.is_empty() { return vec![]; @@ -320,6 +321,7 @@ fn compact_to_hex(compact: &Vec) -> Vec { base[chop..].to_vec() } +// Code taken from https://github.com/ethereum/go-ethereum/blob/a1093d98eb3260f2abf340903c2d968b2b891c11/trie/encoding.go#L96 fn keybytes_to_hex(keybytes: &Vec) -> Vec { let l = keybytes.len() * 2 + 1; let mut nibbles = vec![0; l];