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:
Kian Paimani
2021-12-04 07:11:25 +01:00
committed by GitHub
parent b2f1374487
commit 4775f11edc
15 changed files with 699 additions and 128 deletions
@@ -17,7 +17,7 @@
use crate::{
build_executor, ensure_matching_spec, extract_code, full_extensions, hash_of, local_spec,
state_machine_call, SharedParams, State, LOG_TARGET,
state_machine_call_with_proof, SharedParams, State, LOG_TARGET,
};
use remote_externalities::rpc_api;
use sc_service::{Configuration, NativeExecutionDispatch};
@@ -167,7 +167,7 @@ where
)
.await;
let _ = state_machine_call::<Block, ExecDispatch>(
let _ = state_machine_call_with_proof::<Block, ExecDispatch>(
&ext,
&executor,
execution,
@@ -17,7 +17,7 @@
use crate::{
build_executor, ensure_matching_spec, extract_code, full_extensions, local_spec, parse,
state_machine_call, SharedParams, LOG_TARGET,
state_machine_call_with_proof, SharedParams, LOG_TARGET,
};
use jsonrpsee::{
types::{traits::SubscriptionClient, Subscription},
@@ -139,7 +139,7 @@ where
let state_ext =
maybe_state_ext.as_mut().expect("state_ext either existed or was just created");
let (mut changes, encoded_result) = state_machine_call::<Block, ExecDispatch>(
let (mut changes, encoded_result) = state_machine_call_with_proof::<Block, ExecDispatch>(
&state_ext,
&executor,
execution,
@@ -23,7 +23,7 @@ use sc_service::Configuration;
use sp_runtime::traits::{Block as BlockT, NumberFor};
use crate::{
build_executor, ensure_matching_spec, extract_code, local_spec, state_machine_call,
build_executor, ensure_matching_spec, extract_code, local_spec, state_machine_call_with_proof,
SharedParams, State, LOG_TARGET,
};
@@ -69,7 +69,7 @@ where
.await;
}
let (_, encoded_result) = state_machine_call::<Block, ExecDispatch>(
let (_, encoded_result) = state_machine_call_with_proof::<Block, ExecDispatch>(
&ext,
&executor,
execution,