mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 17:01:09 +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,17 +1,17 @@
|
||||
[package]
|
||||
name = "sr-api"
|
||||
name = "sp-api"
|
||||
version = "2.0.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false }
|
||||
sr-api-proc-macro = { path = "proc-macro" }
|
||||
primitives = { package = "substrate-primitives", path = "../core", default-features = false }
|
||||
rstd = { package = "sr-std", path = "../sr-std", default-features = false }
|
||||
sr-primitives = { path = "../sr-primitives", default-features = false }
|
||||
sr-version = { path = "../sr-version", default-features = false }
|
||||
state-machine = { package = "substrate-state-machine", path = "../../primitives/state-machine", optional = true }
|
||||
sp-api-proc-macro = { path = "proc-macro" }
|
||||
primitives = { package = "sp-core", path = "../core", default-features = false }
|
||||
rstd = { package = "sp-std", path = "../sr-std", default-features = false }
|
||||
sp-runtime = { path = "../sr-primitives", default-features = false }
|
||||
sp-version = { path = "../sr-version", default-features = false }
|
||||
state-machine = { package = "sp-state-machine", path = "../../primitives/state-machine", optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
criterion = "0.3.0"
|
||||
@@ -27,7 +27,7 @@ std = [
|
||||
"codec/std",
|
||||
"primitives/std",
|
||||
"rstd/std",
|
||||
"sr-primitives/std",
|
||||
"sp-runtime/std",
|
||||
"state-machine",
|
||||
"sr-version/std",
|
||||
"sp-version/std",
|
||||
]
|
||||
|
||||
@@ -19,10 +19,10 @@ use test_client::{
|
||||
DefaultTestClientBuilderExt, TestClientBuilder,
|
||||
TestClientBuilderExt, runtime::TestAPI,
|
||||
};
|
||||
use sr_primitives::{generic::BlockId, traits::ProvideRuntimeApi};
|
||||
use sp_runtime::{generic::BlockId, traits::ProvideRuntimeApi};
|
||||
use state_machine::ExecutionStrategy;
|
||||
|
||||
fn sr_api_benchmark(c: &mut Criterion) {
|
||||
fn sp_api_benchmark(c: &mut Criterion) {
|
||||
c.bench_function("add one with same runtime api", |b| {
|
||||
let client = test_client::new();
|
||||
let runtime_api = client.runtime_api();
|
||||
@@ -68,5 +68,5 @@ fn sr_api_benchmark(c: &mut Criterion) {
|
||||
});
|
||||
}
|
||||
|
||||
criterion_group!(benches, sr_api_benchmark);
|
||||
criterion_group!(benches, sp_api_benchmark);
|
||||
criterion_main!(benches);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "sr-api-proc-macro"
|
||||
name = "sp-api-proc-macro"
|
||||
version = "2.0.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
edition = "2018"
|
||||
@@ -15,9 +15,9 @@ blake2-rfc = "0.2.18"
|
||||
proc-macro-crate = "0.1.4"
|
||||
|
||||
[dev-dependencies]
|
||||
sr-api = { path = ".." }
|
||||
sr-primitives = { path = "../../sr-primitives" }
|
||||
sr-version = { path = "../../sr-version" }
|
||||
sp-api = { path = ".." }
|
||||
sp-runtime = { path = "../../sr-primitives" }
|
||||
sp-version = { path = "../../sr-version" }
|
||||
test-client = { package = "substrate-test-runtime-client", path = "../../../test/utils/runtime/client" }
|
||||
|
||||
# Required for the doc tests
|
||||
|
||||
@@ -44,9 +44,9 @@ mod utils;
|
||||
/// # Example
|
||||
///
|
||||
/// ```rust
|
||||
/// use sr_version::create_runtime_str;
|
||||
/// use sp_version::create_runtime_str;
|
||||
/// #
|
||||
/// # use sr_primitives::traits::GetNodeBlockType;
|
||||
/// # use sp_runtime::traits::GetNodeBlockType;
|
||||
/// # use test_client::runtime::{Block, Header};
|
||||
/// #
|
||||
/// # /// The declaration of the `Runtime` type and the implementation of the `GetNodeBlockType`
|
||||
@@ -56,7 +56,7 @@ mod utils;
|
||||
/// # type NodeBlock = Block;
|
||||
/// # }
|
||||
/// #
|
||||
/// # sr_api::decl_runtime_apis! {
|
||||
/// # sp_api::decl_runtime_apis! {
|
||||
/// # /// Declare the api trait.
|
||||
/// # pub trait Balance {
|
||||
/// # /// Get the balance.
|
||||
@@ -70,9 +70,9 @@ mod utils;
|
||||
/// # }
|
||||
///
|
||||
/// /// All runtime api implementations need to be done in one call of the macro!
|
||||
/// sr_api::impl_runtime_apis! {
|
||||
/// # impl sr_api::Core<Block> for Runtime {
|
||||
/// # fn version() -> sr_version::RuntimeVersion {
|
||||
/// sp_api::impl_runtime_apis! {
|
||||
/// # impl sp_api::Core<Block> for Runtime {
|
||||
/// # fn version() -> sp_version::RuntimeVersion {
|
||||
/// # unimplemented!()
|
||||
/// # }
|
||||
/// # fn execute_block(_block: Block) {}
|
||||
@@ -96,7 +96,7 @@ mod utils;
|
||||
/// }
|
||||
///
|
||||
/// /// Runtime version. This needs to be declared for each runtime.
|
||||
/// pub const VERSION: sr_version::RuntimeVersion = sr_version::RuntimeVersion {
|
||||
/// pub const VERSION: sp_version::RuntimeVersion = sp_version::RuntimeVersion {
|
||||
/// spec_name: create_runtime_str!("node"),
|
||||
/// impl_name: create_runtime_str!("test-node"),
|
||||
/// authoring_version: 1,
|
||||
@@ -127,7 +127,7 @@ pub fn impl_runtime_apis(input: TokenStream) -> TokenStream {
|
||||
/// # Example
|
||||
///
|
||||
/// ```rust
|
||||
/// sr_api::decl_runtime_apis! {
|
||||
/// sp_api::decl_runtime_apis! {
|
||||
/// /// Declare the api trait.
|
||||
/// pub trait Balance {
|
||||
/// /// Get the balance.
|
||||
@@ -159,7 +159,7 @@ pub fn impl_runtime_apis(input: TokenStream) -> TokenStream {
|
||||
/// spec version!). Such a method also does not need to be implemented in the runtime.
|
||||
///
|
||||
/// ```rust
|
||||
/// sr_api::decl_runtime_apis! {
|
||||
/// sp_api::decl_runtime_apis! {
|
||||
/// /// Declare the api trait.
|
||||
/// #[api_version(2)]
|
||||
/// pub trait Balance {
|
||||
|
||||
@@ -32,22 +32,22 @@ pub fn unwrap_or_error(res: Result<TokenStream>) -> TokenStream {
|
||||
}
|
||||
|
||||
fn generate_hidden_includes_mod_name(unique_id: &'static str) -> Ident {
|
||||
Ident::new(&format!("sr_api_hidden_includes_{}", unique_id), Span::call_site())
|
||||
Ident::new(&format!("sp_api_hidden_includes_{}", unique_id), Span::call_site())
|
||||
}
|
||||
|
||||
/// Generates the hidden includes that are required to make the macro independent from its scope.
|
||||
pub fn generate_hidden_includes(unique_id: &'static str) -> TokenStream {
|
||||
if env::var("CARGO_PKG_NAME").unwrap() == "sr-api" {
|
||||
if env::var("CARGO_PKG_NAME").unwrap() == "sp-api" {
|
||||
TokenStream::new()
|
||||
} else {
|
||||
let mod_name = generate_hidden_includes_mod_name(unique_id);
|
||||
match crate_name("sr-api") {
|
||||
match crate_name("sp-api") {
|
||||
Ok(client_name) => {
|
||||
let client_name = Ident::new(&client_name, Span::call_site());
|
||||
quote!(
|
||||
#[doc(hidden)]
|
||||
mod #mod_name {
|
||||
pub extern crate #client_name as sr_api;
|
||||
pub extern crate #client_name as sp_api;
|
||||
}
|
||||
)
|
||||
},
|
||||
@@ -60,13 +60,13 @@ pub fn generate_hidden_includes(unique_id: &'static str) -> TokenStream {
|
||||
}.into()
|
||||
}
|
||||
|
||||
/// Generates the access to the `substrate_client` crate.
|
||||
/// Generates the access to the `sc_client` crate.
|
||||
pub fn generate_crate_access(unique_id: &'static str) -> TokenStream {
|
||||
if env::var("CARGO_PKG_NAME").unwrap() == "sr-api" {
|
||||
if env::var("CARGO_PKG_NAME").unwrap() == "sp-api" {
|
||||
quote!( crate )
|
||||
} else {
|
||||
let mod_name = generate_hidden_includes_mod_name(unique_id);
|
||||
quote!( self::#mod_name::sr_api )
|
||||
quote!( self::#mod_name::sp_api )
|
||||
}.into()
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ pub use primitives::NativeOrEncoded;
|
||||
#[cfg(not(feature = "std"))]
|
||||
pub use primitives::to_substrate_wasm_fn_return_value;
|
||||
#[doc(hidden)]
|
||||
pub use sr_primitives::{
|
||||
pub use sp_runtime::{
|
||||
traits::{
|
||||
Block as BlockT, GetNodeBlockType, GetRuntimeBlockType,
|
||||
Header as HeaderT, ApiRef, RuntimeApiInfo, Hash as HashT,
|
||||
@@ -50,7 +50,7 @@ pub use sr_primitives::{
|
||||
#[doc(hidden)]
|
||||
pub use primitives::{offchain, ExecutionContext};
|
||||
#[doc(hidden)]
|
||||
pub use sr_version::{ApiId, RuntimeVersion, ApisVec, create_apis_vec};
|
||||
pub use sp_version::{ApiId, RuntimeVersion, ApisVec, create_apis_vec};
|
||||
#[doc(hidden)]
|
||||
pub use rstd::{slice, mem};
|
||||
#[cfg(feature = "std")]
|
||||
@@ -61,7 +61,7 @@ use primitives::OpaqueMetadata;
|
||||
#[cfg(feature = "std")]
|
||||
use std::{panic::UnwindSafe, cell::RefCell};
|
||||
|
||||
pub use sr_api_proc_macro::{decl_runtime_apis, impl_runtime_apis};
|
||||
pub use sp_api_proc_macro::{decl_runtime_apis, impl_runtime_apis};
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
/// A type that records all accessed trie nodes and generates a proof out of it.
|
||||
@@ -176,7 +176,7 @@ pub trait CallRuntimeAt<Block: BlockT> {
|
||||
/// Extracts the `Api::Error` for a type that provides a runtime api.
|
||||
#[cfg(feature = "std")]
|
||||
pub type ApiErrorFor<T, Block> = <
|
||||
<T as sr_primitives::traits::ProvideRuntimeApi>::Api as ApiExt<Block>
|
||||
<T as sp_runtime::traits::ProvideRuntimeApi>::Api as ApiExt<Block>
|
||||
>::Error;
|
||||
|
||||
decl_runtime_apis! {
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
[package]
|
||||
name = "sr-api-test"
|
||||
name = "sp-api-test"
|
||||
version = "2.0.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
sr-api = { path = "../" }
|
||||
sp-api = { path = "../" }
|
||||
test-client = { package = "substrate-test-runtime-client", path = "../../../test/utils/runtime/client" }
|
||||
sr-version = { path = "../../sr-version" }
|
||||
sr-primitives = { path = "../../sr-primitives" }
|
||||
sp-version = { path = "../../sr-version" }
|
||||
sp-runtime = { path = "../../sr-primitives" }
|
||||
sp-blockchain = { path = "../../blockchain" }
|
||||
consensus_common = { package = "substrate-consensus-common", path = "../../../primitives/consensus/common" }
|
||||
consensus_common = { package = "sp-consensus", path = "../../../primitives/consensus/common" }
|
||||
codec = { package = "parity-scale-codec", version = "1.0.0" }
|
||||
state-machine = { package = "substrate-state-machine", path = "../../../primitives/state-machine" }
|
||||
state-machine = { package = "sp-state-machine", path = "../../../primitives/state-machine" }
|
||||
trybuild = "1.0.17"
|
||||
rustversion = "1.0.0"
|
||||
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use sr_api::{RuntimeApiInfo, decl_runtime_apis, impl_runtime_apis};
|
||||
use sp_api::{RuntimeApiInfo, decl_runtime_apis, impl_runtime_apis};
|
||||
|
||||
use sr_primitives::{traits::{GetNodeBlockType, Block as BlockT}, generic::BlockId};
|
||||
use sp_runtime::{traits::{GetNodeBlockType, Block as BlockT}, generic::BlockId};
|
||||
|
||||
use test_client::runtime::Block;
|
||||
use sp_blockchain::Result;
|
||||
@@ -68,8 +68,8 @@ impl_runtime_apis! {
|
||||
fn same_name() {}
|
||||
}
|
||||
|
||||
impl sr_api::Core<Block> for Runtime {
|
||||
fn version() -> sr_version::RuntimeVersion {
|
||||
impl sp_api::Core<Block> for Runtime {
|
||||
fn version() -> sp_version::RuntimeVersion {
|
||||
unimplemented!()
|
||||
}
|
||||
fn execute_block(_: Block) {
|
||||
@@ -124,5 +124,5 @@ fn check_runtime_api_versions_contains<T: RuntimeApiInfo + ?Sized>() {
|
||||
fn check_runtime_api_versions() {
|
||||
check_runtime_api_versions_contains::<dyn Api<Block, Error = ()>>();
|
||||
check_runtime_api_versions_contains::<dyn ApiWithCustomVersion<Block, Error = ()>>();
|
||||
check_runtime_api_versions_contains::<dyn sr_api::Core<Block, Error = ()>>();
|
||||
check_runtime_api_versions_contains::<dyn sp_api::Core<Block, Error = ()>>();
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ use test_client::{
|
||||
DefaultTestClientBuilderExt, TestClientBuilder,
|
||||
runtime::{TestAPI, DecodeFails, Transfer, Header},
|
||||
};
|
||||
use sr_primitives::{
|
||||
use sp_runtime::{
|
||||
generic::BlockId,
|
||||
traits::{ProvideRuntimeApi, Header as HeaderT, Hash as HashT},
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
sr_api::decl_runtime_apis! {
|
||||
sp_api::decl_runtime_apis! {
|
||||
pub trait Api {
|
||||
fn test(&self);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use sr_primitives::traits::GetNodeBlockType;
|
||||
use sp_runtime::traits::GetNodeBlockType;
|
||||
use test_client::runtime::Block;
|
||||
|
||||
/// The declaration of the `Runtime` type and the implementation of the `GetNodeBlockType`
|
||||
@@ -8,7 +8,7 @@ impl GetNodeBlockType for Runtime {
|
||||
type NodeBlock = Block;
|
||||
}
|
||||
|
||||
sr_api::decl_runtime_apis! {
|
||||
sp_api::decl_runtime_apis! {
|
||||
pub trait Api {
|
||||
#[changed_in(2)]
|
||||
fn test(data: u64);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use sr_primitives::traits::Block as BlockT;
|
||||
use sp_runtime::traits::Block as BlockT;
|
||||
|
||||
sr_api::decl_runtime_apis! {
|
||||
sp_api::decl_runtime_apis! {
|
||||
pub trait Api<Block: BlockT> {
|
||||
fn test();
|
||||
}
|
||||
|
||||
@@ -10,10 +10,10 @@ error: `Block: BlockT` generic parameter will be added automatically by the `dec
|
||||
4 | pub trait Api<Block: BlockT> {
|
||||
| ^^^^^^
|
||||
|
||||
warning: unused import: `sr_primitives::traits::Block as BlockT`
|
||||
warning: unused import: `sp_runtime::traits::Block as BlockT`
|
||||
--> $DIR/declaring_old_block.rs:1:5
|
||||
|
|
||||
1 | use sr_primitives::traits::Block as BlockT;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
1 | use sp_runtime::traits::Block as BlockT;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `#[warn(unused_imports)]` on by default
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
use sr_primitives::traits::Block as BlockT;
|
||||
use sp_runtime::traits::Block as BlockT;
|
||||
|
||||
sr_api::decl_runtime_apis! {
|
||||
sp_api::decl_runtime_apis! {
|
||||
pub trait Api<B: BlockT> {
|
||||
fn test();
|
||||
}
|
||||
|
||||
+3
-3
@@ -4,10 +4,10 @@ error: `Block: BlockT` generic parameter will be added automatically by the `dec
|
||||
4 | pub trait Api<B: BlockT> {
|
||||
| ^^^^^^
|
||||
|
||||
warning: unused import: `sr_primitives::traits::Block as BlockT`
|
||||
warning: unused import: `sp_runtime::traits::Block as BlockT`
|
||||
--> $DIR/declaring_own_block_with_different_name.rs:1:5
|
||||
|
|
||||
1 | use sr_primitives::traits::Block as BlockT;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
1 | use sp_runtime::traits::Block as BlockT;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `#[warn(unused_imports)]` on by default
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use sr_primitives::traits::GetNodeBlockType;
|
||||
use sp_runtime::traits::GetNodeBlockType;
|
||||
use test_client::runtime::Block;
|
||||
|
||||
/// The declaration of the `Runtime` type and the implementation of the `GetNodeBlockType`
|
||||
@@ -8,12 +8,12 @@ impl GetNodeBlockType for Runtime {
|
||||
type NodeBlock = Block;
|
||||
}
|
||||
|
||||
sr_api::decl_runtime_apis! {
|
||||
sp_api::decl_runtime_apis! {
|
||||
pub trait Api {
|
||||
fn test(data: u64);
|
||||
}
|
||||
}
|
||||
|
||||
sr_api::impl_runtime_apis! {}
|
||||
sp_api::impl_runtime_apis! {}
|
||||
|
||||
fn main() {}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
error: No api implementation given!
|
||||
--> $DIR/empty_impl_runtime_apis_call.rs:17:1
|
||||
|
|
||||
17 | sr_api::impl_runtime_apis! {}
|
||||
17 | sp_api::impl_runtime_apis! {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ in this macro invocation
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use sr_primitives::traits::{GetNodeBlockType, Block as BlockT};
|
||||
use sp_runtime::traits::{GetNodeBlockType, Block as BlockT};
|
||||
use test_client::runtime::Block;
|
||||
|
||||
/// The declaration of the `Runtime` type and the implementation of the `GetNodeBlockType`
|
||||
@@ -8,18 +8,18 @@ impl GetNodeBlockType for Runtime {
|
||||
type NodeBlock = Block;
|
||||
}
|
||||
|
||||
sr_api::decl_runtime_apis! {
|
||||
sp_api::decl_runtime_apis! {
|
||||
pub trait Api {
|
||||
fn test(data: u64);
|
||||
}
|
||||
}
|
||||
|
||||
sr_api::impl_runtime_apis! {
|
||||
sp_api::impl_runtime_apis! {
|
||||
impl self::Api<Block> for Runtime {
|
||||
fn test(data: String) {}
|
||||
}
|
||||
|
||||
impl sr_api::Core<Block> for Runtime {
|
||||
impl sp_api::Core<Block> for Runtime {
|
||||
fn version() -> runtime_api::RuntimeVersion {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
@@ -19,14 +19,14 @@ error[E0053]: method `test` has an incompatible type for trait
|
||||
error[E0053]: method `Api_test_runtime_api_impl` has an incompatible type for trait
|
||||
--> $DIR/impl_incorrect_method_signature.rs:17:1
|
||||
|
|
||||
11 | / sr_api::decl_runtime_apis! {
|
||||
11 | / sp_api::decl_runtime_apis! {
|
||||
12 | | pub trait Api {
|
||||
13 | | fn test(data: u64);
|
||||
14 | | }
|
||||
15 | | }
|
||||
| |_- type in trait
|
||||
16 |
|
||||
17 | sr_api::impl_runtime_apis! {
|
||||
17 | sp_api::impl_runtime_apis! {
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| |
|
||||
| _expected u64, found struct `std::string::String`
|
||||
@@ -39,13 +39,13 @@ error[E0053]: method `Api_test_runtime_api_impl` has an incompatible type for tr
|
||||
33 | | }
|
||||
| |_- in this macro invocation
|
||||
|
|
||||
= note: expected type `fn(&RuntimeApiImpl<RuntimeApiImplCall>, &sr_api_hidden_includes_DECL_RUNTIME_APIS::sr_api::BlockId<sr_primitives::generic::block::Block<sr_primitives::generic::header::Header<u64, sr_primitives::traits::BlakeTwo256>, substrate_test_runtime::Extrinsic>>, sr_api_hidden_includes_DECL_RUNTIME_APIS::sr_api::ExecutionContext, std::option::Option<u64>, std::vec::Vec<u8>) -> std::result::Result<sr_api_hidden_includes_DECL_RUNTIME_APIS::sr_api::NativeOrEncoded<()>, <RuntimeApiImplCall as sr_api_hidden_includes_DECL_RUNTIME_APIS::sr_api::CallRuntimeAt<sr_primitives::generic::block::Block<sr_primitives::generic::header::Header<u64, sr_primitives::traits::BlakeTwo256>, substrate_test_runtime::Extrinsic>>>::Error>`
|
||||
found type `fn(&RuntimeApiImpl<RuntimeApiImplCall>, &sr_api_hidden_includes_DECL_RUNTIME_APIS::sr_api::BlockId<sr_primitives::generic::block::Block<sr_primitives::generic::header::Header<u64, sr_primitives::traits::BlakeTwo256>, substrate_test_runtime::Extrinsic>>, sr_api_hidden_includes_DECL_RUNTIME_APIS::sr_api::ExecutionContext, std::option::Option<std::string::String>, std::vec::Vec<u8>) -> std::result::Result<sr_api_hidden_includes_DECL_RUNTIME_APIS::sr_api::NativeOrEncoded<()>, <RuntimeApiImplCall as sr_api_hidden_includes_DECL_RUNTIME_APIS::sr_api::CallRuntimeAt<sr_primitives::generic::block::Block<sr_primitives::generic::header::Header<u64, sr_primitives::traits::BlakeTwo256>, substrate_test_runtime::Extrinsic>>>::Error>`
|
||||
= note: expected type `fn(&RuntimeApiImpl<RuntimeApiImplCall>, &sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::BlockId<sp_runtime::generic::block::Block<sp_runtime::generic::header::Header<u64, sp_runtime::traits::BlakeTwo256>, substrate_test_runtime::Extrinsic>>, sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::ExecutionContext, std::option::Option<u64>, std::vec::Vec<u8>) -> std::result::Result<sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::NativeOrEncoded<()>, <RuntimeApiImplCall as sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::CallRuntimeAt<sp_runtime::generic::block::Block<sp_runtime::generic::header::Header<u64, sp_runtime::traits::BlakeTwo256>, substrate_test_runtime::Extrinsic>>>::Error>`
|
||||
found type `fn(&RuntimeApiImpl<RuntimeApiImplCall>, &sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::BlockId<sp_runtime::generic::block::Block<sp_runtime::generic::header::Header<u64, sp_runtime::traits::BlakeTwo256>, substrate_test_runtime::Extrinsic>>, sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::ExecutionContext, std::option::Option<std::string::String>, std::vec::Vec<u8>) -> std::result::Result<sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::NativeOrEncoded<()>, <RuntimeApiImplCall as sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::CallRuntimeAt<sp_runtime::generic::block::Block<sp_runtime::generic::header::Header<u64, sp_runtime::traits::BlakeTwo256>, substrate_test_runtime::Extrinsic>>>::Error>`
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/impl_incorrect_method_signature.rs:17:1
|
||||
|
|
||||
17 | / sr_api::impl_runtime_apis! {
|
||||
17 | / sp_api::impl_runtime_apis! {
|
||||
18 | | impl self::Api<Block> for Runtime {
|
||||
19 | | fn test(data: String) {}
|
||||
20 | | }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use sr_primitives::traits::GetNodeBlockType;
|
||||
use sp_runtime::traits::GetNodeBlockType;
|
||||
use test_client::runtime::Block;
|
||||
|
||||
/// The declaration of the `Runtime` type and the implementation of the `GetNodeBlockType`
|
||||
@@ -8,7 +8,7 @@ impl GetNodeBlockType for Runtime {
|
||||
type NodeBlock = Block;
|
||||
}
|
||||
|
||||
sr_api::decl_runtime_apis! {
|
||||
sp_api::decl_runtime_apis! {
|
||||
pub trait Api {
|
||||
fn test(data: u64);
|
||||
}
|
||||
@@ -24,7 +24,7 @@ mod second {
|
||||
}
|
||||
}
|
||||
|
||||
sr_api::impl_runtime_apis! {
|
||||
sp_api::impl_runtime_apis! {
|
||||
impl self::Api<Block> for Runtime {
|
||||
fn test(data: u64) {}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ error: cannot find macro `decl_runtime_apis` in this scope
|
||||
error[E0425]: cannot find function `test2_call_api_at` in `second::runtime_decl_for_Api`
|
||||
--> $DIR/impl_two_traits_with_same_name.rs:27:1
|
||||
|
|
||||
27 | / sr_api::impl_runtime_apis! {
|
||||
27 | / sp_api::impl_runtime_apis! {
|
||||
28 | | impl self::Api<Block> for Runtime {
|
||||
29 | | fn test(data: u64) {}
|
||||
30 | | }
|
||||
@@ -28,7 +28,7 @@ error[E0425]: cannot find function `test2_call_api_at` in `second::runtime_decl_
|
||||
error[E0425]: cannot find function `test2_native_call_generator` in `second::runtime_decl_for_Api`
|
||||
--> $DIR/impl_two_traits_with_same_name.rs:27:1
|
||||
|
|
||||
27 | / sr_api::impl_runtime_apis! {
|
||||
27 | / sp_api::impl_runtime_apis! {
|
||||
28 | | impl self::Api<Block> for Runtime {
|
||||
29 | | fn test(data: u64) {}
|
||||
30 | | }
|
||||
@@ -49,7 +49,7 @@ error[E0576]: cannot find method or associated constant `test2` in `second::runt
|
||||
error[E0603]: module `runtime_decl_for_Api` is private
|
||||
--> $DIR/impl_two_traits_with_same_name.rs:27:1
|
||||
|
|
||||
27 | / sr_api::impl_runtime_apis! {
|
||||
27 | / sp_api::impl_runtime_apis! {
|
||||
28 | | impl self::Api<Block> for Runtime {
|
||||
29 | | fn test(data: u64) {}
|
||||
30 | | }
|
||||
@@ -58,7 +58,7 @@ error[E0603]: module `runtime_decl_for_Api` is private
|
||||
35 | | }
|
||||
| |_^
|
||||
|
||||
error[E0119]: conflicting implementations of trait `runtime_decl_for_Api::Api<sr_primitives::generic::block::Block<sr_primitives::generic::header::Header<u64, sr_primitives::traits::BlakeTwo256>, substrate_test_runtime::Extrinsic>>` for type `Runtime`:
|
||||
error[E0119]: conflicting implementations of trait `runtime_decl_for_Api::Api<sp_runtime::generic::block::Block<sp_runtime::generic::header::Header<u64, sp_runtime::traits::BlakeTwo256>, substrate_test_runtime::Extrinsic>>` for type `Runtime`:
|
||||
--> $DIR/impl_two_traits_with_same_name.rs:32:2
|
||||
|
|
||||
28 | impl self::Api<Block> for Runtime {
|
||||
@@ -67,7 +67,7 @@ error[E0119]: conflicting implementations of trait `runtime_decl_for_Api::Api<sr
|
||||
32 | impl second::Api<Block> for Runtime {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Runtime`
|
||||
|
||||
error[E0119]: conflicting implementations of trait `Api<sr_primitives::generic::block::Block<sr_primitives::generic::header::Header<u64, sr_primitives::traits::BlakeTwo256>, substrate_test_runtime::Extrinsic>>` for type `RuntimeApiImpl<_>`:
|
||||
error[E0119]: conflicting implementations of trait `Api<sp_runtime::generic::block::Block<sp_runtime::generic::header::Header<u64, sp_runtime::traits::BlakeTwo256>, substrate_test_runtime::Extrinsic>>` for type `RuntimeApiImpl<_>`:
|
||||
--> $DIR/impl_two_traits_with_same_name.rs:32:2
|
||||
|
|
||||
28 | impl self::Api<Block> for Runtime {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
sr_api::decl_runtime_apis! {
|
||||
sp_api::decl_runtime_apis! {
|
||||
#[api_version]
|
||||
pub trait Api {
|
||||
fn test(data: u64);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
error: can't qualify macro invocation with `pub`
|
||||
--> $DIR/invalid_api_version.rs:1:1
|
||||
|
|
||||
1 | / sr_api::decl_runtime_apis! {
|
||||
1 | / sp_api::decl_runtime_apis! {
|
||||
2 | | #[api_version]
|
||||
3 | | pub trait Api {
|
||||
4 | | fn test(data: u64);
|
||||
@@ -16,7 +16,7 @@ error: can't qualify macro invocation with `pub`
|
||||
error: Unexpected `api_version` attribute. The supported format is `api_version(1)`
|
||||
--> $DIR/invalid_api_version.rs:1:1
|
||||
|
|
||||
1 | / sr_api::decl_runtime_apis! {
|
||||
1 | / sp_api::decl_runtime_apis! {
|
||||
2 | | #[api_version]
|
||||
3 | | pub trait Api {
|
||||
4 | | fn test(data: u64);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
sr_api::decl_runtime_apis! {
|
||||
sp_api::decl_runtime_apis! {
|
||||
#[api_version("1")]
|
||||
pub trait Api {
|
||||
fn test(data: u64);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
error: can't qualify macro invocation with `pub`
|
||||
--> $DIR/invalid_api_version_2.rs:1:1
|
||||
|
|
||||
1 | / sr_api::decl_runtime_apis! {
|
||||
1 | / sp_api::decl_runtime_apis! {
|
||||
2 | | #[api_version("1")]
|
||||
3 | | pub trait Api {
|
||||
4 | | fn test(data: u64);
|
||||
@@ -16,7 +16,7 @@ error: can't qualify macro invocation with `pub`
|
||||
error: Unexpected `api_version` attribute. The supported format is `api_version(1)`
|
||||
--> $DIR/invalid_api_version_2.rs:1:1
|
||||
|
|
||||
1 | / sr_api::decl_runtime_apis! {
|
||||
1 | / sp_api::decl_runtime_apis! {
|
||||
2 | | #[api_version("1")]
|
||||
3 | | pub trait Api {
|
||||
4 | | fn test(data: u64);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
sr_api::decl_runtime_apis! {
|
||||
sp_api::decl_runtime_apis! {
|
||||
#[api_version()]
|
||||
pub trait Api {
|
||||
fn test(data: u64);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
error: can't qualify macro invocation with `pub`
|
||||
--> $DIR/invalid_api_version_3.rs:1:1
|
||||
|
|
||||
1 | / sr_api::decl_runtime_apis! {
|
||||
1 | / sp_api::decl_runtime_apis! {
|
||||
2 | | #[api_version()]
|
||||
3 | | pub trait Api {
|
||||
4 | | fn test(data: u64);
|
||||
@@ -16,7 +16,7 @@ error: can't qualify macro invocation with `pub`
|
||||
error: Unexpected `api_version` attribute. The supported format is `api_version(1)`
|
||||
--> $DIR/invalid_api_version_3.rs:1:1
|
||||
|
|
||||
1 | / sr_api::decl_runtime_apis! {
|
||||
1 | / sp_api::decl_runtime_apis! {
|
||||
2 | | #[api_version()]
|
||||
3 | | pub trait Api {
|
||||
4 | | fn test(data: u64);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use sr_primitives::traits::GetNodeBlockType;
|
||||
use sp_runtime::traits::GetNodeBlockType;
|
||||
use test_client::runtime::Block;
|
||||
|
||||
/// The declaration of the `Runtime` type and the implementation of the `GetNodeBlockType`
|
||||
@@ -8,13 +8,13 @@ impl GetNodeBlockType for Runtime {
|
||||
type NodeBlock = Block;
|
||||
}
|
||||
|
||||
sr_api::decl_runtime_apis! {
|
||||
sp_api::decl_runtime_apis! {
|
||||
pub trait Api {
|
||||
fn test(data: u64);
|
||||
}
|
||||
}
|
||||
|
||||
sr_api::impl_runtime_apis! {
|
||||
sp_api::impl_runtime_apis! {
|
||||
impl self::Api for Runtime {
|
||||
fn test(data: u64) {
|
||||
unimplemented!()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use sr_primitives::traits::GetNodeBlockType;
|
||||
use sp_runtime::traits::GetNodeBlockType;
|
||||
use test_client::runtime::Block;
|
||||
|
||||
/// The declaration of the `Runtime` type and the implementation of the `GetNodeBlockType`
|
||||
@@ -8,13 +8,13 @@ impl GetNodeBlockType for Runtime {
|
||||
type NodeBlock = Block;
|
||||
}
|
||||
|
||||
sr_api::decl_runtime_apis! {
|
||||
sp_api::decl_runtime_apis! {
|
||||
pub trait Api {
|
||||
fn test(data: u64);
|
||||
}
|
||||
}
|
||||
|
||||
sr_api::impl_runtime_apis! {
|
||||
sp_api::impl_runtime_apis! {
|
||||
impl Api<Block> for Runtime {
|
||||
fn test(data: u64) {
|
||||
unimplemented!()
|
||||
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
use sr_primitives::traits::{GetNodeBlockType, Block as BlockT};
|
||||
use sp_runtime::traits::{GetNodeBlockType, Block as BlockT};
|
||||
use test_client::runtime::Block;
|
||||
|
||||
/// The declaration of the `Runtime` type and the implementation of the `GetNodeBlockType`
|
||||
@@ -8,20 +8,20 @@ impl GetNodeBlockType for Runtime {
|
||||
type NodeBlock = Block;
|
||||
}
|
||||
|
||||
sr_api::decl_runtime_apis! {
|
||||
sp_api::decl_runtime_apis! {
|
||||
pub trait Api {
|
||||
fn test(data: u64);
|
||||
}
|
||||
}
|
||||
|
||||
sr_api::impl_runtime_apis! {
|
||||
sp_api::impl_runtime_apis! {
|
||||
impl self::Api<Block> for Runtime {
|
||||
fn test(data: &u64) {
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
||||
impl sr_api::Core<Block> for Runtime {
|
||||
impl sp_api::Core<Block> for Runtime {
|
||||
fn version() -> runtime_api::RuntimeVersion {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
+5
-5
@@ -19,14 +19,14 @@ error[E0053]: method `test` has an incompatible type for trait
|
||||
error[E0053]: method `Api_test_runtime_api_impl` has an incompatible type for trait
|
||||
--> $DIR/type_reference_in_impl_runtime_apis_call.rs:17:1
|
||||
|
|
||||
11 | / sr_api::decl_runtime_apis! {
|
||||
11 | / sp_api::decl_runtime_apis! {
|
||||
12 | | pub trait Api {
|
||||
13 | | fn test(data: u64);
|
||||
14 | | }
|
||||
15 | | }
|
||||
| |_- type in trait
|
||||
16 |
|
||||
17 | sr_api::impl_runtime_apis! {
|
||||
17 | sp_api::impl_runtime_apis! {
|
||||
| -^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| |
|
||||
| _expected u64, found &u64
|
||||
@@ -39,13 +39,13 @@ error[E0053]: method `Api_test_runtime_api_impl` has an incompatible type for tr
|
||||
35 | | }
|
||||
| |_- in this macro invocation
|
||||
|
|
||||
= note: expected type `fn(&RuntimeApiImpl<RuntimeApiImplCall>, &sr_api_hidden_includes_DECL_RUNTIME_APIS::sr_api::BlockId<sr_primitives::generic::block::Block<sr_primitives::generic::header::Header<u64, sr_primitives::traits::BlakeTwo256>, substrate_test_runtime::Extrinsic>>, sr_api_hidden_includes_DECL_RUNTIME_APIS::sr_api::ExecutionContext, std::option::Option<u64>, std::vec::Vec<u8>) -> std::result::Result<sr_api_hidden_includes_DECL_RUNTIME_APIS::sr_api::NativeOrEncoded<()>, <RuntimeApiImplCall as sr_api_hidden_includes_DECL_RUNTIME_APIS::sr_api::CallRuntimeAt<sr_primitives::generic::block::Block<sr_primitives::generic::header::Header<u64, sr_primitives::traits::BlakeTwo256>, substrate_test_runtime::Extrinsic>>>::Error>`
|
||||
found type `fn(&RuntimeApiImpl<RuntimeApiImplCall>, &sr_api_hidden_includes_DECL_RUNTIME_APIS::sr_api::BlockId<sr_primitives::generic::block::Block<sr_primitives::generic::header::Header<u64, sr_primitives::traits::BlakeTwo256>, substrate_test_runtime::Extrinsic>>, sr_api_hidden_includes_DECL_RUNTIME_APIS::sr_api::ExecutionContext, std::option::Option<&u64>, std::vec::Vec<u8>) -> std::result::Result<sr_api_hidden_includes_DECL_RUNTIME_APIS::sr_api::NativeOrEncoded<()>, <RuntimeApiImplCall as sr_api_hidden_includes_DECL_RUNTIME_APIS::sr_api::CallRuntimeAt<sr_primitives::generic::block::Block<sr_primitives::generic::header::Header<u64, sr_primitives::traits::BlakeTwo256>, substrate_test_runtime::Extrinsic>>>::Error>`
|
||||
= note: expected type `fn(&RuntimeApiImpl<RuntimeApiImplCall>, &sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::BlockId<sp_runtime::generic::block::Block<sp_runtime::generic::header::Header<u64, sp_runtime::traits::BlakeTwo256>, substrate_test_runtime::Extrinsic>>, sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::ExecutionContext, std::option::Option<u64>, std::vec::Vec<u8>) -> std::result::Result<sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::NativeOrEncoded<()>, <RuntimeApiImplCall as sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::CallRuntimeAt<sp_runtime::generic::block::Block<sp_runtime::generic::header::Header<u64, sp_runtime::traits::BlakeTwo256>, substrate_test_runtime::Extrinsic>>>::Error>`
|
||||
found type `fn(&RuntimeApiImpl<RuntimeApiImplCall>, &sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::BlockId<sp_runtime::generic::block::Block<sp_runtime::generic::header::Header<u64, sp_runtime::traits::BlakeTwo256>, substrate_test_runtime::Extrinsic>>, sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::ExecutionContext, std::option::Option<&u64>, std::vec::Vec<u8>) -> std::result::Result<sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::NativeOrEncoded<()>, <RuntimeApiImplCall as sp_api_hidden_includes_DECL_RUNTIME_APIS::sp_api::CallRuntimeAt<sp_runtime::generic::block::Block<sp_runtime::generic::header::Header<u64, sp_runtime::traits::BlakeTwo256>, substrate_test_runtime::Extrinsic>>>::Error>`
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/type_reference_in_impl_runtime_apis_call.rs:17:1
|
||||
|
|
||||
17 | / sr_api::impl_runtime_apis! {
|
||||
17 | / sp_api::impl_runtime_apis! {
|
||||
18 | | impl self::Api<Block> for Runtime {
|
||||
19 | | fn test(data: &u64) {
|
||||
20 | | unimplemented!()
|
||||
|
||||
Reference in New Issue
Block a user