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
+2 -2
View File
@@ -57,10 +57,10 @@ pub use trie_db::{
pub use trie_stream::TrieStream;
/// substrate trie layout
pub struct LayoutV0<H>(sp_std::marker::PhantomData<H>);
pub struct LayoutV0<H>(PhantomData<H>);
/// substrate trie layout, with external value nodes.
pub struct LayoutV1<H>(sp_std::marker::PhantomData<H>);
pub struct LayoutV1<H>(PhantomData<H>);
impl<H> TrieLayout for LayoutV0<H>
where