feat: generalize some functions in sp-trie (#12376)

* feat: add to_memory_db to StorageProof

* feat: add iter method and generalize iter_nodes

* fmt

* feat: generalize `encode_compact` like `decode_compact`, add to_compact_proof to StorageProof

* fix to_compact_proof

* improve by suggestions

* improve by suggestions

Co-authored-by: Bastian Köcher <git@kchr.de>
This commit is contained in:
yjh
2022-10-25 15:04:32 +08:00
committed by GitHub
parent 54204d7628
commit 9375665218
7 changed files with 56 additions and 45 deletions
@@ -980,7 +980,7 @@ pub mod tests {
let proof = backend.extract_proof().unwrap();
let mut nodes = Vec::new();
for node in proof.iter_nodes() {
for node in proof.into_iter_nodes() {
let hash = BlakeTwo256::hash(&node);
// Only insert the node/value that contains the important data.
if hash != value_hash {