mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-18 03:41:02 +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 state_machine::Externalities;
|
||||||
pub use runtime_version::{RuntimeVersion, NativeVersion};
|
pub use runtime_version::{RuntimeVersion, NativeVersion};
|
||||||
pub use parity_codec::Codec;
|
pub use parity_codec::Codec;
|
||||||
use primitives::Blake2Hasher;
|
#[doc(hidden)]
|
||||||
|
pub use primitives::Blake2Hasher;
|
||||||
|
|
||||||
/// Provides runtime information.
|
/// Provides runtime information.
|
||||||
pub trait RuntimeInfo {
|
pub trait RuntimeInfo {
|
||||||
|
|||||||
@@ -266,14 +266,13 @@ macro_rules! native_executor_instance {
|
|||||||
native_executor_instance!(IMPL $name, $dispatcher, $version, $code);
|
native_executor_instance!(IMPL $name, $dispatcher, $version, $code);
|
||||||
};
|
};
|
||||||
(IMPL $name:ident, $dispatcher:path, $version:path, $code:expr) => {
|
(IMPL $name:ident, $dispatcher:path, $version:path, $code:expr) => {
|
||||||
use primitives::Blake2Hasher as _Blake2Hasher;
|
|
||||||
impl $crate::NativeExecutionDispatch for $name {
|
impl $crate::NativeExecutionDispatch for $name {
|
||||||
fn native_equivalent() -> &'static [u8] {
|
fn native_equivalent() -> &'static [u8] {
|
||||||
// WARNING!!! This assumes that the runtime was built *before* the main project. Until we
|
// 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.
|
// get a proper build script, this must be strictly adhered to or things will go wrong.
|
||||||
$code
|
$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))?
|
$crate::with_native_environment(ext, move || $dispatcher(method, data))?
|
||||||
.ok_or_else(|| $crate::error::ErrorKind::MethodNotFound(method.to_owned()).into())
|
.ok_or_else(|| $crate::error::ErrorKind::MethodNotFound(method.to_owned()).into())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user