[big refactor] Remove crate aliasing. (#4395)

* Rename: Phase 1.

* Unify codec.

* Fixing: Phase 2

* Fixing: Phase 3.

* Fixing: Phase 4.

* Fixing: Phase 5.

* Fixing: Phase 6.

* Fixing: Phase 7.

* Fixing: Phase 8. Tests

* Fixing: Phase 9. Tests!!!

* Fixing: Phase 10. Moar tests!

* Finally done!

* More fixes.

* Rename primitives:: to sp_core::

* Apply renames in finality-grandpa.

* Fix benches.

* Fix benches 2.

* Revert node-template.

* Fix frame-system in our modules.
This commit is contained in:
Tomasz Drwięga
2019-12-16 13:36:49 +01:00
committed by Gavin Wood
parent f14d98a439
commit 8778ca7dc8
485 changed files with 4023 additions and 4005 deletions
@@ -18,7 +18,7 @@
use crate::RIType;
use wasm_interface::{FunctionContext, Result};
use sp_wasm_interface::{FunctionContext, Result};
/// Something that can be converted into a ffi value.
pub trait IntoFFIValue: RIType {
@@ -26,7 +26,7 @@ use crate::wasm::*;
use static_assertions::assert_eq_size;
#[cfg(feature = "std")]
use wasm_interface::{FunctionContext, Result};
use sp_wasm_interface::{FunctionContext, Result};
use codec::{Encode, Decode};
@@ -448,7 +448,7 @@ impl IntoFFIValue for str {
}
#[cfg(feature = "std")]
impl<T: wasm_interface::PointerType> RIType for Pointer<T> {
impl<T: sp_wasm_interface::PointerType> RIType for Pointer<T> {
type FFIType = u32;
}
@@ -475,7 +475,7 @@ impl<T> FromFFIValue for Pointer<T> {
}
#[cfg(feature = "std")]
impl<T: wasm_interface::PointerType> FromFFIValue for Pointer<T> {
impl<T: sp_wasm_interface::PointerType> FromFFIValue for Pointer<T> {
type SelfInstance = Self;
fn from_ffi_value(_: &mut dyn FunctionContext, arg: u32) -> Result<Self> {
@@ -484,7 +484,7 @@ impl<T: wasm_interface::PointerType> FromFFIValue for Pointer<T> {
}
#[cfg(feature = "std")]
impl<T: wasm_interface::PointerType> IntoFFIValue for Pointer<T> {
impl<T: sp_wasm_interface::PointerType> IntoFFIValue for Pointer<T> {
fn into_ffi_value(self, _: &mut dyn FunctionContext) -> Result<u32> {
Ok(self.into())
}
@@ -76,7 +76,7 @@ extern crate self as sp_runtime_interface;
#[doc(hidden)]
#[cfg(feature = "std")]
pub use wasm_interface;
pub use sp_wasm_interface;
#[doc(hidden)]
pub use sp_std;
@@ -130,7 +130,7 @@ pub use sp_std;
/// fn set_or_clear(&mut self, optional: Option<Vec<u8>>);
/// }
///
/// impl Interface for &mut dyn externalities::Externalities {
/// impl Interface for &mut dyn sp_externalities::Externalities {
/// fn call_some_complex_code(data: &[u8]) -> Vec<u8> { Vec::new() }
/// fn set_or_clear(&mut self, optional: Option<Vec<u8>>) {
/// match optional {
@@ -141,11 +141,11 @@ pub use sp_std;
/// }
///
/// pub fn call_some_complex_code(data: &[u8]) -> Vec<u8> {
/// <&mut dyn externalities::Externalities as Interface>::call_some_complex_code(data)
/// <&mut dyn sp_externalities::Externalities as Interface>::call_some_complex_code(data)
/// }
///
/// pub fn set_or_clear(optional: Option<Vec<u8>>) {
/// externalities::with_externalities(|mut ext| Interface::set_or_clear(&mut ext, optional))
/// sp_externalities::with_externalities(|mut ext| Interface::set_or_clear(&mut ext, optional))
/// .expect("`set_or_clear` called outside of an Externalities-provided environment.")
/// }
///
@@ -227,7 +227,7 @@ pub use sp_runtime_interface_proc_macro::runtime_interface;
#[doc(hidden)]
#[cfg(feature = "std")]
pub use externalities::{
pub use sp_externalities::{
set_and_run_with_externalities, with_externalities, Externalities, ExternalitiesExt, ExtensionStore,
};
@@ -249,7 +249,7 @@ pub mod pass_by;
pub trait RIType {
/// The ffi type that is used to represent `Self`.
#[cfg(feature = "std")]
type FFIType: wasm_interface::IntoValue + wasm_interface::TryFromValue;
type FFIType: sp_wasm_interface::IntoValue + sp_wasm_interface::TryFromValue;
#[cfg(not(feature = "std"))]
type FFIType;
}
@@ -260,4 +260,4 @@ pub type Pointer<T> = *mut T;
/// A pointer that can be used in a runtime interface function signature.
#[cfg(feature = "std")]
pub type Pointer<T> = wasm_interface::Pointer<T>;
pub type Pointer<T> = sp_wasm_interface::Pointer<T>;
@@ -28,7 +28,7 @@ use crate::host::*;
use crate::wasm::*;
#[cfg(feature = "std")]
use wasm_interface::{FunctionContext, Pointer, Result};
use sp_wasm_interface::{FunctionContext, Pointer, Result};
use sp_std::{marker::PhantomData, convert::TryFrom};