The crate rename (#4223)

* Adding script for rename, could be applicable for nodes on top of it, too

* add stderr and gitlab ci features

* apply script

* fix now minor details in expected stderr

* Update the Cargo.lock

* fix name: sc-transaction -> sc-tracing

* fix rename in script, too
This commit is contained in:
Benjamin Kampmann
2019-12-02 11:23:53 +01:00
committed by GitHub
parent 40f6d05a4c
commit 927e13c13a
468 changed files with 3383 additions and 3271 deletions
@@ -1,25 +1,25 @@
[package]
name = "substrate-runtime-interface"
name = "sp-runtime-interface"
version = "2.0.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
[dependencies]
wasm-interface = { package = "substrate-wasm-interface", path = "../wasm-interface", optional = true }
rstd = { package = "sr-std", path = "../sr-std", default-features = false }
substrate-runtime-interface-proc-macro = { path = "proc-macro" }
externalities = { package = "substrate-externalities", path = "../externalities", optional = true }
wasm-interface = { package = "sp-wasm-interface", path = "../wasm-interface", optional = true }
rstd = { package = "sp-std", path = "../sr-std", default-features = false }
sp-runtime-interface-proc-macro = { path = "proc-macro" }
externalities = { package = "sp-externalities", path = "../externalities", optional = true }
codec = { package = "parity-scale-codec", version = "1.0.6", default-features = false }
environmental = { version = "1.0.2", optional = true }
static_assertions = "1.0.0"
primitive-types = { version = "0.6.1", default-features = false }
[dev-dependencies]
executor = { package = "substrate-executor", path = "../../client/executor" }
test-wasm = { package = "substrate-runtime-interface-test-wasm", path = "test-wasm" }
state_machine = { package = "substrate-state-machine", path = "../../primitives/state-machine" }
primitives = { package = "substrate-primitives", path = "../core" }
runtime-io = { package = "sr-io", path = "../sr-io" }
executor = { package = "sc-executor", path = "../../client/executor" }
test-wasm = { package = "sp-runtime-interface-test-wasm", path = "test-wasm" }
state_machine = { package = "sp-state-machine", path = "../../primitives/state-machine" }
primitives = { package = "sp-core", path = "../core" }
runtime-io = { package = "sp-io", path = "../sr-io" }
[features]
default = [ "std" ]
@@ -1,5 +1,5 @@
[package]
name = "substrate-runtime-interface-proc-macro"
name = "sp-runtime-interface-proc-macro"
version = "2.0.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
@@ -15,9 +15,9 @@ Inflector = "0.11.4"
proc-macro-crate = "0.1.4"
[dev-dependencies]
runtime-interface = { package = "substrate-runtime-interface", path = ".." }
runtime-interface = { package = "sp-runtime-interface", path = ".." }
codec = { package = "parity-scale-codec", version = "1.0.6", features = [ "derive" ] }
externalities = { package = "substrate-externalities", path = "../../externalities" }
externalities = { package = "sp-externalities", path = "../../externalities" }
rustversion = "1.0.0"
trybuild = "1.0.17"
@@ -101,7 +101,7 @@ mod utils;
/// .expect("`set_or_clear` called outside of an Externalities-provided environment.")
/// }
///
/// /// This type implements the `HostFunctions` trait (from `substrate-wasm-interface`) and
/// /// This type implements the `HostFunctions` trait (from `sp-wasm-interface`) and
/// /// provides the host implementation for the wasm side. The host implementation converts the
/// /// arguments from wasm to native and calls the corresponding native function.
/// ///
@@ -132,7 +132,7 @@ mod utils;
/// }
/// }
///
/// /// The type is actually `ExchangeableFunction` (from `substrate-runtime-interface`).
/// /// The type is actually `ExchangeableFunction` (from `sp-runtime-interface`).
/// ///
/// /// This can be used to replace the implementation of the `call_some_complex_code` function.
/// /// Instead of calling into the host, the callee will automatically call the other
@@ -161,7 +161,7 @@ mod utils;
/// # Argument types
///
/// The macro supports any kind of argument type, as long as it implements `RIType` and the required
/// `FromFFIValue`/`IntoFFIValue` from `substrate-runtime-interface`. The macro will convert each
/// `FromFFIValue`/`IntoFFIValue` from `sp-runtime-interface`. The macro will convert each
/// argument to the corresponding FFI representation and will call into the host using this FFI
/// representation. On the host each argument is converted back to the native representation and
/// the native implementation is called. Any return value is handled in the same way.
@@ -174,7 +174,7 @@ mod utils;
///
/// 1. The generated functions are not callable from the native side.
/// 2. The trait as shown above is not implemented for `Externalities` and is instead implemented
/// for `FunctionExecutor` (from `substrate-wasm-interface`).
/// for `FunctionExecutor` (from `sp-wasm-interface`).
#[proc_macro_attribute]
pub fn runtime_interface(
attrs: proc_macro::TokenStream,
@@ -33,10 +33,10 @@ use inflector::Inflector;
/// Generates the include for the runtime-interface crate.
pub fn generate_runtime_interface_include() -> TokenStream {
if env::var("CARGO_PKG_NAME").unwrap() == "substrate-runtime-interface" {
if env::var("CARGO_PKG_NAME").unwrap() == "sp-runtime-interface" {
TokenStream::new()
} else {
match crate_name("substrate-runtime-interface") {
match crate_name("sp-runtime-interface") {
Ok(crate_name) => {
let crate_name = Ident::new(&crate_name, Span::call_site());
quote!(
@@ -52,10 +52,10 @@ pub fn generate_runtime_interface_include() -> TokenStream {
}
}
/// Generates the access to the `substrate-runtime-interface` crate.
/// Generates the access to the `sp-runtime-interface` crate.
pub fn generate_crate_access() -> TokenStream {
if env::var("CARGO_PKG_NAME").unwrap() == "substrate-runtime-interface" {
quote!( substrate_runtime_interface )
if env::var("CARGO_PKG_NAME").unwrap() == "sp-runtime-interface" {
quote!( sp_runtime_interface )
} else {
quote!( proc_macro_runtime_interface )
}
@@ -59,7 +59,7 @@
//! Declaring a runtime interface is similar to declaring a trait in Rust:
//!
//! ```
//! #[substrate_runtime_interface::runtime_interface]
//! #[sp_runtime_interface::runtime_interface]
//! trait RuntimeInterface {
//! fn some_function(value: &[u8]) -> bool {
//! value.iter().all(|v| *v > 125)
@@ -79,7 +79,7 @@ pub use wasm_interface;
#[doc(hidden)]
pub use rstd;
pub use substrate_runtime_interface_proc_macro::runtime_interface;
pub use sp_runtime_interface_proc_macro::runtime_interface;
#[doc(hidden)]
#[cfg(feature = "std")]
@@ -35,7 +35,7 @@ use rstd::{marker::PhantomData, convert::TryFrom};
#[cfg(not(feature = "std"))]
use rstd::{slice, vec::Vec};
pub use substrate_runtime_interface_proc_macro::{PassByCodec, PassByInner, PassByEnum};
pub use sp_runtime_interface_proc_macro::{PassByCodec, PassByInner, PassByEnum};
/// Something that should be passed between wasm and the host using the given strategy.
///
@@ -145,7 +145,7 @@ impl<T: PassBy> FromFFIValue for T {
///
/// # Example
/// ```
/// # use substrate_runtime_interface::pass_by::{PassBy, Codec};
/// # use sp_runtime_interface::pass_by::{PassBy, Codec};
/// #[derive(codec::Encode, codec::Decode)]
/// struct Test;
///
@@ -237,7 +237,7 @@ pub trait PassByInner: Sized {
///
/// # Example
/// ```
/// # use substrate_runtime_interface::pass_by::{PassBy, Inner, PassByInner};
/// # use sp_runtime_interface::pass_by::{PassBy, Inner, PassByInner};
/// struct Test([u8; 32]);
///
/// impl PassBy for Test {
@@ -311,7 +311,7 @@ impl<T: PassByInner<Inner = I>, I: RIType> RIType for Inner<T, I> {
///
/// # Example
/// ```
/// # use substrate_runtime_interface::pass_by::{PassBy, Enum};
/// # use sp_runtime_interface::pass_by::{PassBy, Enum};
/// #[derive(Clone, Copy)]
/// enum Test {
/// Test1,
@@ -1,15 +1,15 @@
[package]
name = "substrate-runtime-interface-test-wasm"
name = "sp-runtime-interface-test-wasm"
version = "2.0.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
build = "build.rs"
[dependencies]
runtime-interface = { package = "substrate-runtime-interface", path = "../", default-features = false }
rstd = { package = "sr-std", path = "../../sr-std", default-features = false }
runtime-io = { package = "sr-io", path = "../../sr-io", default-features = false }
primitives = { package = "substrate-primitives", path = "../../core", default-features = false }
runtime-interface = { package = "sp-runtime-interface", path = "../", default-features = false }
rstd = { package = "sp-std", path = "../../sr-std", default-features = false }
runtime-io = { package = "sp-io", path = "../../sr-io", default-features = false }
primitives = { package = "sp-core", path = "../../core", default-features = false }
[build-dependencies]
wasm-builder-runner = { package = "substrate-wasm-builder-runner", version = "1.0.3", path = "../../../client/utils/wasm-builder-runner" }