mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 03:27:58 +00:00
Use absolute path in native_executor for Blake2Hasher (#1671)
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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<Vec<u8>> {
|
||||
fn dispatch(ext: &mut $crate::Externalities<$crate::Blake2Hasher>, method: &str, data: &[u8]) -> $crate::error::Result<Vec<u8>> {
|
||||
$crate::with_native_environment(ext, move || $dispatcher(method, data))?
|
||||
.ok_or_else(|| $crate::error::ErrorKind::MethodNotFound(method.to_owned()).into())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user