Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix stuff
  • Loading branch information
cecton committed Mar 11, 2020
commit 18bcd5f1ecd7875e4471926fb475391b5a5a6b08
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ trie-db = { version = "0.20.0", default-features = false }
hashbrown = "0.6.1"

# Substrate dependencies
sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "cecton-cumulus-branch" }
sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "cecton-cumulus-branch" }
sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "cecton-cumulus-branch" }
sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "cecton-cumulus-branch" }
Expand Down
24 changes: 13 additions & 11 deletions runtime/src/validate_block/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
use crate::{ParachainBlockData, WitnessData};

use parachain::{ValidationParams, ValidationResult};
use sc_executor::{call_in_wasm, error::Result, WasmExecutionMethod};
use sp_core::traits::CallInWasm;
use sc_executor::{error::Result, WasmExecutionMethod, WasmExecutor};
use sc_block_builder::BlockBuilderProvider;
use sp_blockchain::HeaderBackend;
use sp_consensus::SelectChain;
use sp_io::TestExternalities;
Expand Down Expand Up @@ -45,22 +47,22 @@ fn call_validate_block(
}
.encode();

call_in_wasm::<
(
sp_io::SubstrateHostFunctions,
sc_executor::deprecated_host_interface::SubstrateExternals,
),
>(
let executor = WasmExecutor::new(
WasmExecutionMethod::Interpreted,
Some(1024),
sp_io::SubstrateHostFunctions::host_functions(),
false,
);

executor.call_in_wasm(
&WASM_BINARY,
"validate_block",
&params,
WasmExecutionMethod::Interpreted,
&mut ext_ext,
&WASM_BINARY,
1024,
false,
)
.map(|v| ValidationResult::decode(&mut &v[..]).expect("Decode `ValidationResult`."))
.map(|v| Header::decode(&mut &v.head_data[..]).expect("Decode `Header`."))
.map_err(|err| err.into())
}

fn create_extrinsics() -> Vec<<Block as BlockT>::Extrinsic> {
Expand Down