mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 17:01:09 +00:00
allow try-runtime and TestExternalities to report PoV size (#10372)
* allow try-runtime and test-externalities to report proof size * self review * fix test * Fix humanized dispaly of bytes * Fix some test * Fix some review grumbles * last of the review comments * fmt * remove unused import * move test * fix import * Update primitives/state-machine/src/testing.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * last touches * fix Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
@@ -67,6 +67,7 @@ impl StorageProof {
|
||||
pub fn into_nodes(self) -> Vec<Vec<u8>> {
|
||||
self.trie_nodes
|
||||
}
|
||||
|
||||
/// Creates a `MemoryDB` from `Self`.
|
||||
pub fn into_memory_db<H: Hasher>(self) -> crate::MemoryDB<H> {
|
||||
self.into()
|
||||
@@ -100,8 +101,9 @@ impl StorageProof {
|
||||
|
||||
/// Returns the estimated encoded size of the compact proof.
|
||||
///
|
||||
/// Runing this operation is a slow operation (build the whole compact proof) and should only be
|
||||
/// in non sensitive path.
|
||||
/// Running this operation is a slow operation (build the whole compact proof) and should only
|
||||
/// be in non sensitive path.
|
||||
///
|
||||
/// Return `None` on error.
|
||||
pub fn encoded_compact_size<H: Hasher>(self, root: H::Out) -> Option<usize> {
|
||||
let compact_proof = self.into_compact_proof::<H>(root);
|
||||
|
||||
Reference in New Issue
Block a user