From 4ea3ac1c4aaa38e0927fa50ba35d22a407c3e21f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Mon, 4 Feb 2019 11:26:51 +0100 Subject: [PATCH] Use absolute path in native_executor for `Blake2Hasher` (#1671) --- substrate/core/executor/src/lib.rs | 3 ++- substrate/core/executor/src/native_executor.rs | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/substrate/core/executor/src/lib.rs b/substrate/core/executor/src/lib.rs index 898e973164..ab38408eeb 100644 --- a/substrate/core/executor/src/lib.rs +++ b/substrate/core/executor/src/lib.rs @@ -46,7 +46,8 @@ pub use native_executor::{with_native_environment, NativeExecutor, NativeExecuti pub use state_machine::Externalities; pub use runtime_version::{RuntimeVersion, NativeVersion}; pub use parity_codec::Codec; -use primitives::Blake2Hasher; +#[doc(hidden)] +pub use primitives::Blake2Hasher; /// Provides runtime information. pub trait RuntimeInfo { diff --git a/substrate/core/executor/src/native_executor.rs b/substrate/core/executor/src/native_executor.rs index 7f201de432..2c2021179a 100644 --- a/substrate/core/executor/src/native_executor.rs +++ b/substrate/core/executor/src/native_executor.rs @@ -266,14 +266,13 @@ macro_rules! native_executor_instance { native_executor_instance!(IMPL $name, $dispatcher, $version, $code); }; (IMPL $name:ident, $dispatcher:path, $version:path, $code:expr) => { - use primitives::Blake2Hasher as _Blake2Hasher; impl $crate::NativeExecutionDispatch for $name { fn native_equivalent() -> &'static [u8] { // WARNING!!! This assumes that the runtime was built *before* the main project. Until we // get a proper build script, this must be strictly adhered to or things will go wrong. $code } - fn dispatch(ext: &mut $crate::Externalities<_Blake2Hasher>, method: &str, data: &[u8]) -> $crate::error::Result> { + fn dispatch(ext: &mut $crate::Externalities<$crate::Blake2Hasher>, method: &str, data: &[u8]) -> $crate::error::Result> { $crate::with_native_environment(ext, move || $dispatcher(method, data))? .ok_or_else(|| $crate::error::ErrorKind::MethodNotFound(method.to_owned()).into()) }