mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 07:37:57 +00:00
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:
committed by
GitHub
parent
40f6d05a4c
commit
927e13c13a
@@ -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 )
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user