Don't include :code by default in storage proofs (#5060)

* Adds test to verify that the runtime currently is always contained in
the proof

* Start passing the runtime wasm code from the outside

* Fix compilation

* More build fixes

* Make the test work as expected now :)

* Last fixes

* Fixes benchmarks

* Review feedback

* Apply suggestions from code review

Co-Authored-By: Sergei Pepyakin <sergei@parity.io>

* Review feedback

* Fix compilation

Co-authored-by: Sergei Pepyakin <s.pepyakin@gmail.com>
This commit is contained in:
Benjamin Kampmann
2020-03-04 20:26:16 +01:00
committed by GitHub
parent 67837c6233
commit 6ee39261c8
31 changed files with 480 additions and 183 deletions
+4 -2
View File
@@ -18,8 +18,7 @@ use codec::{Encode, Decode};
use frame_support::Hashable;
use sp_state_machine::TestExternalities as CoreTestExternalities;
use sp_core::{
Blake2Hasher, NeverNativeValue, NativeOrEncoded,
traits::CodeExecutor,
Blake2Hasher, NeverNativeValue, NativeOrEncoded, traits::{CodeExecutor, RuntimeCode},
};
use sp_runtime::{ApplyExtrinsicResult, traits::Header as HeaderT};
use sc_executor::{NativeExecutor, WasmExecutionMethod};
@@ -74,8 +73,11 @@ pub fn executor_call<
native_call: Option<NC>,
) -> (Result<NativeOrEncoded<R>>, bool) {
let mut t = t.ext();
let runtime_code = RuntimeCode::from_externalities(&t)
.expect("Code should be part of the externalities");
executor().call::<_, R, NC>(
&mut t,
&runtime_code,
method,
data,
use_native,