Companion for #3007 (Track teleported assets) (#436)

* Companion for #3007: Track teleported assets

* Bump

* Try fix the breakage

Co-authored-by: Sergei Shulepov <sergei@parity.io>
This commit is contained in:
Gavin Wood
2021-05-12 22:51:28 +02:00
committed by GitHub
parent 3194febb1f
commit 23d04ceb3c
5 changed files with 282 additions and 239 deletions
@@ -27,7 +27,6 @@ use sc_executor::{
};
use sp_blockchain::HeaderBackend;
use sp_consensus::SelectChain;
use sp_core::traits::CallInWasm;
use sp_io::TestExternalities;
use sp_keyring::AccountKeyring::*;
use sp_runtime::{
@@ -42,6 +41,8 @@ fn call_validate_block(
block_data: ParachainBlockData<Block>,
relay_parent_storage_root: Hash,
) -> Result<Header> {
use sc_executor_common::runtime_blob::RuntimeBlob;
let mut ext = TestExternalities::default();
let mut ext_ext = ext.ext();
let params = ValidationParams {
@@ -61,13 +62,15 @@ fn call_validate_block(
);
executor
.call_in_wasm(
&WASM_BINARY.expect("You need to build the WASM binaries to run the tests!"),
None,
.uncached_call(
RuntimeBlob::uncompress_if_needed(
&WASM_BINARY.expect("You need to build the WASM binaries to run the tests!"),
)
.expect("RuntimeBlob uncompress & parse"),
&mut ext_ext,
false,
"validate_block",
&params,
&mut ext_ext,
sp_core::traits::MissingHostFunctions::Disallow,
)
.map(|v| ValidationResult::decode(&mut &v[..]).expect("Decode `ValidationResult`."))
.map(|v| Header::decode(&mut &v.head_data.0[..]).expect("Decode `Header`."))