Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Fixes compilation after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
bkchr committed Jan 21, 2019
1 parent d0d97ec commit aafec17
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 19 deletions.
17 changes: 10 additions & 7 deletions core/client/src/call_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.

use std::{sync::Arc, cmp::Ord, panic::UnwindSafe};
use codec::Encode;
use codec::{Encode, Decode};
use runtime_primitives::generic::BlockId;
use runtime_primitives::traits::Block as BlockT;
use state_machine::{
Expand All @@ -24,7 +24,7 @@ use state_machine::{
use executor::{RuntimeVersion, RuntimeInfo, NativeVersion};
use hash_db::Hasher;
use trie::MemoryDB;
use primitives::{H256, Blake2Hasher, NativeOrEncoded};
use primitives::{H256, Blake2Hasher, NativeOrEncoded, NeverNativeValue};

use crate::backend;
use crate::error;
Expand Down Expand Up @@ -167,7 +167,9 @@ where
) -> error::Result<Vec<u8>> {
let mut changes = OverlayedChanges::default();
let state = self.backend.state_at(*id)?;
let return_data = state_machine::execute_using_consensus_failure_handler(
let return_data = state_machine::execute_using_consensus_failure_handler::<
_, _, _, _, _, _, fn() -> NeverNativeValue
>(
&state,
self.backend.changes_trie_storage(),
&mut changes,
Expand Down Expand Up @@ -206,7 +208,9 @@ where
//TODO: Find a better way to prevent double block initialization
if method != "Core_initialise_block" && initialised_block.map(|id| id != *at).unwrap_or(true) {
let header = prepare_environment_block()?;
state_machine::execute_using_consensus_failure_handler(
state_machine::execute_using_consensus_failure_handler::<
_, _, _, _, _, R, fn() -> R,
>(
&state,
self.backend.changes_trie_storage(),
changes,
Expand All @@ -229,9 +233,8 @@ where
call_data,
manager,
false,
None,
)
.map(|(result, _, _)| result)?;
native_call,
).map(|(result, _, _)| result)?;

self.backend.destroy_state(state)?;
Ok(result)
Expand Down
2 changes: 1 addition & 1 deletion core/client/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ impl<B, E, Block, RA> Client<B, E, Block, RA> where
let (storage_update, changes_update, storage_changes) = match transaction.state()? {
Some(transaction_state) => {
let mut overlay = Default::default();
let mut r = self.executor.call_at_state::<_, _, NeverNativeValue, fn() -> NeverNativeValue>(
let r = self.executor.call_at_state::<_, _, NeverNativeValue, fn() -> NeverNativeValue>(
transaction_state,
&mut overlay,
"Core_execute_block",
Expand Down
2 changes: 1 addition & 1 deletion core/client/src/light/call_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ where
return Err(ClientErrorKind::NotAvailableOnLightClient.into());
}

self.call(at, method, call_data).map(|cr| NativeOrEncoded::Encoded(cr.return_data))
self.call(at, method, call_data).map(NativeOrEncoded::Encoded)
}

fn runtime_version(&self, id: &BlockId<Block>) -> ClientResult<RuntimeVersion> {
Expand Down
2 changes: 1 addition & 1 deletion core/client/src/runtime_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub use codec::{Encode, Decode};
use crate::error;
use rstd::vec::Vec;
use sr_api_macros::decl_runtime_apis;
use primitives::{OpaqueMetadata, NativeOrEncoded};
use primitives::OpaqueMetadata;
#[cfg(feature = "std")]
use std::panic::UnwindSafe;

Expand Down
8 changes: 4 additions & 4 deletions core/executor/src/native_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use wasm_executor::WasmExecutor;
use wasmi::{Module as WasmModule, ModuleRef as WasmModuleInstanceRef};
use runtime_version::{NativeVersion, RuntimeVersion};
use std::{collections::HashMap, panic::UnwindSafe};
use codec::Decode;
use codec::{Decode, Encode};
use RuntimeInfo;
use primitives::{Blake2Hasher, NativeOrEncoded};
use primitives::storage::well_known_keys;
Expand Down Expand Up @@ -204,10 +204,10 @@ impl<D: NativeExecutionDispatch> CodeExecutor<Blake2Hasher> for NativeExecutor<D
use_native,
onchain_version
.as_ref()
.map_or(false, |v| v.can_call_with(&self.native_version.runtime_version))
.map_or(false, |v| v.can_call_with(&self.native_version.runtime_version)),
native_call,
) {
(_, false) => {
(_, false, _) => {
trace!(
target: "executor",
"Request for native execution failed (native: {}, chain: {})",
Expand All @@ -223,7 +223,7 @@ impl<D: NativeExecutionDispatch> CodeExecutor<Blake2Hasher> for NativeExecutor<D
false
)
}
(false, _) => {
(false, _, _) => {
(
self.fallback
.call_in_wasm_module(ext, module, method, data)
Expand Down
4 changes: 2 additions & 2 deletions core/sr-api-macros/tests/decl_and_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ extern crate substrate_test_client as test_client;

use runtime_primitives::traits::{GetNodeBlockType, Block as BlockT, AuthorityIdFor};
use runtime_primitives::generic::BlockId;
use substrate_client::runtime_api::{self, RuntimeApiInfo};
use substrate_client::error::Result;
use client::runtime_api::{self, RuntimeApiInfo};
use client::error::Result;
use test_client::runtime::Block;

/// The declaration of the `Runtime` type and the implementation of the `GetNodeBlockType`
Expand Down
1 change: 1 addition & 0 deletions core/test-runtime/wasm/Cargo.lock

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

Binary file not shown.
4 changes: 1 addition & 3 deletions node/executor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ mod tests {

let r = executor().call::<_, NeverNativeValue, fn() -> NeverNativeValue>(
&mut t,
BLOATY_CODE,
"Core_initialise_block",
&vec![].and(&from_block_number(1u64)),
true,
Expand All @@ -147,7 +146,6 @@ mod tests {
assert!(r.is_ok());
let v = executor().call::<_, NeverNativeValue, fn() -> NeverNativeValue>(
&mut t,
BLOATY_CODE,
"BlockBuilder_apply_extrinsic",
&vec![].and(&xt()),
true,
Expand Down Expand Up @@ -824,7 +822,7 @@ mod tests {

#[test]
fn full_native_block_import_works_with_changes_trie() {
let mut t = new_test_ext(true);
let mut t = new_test_ext(COMPACT_CODE, true);
Executor::new().call::<_, NeverNativeValue, fn() -> NeverNativeValue>(
&mut t,
"Core_execute_block",
Expand Down
1 change: 1 addition & 0 deletions node/runtime/wasm/Cargo.lock

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

Binary file not shown.

0 comments on commit aafec17

Please sign in to comment.