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,20 +1,20 @@
[package]
name = "substrate-application-crypto"
name = "sc-application-crypto"
version = "2.0.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
description = "Provides facilities for generating application specific crypto wrapper types."
[dependencies]
primitives = { package = "substrate-primitives", path = "../core", default-features = false }
primitives = { package = "sp-core", path = "../core", default-features = false }
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
serde = { version = "1.0.101", optional = true, features = ["derive"] }
rstd = { package = "sr-std", path = "../sr-std", default-features = false }
runtime-io = { package = "sr-io", path = "../../primitives/sr-io", default-features = false }
rstd = { package = "sp-std", path = "../sr-std", default-features = false }
runtime-io = { package = "sp-io", path = "../../primitives/sr-io", default-features = false }
[dev-dependencies]
test-client = { package = "substrate-test-runtime-client", path = "../../test/utils/runtime/client" }
sr-primitives = { path = "../../primitives/sr-primitives" }
sp-runtime = { path = "../../primitives/sr-primitives" }
[features]
default = [ "std" ]
@@ -57,7 +57,7 @@ impl RuntimePublic for Public {
#[cfg(test)]
mod tests {
use sr_primitives::{generic::BlockId, traits::ProvideRuntimeApi};
use sp_runtime::{generic::BlockId, traits::ProvideRuntimeApi};
use primitives::{testing::{KeyStore, ED25519}, crypto::Pair};
use test_client::{
TestClientBuilder, DefaultTestClientBuilderExt, TestClientBuilderExt,
@@ -45,7 +45,7 @@ pub use traits::*;
/// Application-specific types whose identifier is `$key_type`.
///
/// ```rust
///# use substrate_application_crypto::{app_crypto, wrap, ed25519, KeyTypeId};
///# use sc_application_crypto::{app_crypto, wrap, ed25519, KeyTypeId};
/// // Declare a new set of crypto types using Ed25519 logic that identifies as `KeyTypeId`
/// // of value `b"fuba"`.
/// app_crypto!(ed25519, KeyTypeId(*b"_uba"));
@@ -66,7 +66,7 @@ macro_rules! app_crypto {
/// Application-specific types whose identifier is `$key_type`.
///
/// ```rust
///# use substrate_application_crypto::{app_crypto, wrap, ed25519, KeyTypeId};
///# use sc_application_crypto::{app_crypto, wrap, ed25519, KeyTypeId};
/// // Declare a new set of crypto types using Ed25519 logic that identifies as `KeyTypeId`
/// // of value `b"fuba"`.
/// app_crypto!(ed25519, KeyTypeId(*b"_uba"));
@@ -390,7 +390,7 @@ macro_rules! app_crypto_signature_common {
/// Implement bidirectional `From` and on-way `AsRef`/`AsMut` for two types, `$inner` and `$outer`.
///
/// ```rust
/// substrate_application_crypto::wrap! {
/// sc_application_crypto::wrap! {
/// pub struct Wrapper(u32);
/// }
/// ```
@@ -57,7 +57,7 @@ impl RuntimePublic for Public {
#[cfg(test)]
mod tests {
use sr_primitives::{generic::BlockId, traits::ProvideRuntimeApi};
use sp_runtime::{generic::BlockId, traits::ProvideRuntimeApi};
use primitives::{testing::{KeyStore, SR25519}, crypto::Pair};
use test_client::{
TestClientBuilder, DefaultTestClientBuilderExt, TestClientBuilderExt,
@@ -1,16 +1,16 @@
[package]
name = "substrate-authority-discovery-primitives"
name = "sp-authority-discovery"
version = "2.0.0"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Authority discovery primitives"
edition = "2018"
[dependencies]
app-crypto = { package = "substrate-application-crypto", path = "../application-crypto", default-features = false }
app-crypto = { package = "sc-application-crypto", path = "../application-crypto", default-features = false }
codec = { package = "parity-scale-codec", default-features = false, version = "1.0.3" }
rstd = { package = "sr-std", path = "../sr-std", default-features = false }
sr-api = { path = "../sr-api", default-features = false }
sr-primitives = { path = "../sr-primitives", default-features = false }
rstd = { package = "sp-std", path = "../sr-std", default-features = false }
sp-api = { path = "../sr-api", default-features = false }
sp-runtime = { path = "../sr-primitives", default-features = false }
[features]
default = ["std"]
@@ -18,6 +18,6 @@ std = [
"app-crypto/std",
"codec/std",
"rstd/std",
"sr-api/std",
"sr-primitives/std"
"sp-api/std",
"sp-runtime/std"
]
@@ -35,7 +35,7 @@ pub type AuthorityId = app::Public;
/// An authority discovery authority signature.
pub type AuthoritySignature = app::Signature;
sr_api::decl_runtime_apis! {
sp_api::decl_runtime_apis! {
/// The authority discovery api.
///
/// This api is used by the `core/authority-discovery` module to retrieve identifiers
+2 -2
View File
@@ -6,8 +6,8 @@ description = "Authorship primitives"
edition = "2018"
[dependencies]
sp-inherents = { package = "substrate-inherents", path = "../inherents", default-features = false }
rstd = { package = "sr-std", path = "../sr-std", default-features = false }
sp-inherents = { package = "sp-inherents", path = "../inherents", default-features = false }
rstd = { package = "sp-std", path = "../sr-std", default-features = false }
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
[features]
@@ -1,22 +1,22 @@
[package]
name = "substrate-block-builder-runtime-api"
name = "sp-block-builder"
version = "2.0.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
[dependencies]
sr-primitives = { path = "../../sr-primitives", default-features = false }
sr-api = { path = "../../sr-api", default-features = false }
rstd = { package = "sr-std", path = "../../sr-std", default-features = false }
sp-runtime = { path = "../../sr-primitives", default-features = false }
sp-api = { path = "../../sr-api", default-features = false }
rstd = { package = "sp-std", path = "../../sr-std", default-features = false }
codec = { package = "parity-scale-codec", version = "1.0.6", default-features = false }
inherents = { package = "substrate-inherents", path = "../../inherents", default-features = false }
inherents = { package = "sp-inherents", path = "../../inherents", default-features = false }
[features]
default = [ "std" ]
std = [
"sr-primitives/std",
"sp-runtime/std",
"codec/std",
"inherents/std",
"sr-api/std",
"sp-api/std",
"rstd/std",
]
@@ -18,7 +18,7 @@
#![cfg_attr(not(feature = "std"), no_std)]
use sr_primitives::{traits::Block as BlockT, ApplyExtrinsicResult};
use sp_runtime::{traits::Block as BlockT, ApplyExtrinsicResult};
use inherents::{InherentData, CheckInherentsResult};
@@ -27,7 +27,7 @@ use inherents::{InherentData, CheckInherentsResult};
/// These definitions are taken from the 2c58e30246a029b53d51e5b24c31974ac539ee8b git revision.
#[deprecated(note = "These definitions here are only for compatibility reasons")]
pub mod compatability_v3 {
use sr_primitives::{DispatchOutcome, transaction_validity};
use sp_runtime::{DispatchOutcome, transaction_validity};
use codec::{Encode, Decode};
#[derive(Eq, PartialEq, Clone, Copy, Decode, Encode, Debug)]
@@ -41,7 +41,7 @@ pub mod compatability_v3 {
pub type ApplyResult = Result<DispatchOutcome, ApplyError>;
}
sr_api::decl_runtime_apis! {
sp_api::decl_runtime_apis! {
/// The `BlockBuilder` api trait that provides the required functionality for building a block.
#[api_version(4)]
pub trait BlockBuilder {
+4 -4
View File
@@ -10,8 +10,8 @@ lru = "0.4.0"
parking_lot = "0.9.0"
derive_more = "0.99.2"
parity-scale-codec = { version = "1.0.0", default-features = false, features = ["derive"] }
sp_consensus = { package = "substrate-consensus-common", path = "../consensus/common" }
sr-primitives = { path = "../sr-primitives" }
sp-block-builder-runtime-api = { package = "substrate-block-builder-runtime-api", path = "../block-builder/runtime-api" }
sp-state-machine = { package = "substrate-state-machine", path = "../state-machine" }
sp_consensus = { package = "sp-consensus", path = "../consensus/common" }
sp-runtime = { path = "../sr-primitives" }
sp-block-builder-runtime-api = { package = "sp-block-builder", path = "../block-builder/runtime-api" }
sp-state-machine = { package = "sp-state-machine", path = "../state-machine" }
@@ -18,9 +18,9 @@
use std::sync::Arc;
use sr_primitives::traits::{Block as BlockT, Header as HeaderT, NumberFor};
use sr_primitives::generic::BlockId;
use sr_primitives::Justification;
use sp_runtime::traits::{Block as BlockT, Header as HeaderT, NumberFor};
use sp_runtime::generic::BlockId;
use sp_runtime::Justification;
use log::warn;
use parking_lot::RwLock;
+1 -1
View File
@@ -18,7 +18,7 @@
use std::{self, error, result};
use sp_state_machine;
use sr_primitives::transaction_validity::TransactionValidityError;
use sp_runtime::transaction_validity::TransactionValidityError;
#[allow(deprecated)]
use sp_block_builder_runtime_api::compatability_v3;
use sp_consensus;
@@ -17,7 +17,7 @@
//! Implements tree backend, cached header metadata and algorithms
//! to compute routes efficiently over the tree of headers.
use sr_primitives::traits::{Block as BlockT, NumberFor, Header};
use sp_runtime::traits::{Block as BlockT, NumberFor, Header};
use parking_lot::RwLock;
use lru::LruCache;
@@ -1,17 +1,17 @@
[package]
name = "substrate-consensus-aura-primitives"
name = "sp-consensus-aura"
version = "2.0.0"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Primitives for Aura consensus"
edition = "2018"
[dependencies]
app-crypto = { package = "substrate-application-crypto", path = "../../application-crypto", default-features = false }
app-crypto = { package = "sc-application-crypto", path = "../../application-crypto", default-features = false }
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false }
rstd = { package = "sr-std", path = "../../sr-std", default-features = false }
sr-api = { path = "../../sr-api", default-features = false }
sr-primitives = { path = "../../sr-primitives", default-features = false }
inherents = { package = "substrate-inherents", path = "../../inherents", default-features = false }
rstd = { package = "sp-std", path = "../../sr-std", default-features = false }
sp-api = { path = "../../sr-api", default-features = false }
sp-runtime = { path = "../../sr-primitives", default-features = false }
inherents = { package = "sp-inherents", path = "../../inherents", default-features = false }
sp-timestamp = { path = "../../timestamp", default-features = false }
[features]
@@ -20,8 +20,8 @@ std = [
"app-crypto/std",
"codec/std",
"rstd/std",
"sr-api/std",
"sr-primitives/std",
"sp-api/std",
"sp-runtime/std",
"inherents/std",
"sp-timestamp/std",
]
@@ -20,7 +20,7 @@
use codec::{Encode, Decode, Codec};
use rstd::vec::Vec;
use sr_primitives::ConsensusEngineId;
use sp_runtime::ConsensusEngineId;
pub mod inherents;
@@ -75,7 +75,7 @@ pub enum ConsensusLog<AuthorityId: Codec> {
OnDisabled(AuthorityIndex),
}
sr_api::decl_runtime_apis! {
sp_api::decl_runtime_apis! {
/// API necessary for block authorship with aura.
pub trait AuraApi<AuthorityId: Codec> {
/// Return the slot duration in seconds for Aura.
@@ -1,19 +1,19 @@
[package]
name = "substrate-consensus-babe-primitives"
name = "sp-consensus-babe"
version = "2.0.0"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Primitives for BABE consensus"
edition = "2018"
[dependencies]
app-crypto = { package = "substrate-application-crypto", path = "../../application-crypto", default-features = false }
app-crypto = { package = "sc-application-crypto", path = "../../application-crypto", default-features = false }
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false }
rstd = { package = "sr-std", path = "../../sr-std", default-features = false }
rstd = { package = "sp-std", path = "../../sr-std", default-features = false }
schnorrkel = { version = "0.8.5", features = ["preaudit_deprecated"], optional = true }
slots = { package = "substrate-consensus-slots", path = "../../../client/consensus/slots", optional = true }
sr-api = { path = "../../sr-api", default-features = false }
sr-primitives = { path = "../../sr-primitives", default-features = false }
sp-inherents = { package = "substrate-inherents", path = "../../inherents", default-features = false }
slots = { package = "sc-consensus-slots", path = "../../../client/consensus/slots", optional = true }
sp-api = { path = "../../sr-api", default-features = false }
sp-runtime = { path = "../../sr-primitives", default-features = false }
sp-inherents = { package = "sp-inherents", path = "../../inherents", default-features = false }
sp-timestamp = { path = "../../timestamp", default-features = false }
[features]
@@ -24,8 +24,8 @@ std = [
"rstd/std",
"schnorrkel",
"slots",
"sr-api/std",
"sr-primitives/std",
"sp-api/std",
"sp-runtime/std",
"sp-inherents/std",
"sp-timestamp/std",
]
@@ -22,7 +22,7 @@ use super::{BABE_ENGINE_ID, AuthoritySignature};
use super::{VRF_OUTPUT_LENGTH, VRF_PROOF_LENGTH};
use super::{AuthorityId, AuthorityIndex, SlotNumber, BabeAuthorityWeight};
#[cfg(feature = "std")]
use sr_primitives::{DigestItem, generic::OpaqueDigestItemId};
use sp_runtime::{DigestItem, generic::OpaqueDigestItemId};
#[cfg(feature = "std")]
use std::fmt::Debug;
use codec::{Decode, Encode};
@@ -195,7 +195,7 @@ impl Decode for BabePreDigest {
/// Information about the next epoch. This is broadcast in the first block
/// of the epoch.
#[derive(Decode, Encode, Default, PartialEq, Eq, Clone, sr_primitives::RuntimeDebug)]
#[derive(Decode, Encode, Default, PartialEq, Eq, Clone, sp_runtime::RuntimeDebug)]
pub struct NextEpochDescriptor {
/// The authorities.
pub authorities: Vec<(AuthorityId, BabeAuthorityWeight)>,
@@ -24,7 +24,7 @@ pub mod inherents;
use codec::{Encode, Decode};
use rstd::vec::Vec;
use sr_primitives::{ConsensusEngineId, RuntimeDebug};
use sp_runtime::{ConsensusEngineId, RuntimeDebug};
#[cfg(feature = "std")]
pub use digest::{BabePreDigest, CompatibleDigestItem};
@@ -165,7 +165,7 @@ impl slots::SlotData for BabeConfiguration {
const SLOT_KEY: &'static [u8] = b"babe_configuration";
}
sr_api::decl_runtime_apis! {
sp_api::decl_runtime_apis! {
/// API necessary for block authorship with BABE.
pub trait BabeApi {
/// Return the configuration for BABE. Currently,
@@ -1,5 +1,5 @@
[package]
name = "substrate-consensus-common"
name = "sp-consensus"
version = "2.0.0"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Common utilities for substrate consensus"
@@ -9,13 +9,13 @@ edition = "2018"
derive_more = "0.99.2"
libp2p = { version = "0.13.0", default-features = false }
log = "0.4.8"
primitives = { package = "substrate-primitives", path= "../../core" }
inherents = { package = "substrate-inherents", path = "../../inherents" }
primitives = { package = "sp-core", path= "../../core" }
inherents = { package = "sp-inherents", path = "../../inherents" }
futures = { version = "0.3.1", features = ["thread-pool"] }
futures-timer = "0.4.0"
rstd = { package = "sr-std", path = "../../sr-std" }
runtime_version = { package = "sr-version", path = "../../sr-version" }
sr-primitives = { path = "../../sr-primitives" }
rstd = { package = "sp-std", path = "../../sr-std" }
runtime_version = { package = "sp-version", path = "../../sr-version" }
sp-runtime = { path = "../../sr-primitives" }
codec = { package = "parity-scale-codec", version = "1.0.0", features = ["derive"] }
parking_lot = "0.9.0"
@@ -16,8 +16,8 @@
//! Block import helpers.
use sr_primitives::traits::{Block as BlockT, DigestItemFor, Header as HeaderT, NumberFor};
use sr_primitives::Justification;
use sp_runtime::traits::{Block as BlockT, DigestItemFor, Header as HeaderT, NumberFor};
use sp_runtime::Justification;
use std::borrow::Cow;
use std::collections::HashMap;
use std::sync::Arc;
@@ -17,7 +17,7 @@
//! Block announcement validation.
use crate::BlockStatus;
use sr_primitives::{generic::BlockId, traits::Block};
use sp_runtime::{generic::BlockId, traits::Block};
use std::{error::Error, sync::Arc};
/// A type which provides access to chain information.
@@ -19,7 +19,7 @@
use super::MAX_BLOCK_SIZE;
use codec::Encode;
use sr_primitives::traits::{Block as BlockT, Header as HeaderT, One, CheckedConversion};
use sp_runtime::traits::{Block as BlockT, Header as HeaderT, One, CheckedConversion};
// This is just a best effort to encode the number. None indicated that it's too big to encode
// in a u128.
@@ -26,7 +26,7 @@
//! queues to be instantiated simply.
use std::collections::HashMap;
use sr_primitives::{Justification, traits::{Block as BlockT, Header as _, NumberFor}};
use sp_runtime::{Justification, traits::{Block as BlockT, Header as _, NumberFor}};
use crate::error::Error as ConsensusError;
use crate::block_import::{
BlockImport, BlockOrigin, BlockImportParams, ImportedAux, JustificationImport, ImportResult,
@@ -17,7 +17,7 @@
use std::{mem, pin::Pin, time::Duration};
use futures::{prelude::*, channel::mpsc, task::Context, task::Poll};
use futures_timer::Delay;
use sr_primitives::{Justification, traits::{Block as BlockT, Header as HeaderT, NumberFor}};
use sp_runtime::{Justification, traits::{Block as BlockT, Header as HeaderT, NumberFor}};
use crate::block_import::BlockOrigin;
use crate::import_queue::{
@@ -21,8 +21,8 @@
//! # Example
//!
//! ```
//! use substrate_consensus_common::import_queue::Link;
//! # use substrate_consensus_common::import_queue::buffered_link::buffered_link;
//! use sp_consensus::import_queue::Link;
//! # use sp_consensus::import_queue::buffered_link::buffered_link;
//! # use test_client::runtime::Block;
//! # struct DummyLink; impl Link<Block> for DummyLink {}
//! # let mut my_link = DummyLink;
@@ -38,7 +38,7 @@
//!
use futures::{prelude::*, channel::mpsc};
use sr_primitives::traits::{Block as BlockT, NumberFor};
use sp_runtime::traits::{Block as BlockT, NumberFor};
use std::{pin::Pin, task::Context, task::Poll};
use crate::import_queue::{Origin, Link, BlockImportResult, BlockImportError};
@@ -31,7 +31,7 @@
use std::sync::Arc;
use std::time::Duration;
use sr_primitives::{traits::{Block as BlockT, DigestFor}, generic::BlockId};
use sp_runtime::{traits::{Block as BlockT, DigestFor}, generic::BlockId};
use futures::prelude::*;
pub use inherents::InherentData;
@@ -15,7 +15,7 @@
// along with Substrate Consensus Common. If not, see <http://www.gnu.org/licenses/>.
use crate::error::Error;
use sr_primitives::traits::{Block as BlockT, NumberFor};
use sp_runtime::traits::{Block as BlockT, NumberFor};
/// The SelectChain trait defines the strategy upon which the head is chosen
@@ -1,23 +1,23 @@
[package]
name = "substrate-consensus-pow-primitives"
name = "sp-consensus-pow"
version = "2.0.0"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Primitives for Aura consensus"
edition = "2018"
[dependencies]
sr-api = { path = "../../sr-api", default-features = false }
rstd = { package = "sr-std", path = "../../sr-std", default-features = false }
sr-primitives = { path = "../../sr-primitives", default-features = false }
primitives = { package = "substrate-primitives", path = "../../core", default-features = false }
sp-api = { path = "../../sr-api", default-features = false }
rstd = { package = "sp-std", path = "../../sr-std", default-features = false }
sp-runtime = { path = "../../sr-primitives", default-features = false }
primitives = { package = "sp-core", path = "../../core", default-features = false }
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
[features]
default = ["std"]
std = [
"rstd/std",
"sr-api/std",
"sr-primitives/std",
"sp-api/std",
"sp-runtime/std",
"primitives/std",
"codec/std",
]
@@ -19,7 +19,7 @@
#![cfg_attr(not(feature = "std"), no_std)]
use rstd::vec::Vec;
use sr_primitives::ConsensusEngineId;
use sp_runtime::ConsensusEngineId;
use codec::Decode;
/// The `ConsensusEngineId` of PoW.
@@ -47,7 +47,7 @@ impl TotalDifficulty for u128 {
}
}
sr_api::decl_runtime_apis! {
sp_api::decl_runtime_apis! {
/// API necessary for timestamp-based difficulty adjustment algorithms.
pub trait TimestampApi<Moment: Decode> {
/// Return the timestamp in the current block.
+8 -8
View File
@@ -1,11 +1,11 @@
[package]
name = "substrate-primitives"
name = "sp-core"
version = "2.0.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
[dependencies]
rstd = { package = "sr-std", path = "../sr-std", default-features = false }
rstd = { package = "sp-std", path = "../sr-std", default-features = false }
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
rustc-hex = { version = "2.0.1", default-features = false }
log = { version = "0.4.8", default-features = false }
@@ -33,13 +33,13 @@ lazy_static = { version = "1.4.0", default-features = false, optional = true }
parking_lot = { version = "0.9.0", optional = true }
libsecp256k1 = { version = "0.3.0", default-features = false, optional = true }
tiny-keccak = { version = "2.0.1", features = ["keccak"], optional = true }
substrate-debug-derive = { version = "2.0.0", path = "./debug-derive" }
externalities = { package = "substrate-externalities", path = "../externalities", optional = true }
primitives-storage = { package = "substrate-primitives-storage", path = "storage", default-features = false }
runtime-interface = { package = "substrate-runtime-interface", path = "../runtime-interface", default-features = false }
sp-debug-derive = { version = "2.0.0", path = "./debug-derive" }
externalities = { package = "sp-externalities", path = "../externalities", optional = true }
primitives-storage = { package = "sp-core-storage", path = "storage", default-features = false }
runtime-interface = { package = "sp-runtime-interface", path = "../runtime-interface", default-features = false }
[dev-dependencies]
substrate-serializer = { path = "../serializer" }
sp-serializer = { path = "../serializer" }
pretty_assertions = "0.6.1"
hex-literal = "0.2.1"
rand = "0.7.2"
@@ -89,7 +89,7 @@ std = [
"num-traits/std",
"libsecp256k1",
"tiny-keccak",
"substrate-debug-derive/std",
"sp-debug-derive/std",
"externalities",
"primitives-storage/std",
"runtime-interface/std",
+1 -1
View File
@@ -16,7 +16,7 @@
#[macro_use]
extern crate criterion;
use substrate_primitives as primitives;
use sp_core as primitives;
use criterion::{Criterion, black_box, Bencher, Fun};
use std::time::Duration;
use primitives::crypto::Pair as _;
@@ -1,5 +1,5 @@
[package]
name = "substrate-debug-derive"
name = "sp-debug-derive"
version = "2.0.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
@@ -25,7 +25,7 @@
//! blob from unneeded code.
//!
//! ```rust
//! #[derive(substrate_debug_derive::RuntimeDebug)]
//! #[derive(sp_debug_derive::RuntimeDebug)]
//! struct MyStruct;
//!
//! assert_eq!(format!("{:?}", MyStruct), "MyStruct");
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
use substrate_debug_derive::RuntimeDebug;
use sp_debug_derive::RuntimeDebug;
#[derive(RuntimeDebug)]
struct Unnamed(u64, String);
+1 -1
View File
@@ -31,7 +31,7 @@ pub fn convert_hash<H1: Default + AsMut<[u8]>, H2: AsRef<[u8]>>(src: &H2) -> H1
#[cfg(test)]
mod tests {
use super::*;
use substrate_serializer as ser;
use sp_serializer as ser;
#[test]
fn test_h160() {
+1 -1
View File
@@ -42,7 +42,7 @@ pub use serde;
#[doc(hidden)]
pub use codec::{Encode, Decode};
pub use substrate_debug_derive::RuntimeDebug;
pub use sp_debug_derive::RuntimeDebug;
#[cfg(feature = "std")]
pub use impl_serde::serialize as bytes;
+1 -1
View File
@@ -141,7 +141,7 @@ impl crate::traits::BareCryptoStore for KeyStore {
/// # Example
///
/// ```
/// # use substrate_primitives::wasm_export_functions;
/// # use sp_core::wasm_export_functions;
///
/// wasm_export_functions! {
/// fn test_in_wasm(value: bool, another_value: Vec<u8>) -> bool {
+1 -1
View File
@@ -22,7 +22,7 @@ pub use primitive_types::U256;
mod tests {
use super::*;
use codec::{Encode, Decode};
use substrate_serializer as ser;
use sp_serializer as ser;
macro_rules! test {
($name: ident, $test_name: ident) => {
+3 -3
View File
@@ -1,15 +1,15 @@
[package]
name = "substrate-primitives-storage"
name = "sp-core-storage"
version = "2.0.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
description = "Storage related primitives"
[dependencies]
rstd = { package = "sr-std", path = "../../sr-std", default-features = false }
rstd = { package = "sp-std", path = "../../sr-std", default-features = false }
serde = { version = "1.0.101", optional = true, features = ["derive"] }
impl-serde = { version = "0.2.3", optional = true }
substrate-debug-derive = { version = "2.0.0", path = "../debug-derive" }
sp-debug-derive = { version = "2.0.0", path = "../debug-derive" }
[features]
default = [ "std" ]
+1 -1
View File
@@ -20,7 +20,7 @@
#[cfg(feature = "std")]
use serde::{Serialize, Deserialize};
use substrate_debug_derive::RuntimeDebug;
use sp_debug_derive::RuntimeDebug;
use rstd::{vec::Vec, borrow::Cow};
@@ -1,11 +1,11 @@
[package]
name = "substrate-externalities"
name = "sp-externalities"
version = "2.0.0"
license = "GPL-3.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
[dependencies]
primitives-storage = { package = "substrate-primitives-storage", path = "../core/storage" }
rstd = { package = "sr-std", path = "../sr-std" }
primitives-storage = { package = "sp-core-storage", path = "../core/storage" }
rstd = { package = "sp-std", path = "../sr-std" }
environmental = { version = "1.0.2" }
@@ -41,7 +41,7 @@ pub trait Extension: Send + Any {
///
/// # Example
/// ```
/// # use substrate_externalities::decl_extension;
/// # use sp_externalities::decl_extension;
/// decl_extension! {
/// /// Some test extension
/// struct TestExt(String);
@@ -1,16 +1,16 @@
[package]
name = "substrate-finality-grandpa-primitives"
name = "sp-finality-granpda"
version = "2.0.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
[dependencies]
app-crypto = { package = "substrate-application-crypto", path = "../application-crypto", default-features = false }
app-crypto = { package = "sc-application-crypto", path = "../application-crypto", default-features = false }
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
rstd = { package = "sr-std", path = "../sr-std", default-features = false }
rstd = { package = "sp-std", path = "../sr-std", default-features = false }
serde = { version = "1.0.101", optional = true, features = ["derive"] }
sr-api = { path = "../sr-api", default-features = false }
sr-primitives = { path = "../sr-primitives", default-features = false }
sp-api = { path = "../sr-api", default-features = false }
sp-runtime = { path = "../sr-primitives", default-features = false }
[features]
default = ["std"]
@@ -19,6 +19,6 @@ std = [
"codec/std",
"rstd/std",
"serde",
"sr-api/std",
"sr-primitives/std",
"sp-api/std",
"sp-runtime/std",
]
@@ -24,7 +24,7 @@ extern crate alloc;
#[cfg(feature = "std")]
use serde::Serialize;
use codec::{Encode, Decode, Input, Codec};
use sr_primitives::{ConsensusEngineId, RuntimeDebug};
use sp_runtime::{ConsensusEngineId, RuntimeDebug};
use rstd::borrow::Cow;
use rstd::vec::Vec;
@@ -210,7 +210,7 @@ impl<'a> Decode for VersionedAuthorityList<'a> {
}
}
sr_api::decl_runtime_apis! {
sp_api::decl_runtime_apis! {
/// APIs for integrating the GRANDPA finality gadget into runtimes.
/// This should be implemented on the runtime side.
///
@@ -6,8 +6,8 @@ edition = "2018"
[dependencies]
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false }
inherents = { package = "substrate-inherents", path = "../../primitives/inherents", default-features = false }
rstd = { package = "sr-std", path = "../../primitives/sr-std", default-features = false }
inherents = { package = "sp-inherents", path = "../../primitives/inherents", default-features = false }
rstd = { package = "sp-std", path = "../../primitives/sr-std", default-features = false }
[features]
default = ["std"]
+3 -3
View File
@@ -1,13 +1,13 @@
[package]
name = "substrate-inherents"
name = "sp-inherents"
version = "2.0.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
[dependencies]
parking_lot = { version = "0.9.0", optional = true }
rstd = { package = "sr-std", path = "../sr-std", default-features = false }
primitives = { package = "substrate-primitives", path = "../core", default-features = false }
rstd = { package = "sp-std", path = "../sr-std", default-features = false }
primitives = { package = "sp-core", path = "../core", default-features = false }
codec = { package = "parity-scale-codec", version = "1.0.6", default-features = false, features = ["derive"] }
derive_more = { version = "0.99.2", optional = true }
+3 -3
View File
@@ -1,11 +1,11 @@
[package]
name = "substrate-keyring"
name = "sp-keyring"
version = "2.0.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
[dependencies]
primitives = { package = "substrate-primitives", path = "../core" }
sr-primitives = { path = "../sr-primitives" }
primitives = { package = "sp-core", path = "../core" }
sp-runtime = { path = "../sr-primitives" }
lazy_static = "1.4.0"
strum = { version = "0.16.0", features = ["derive"] }
+3 -3
View File
@@ -20,7 +20,7 @@ use std::{collections::HashMap, ops::Deref};
use lazy_static::lazy_static;
use primitives::{ed25519::{Pair, Public, Signature}, Pair as PairT, Public as PublicT, H256};
pub use primitives::ed25519;
use sr_primitives::AccountId32;
use sp_runtime::AccountId32;
/// Set of test accounts.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, strum::Display, strum::EnumIter)]
@@ -106,9 +106,9 @@ impl From<Keyring> for &'static str {
}
}
impl From<Keyring> for sr_primitives::MultiSigner {
impl From<Keyring> for sp_runtime::MultiSigner {
fn from(x: Keyring) -> Self {
sr_primitives::MultiSigner::Ed25519(x.into())
sp_runtime::MultiSigner::Ed25519(x.into())
}
}
+3 -3
View File
@@ -21,7 +21,7 @@ use std::ops::Deref;
use lazy_static::lazy_static;
use primitives::{sr25519::{Pair, Public, Signature}, Pair as PairT, Public as PublicT, H256};
pub use primitives::sr25519;
use sr_primitives::AccountId32;
use sp_runtime::AccountId32;
/// Set of test accounts.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, strum::Display, strum::EnumIter)]
@@ -107,9 +107,9 @@ impl From<Keyring> for &'static str {
}
}
impl From<Keyring> for sr_primitives::MultiSigner {
impl From<Keyring> for sp_runtime::MultiSigner {
fn from(x: Keyring) -> Self {
sr_primitives::MultiSigner::Sr25519(x.into())
sp_runtime::MultiSigner::Sr25519(x.into())
}
}
+5 -5
View File
@@ -1,18 +1,18 @@
[package]
description = "Substrate offchain workers primitives"
name = "substrate-offchain-primitives"
name = "sp-offchain"
version = "2.0.0"
license = "GPL-3.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
[dependencies]
sr-api = { path = "../sr-api", default-features = false }
sr-primitives = { path = "../sr-primitives", default-features = false }
sp-api = { path = "../sr-api", default-features = false }
sp-runtime = { path = "../sr-primitives", default-features = false }
[features]
default = ["std"]
std = [
"sr-api/std",
"sr-primitives/std"
"sp-api/std",
"sp-runtime/std"
]
+2 -2
View File
@@ -19,12 +19,12 @@
#![cfg_attr(not(feature = "std"), no_std)]
#![warn(missing_docs)]
use sr_primitives::traits::NumberFor;
use sp_runtime::traits::NumberFor;
/// Local Storage Prefix used by the Offchain Worker API to
pub const STORAGE_PREFIX: &[u8] = b"storage";
sr_api::decl_runtime_apis! {
sp_api::decl_runtime_apis! {
/// The offchain worker api.
pub trait OffchainWorkerApi {
/// Starts the off-chain task for given block number.
@@ -1,5 +1,5 @@
[package]
name = "substrate-panic-handler"
name = "sp-panic-handler"
version = "2.0.0"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Substrate panic handler."
+5 -5
View File
@@ -1,17 +1,17 @@
[package]
name = "substrate-phragmen"
name = "sp-phragmen"
version = "2.0.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
[dependencies]
serde = { version = "1.0.101", optional = true, features = ["derive"] }
rstd = { package = "sr-std", path = "../sr-std", default-features = false }
sr-primitives = { path = "../../primitives/sr-primitives", default-features = false }
rstd = { package = "sp-std", path = "../sr-std", default-features = false }
sp-runtime = { path = "../../primitives/sr-primitives", default-features = false }
[dev-dependencies]
substrate-test-utils = { path = "../../test/utils" }
runtime-io ={ package = "sr-io", path = "../../primitives/sr-io" }
runtime-io ={ package = "sp-io", path = "../../primitives/sr-io" }
rand = "0.7.2"
[features]
@@ -19,5 +19,5 @@ default = ["std"]
std = [
"serde",
"rstd/std",
"sr-primitives/std",
"sp-runtime/std",
]
@@ -23,11 +23,11 @@ extern crate test;
use test::Bencher;
use rand::{self, Rng};
extern crate substrate_phragmen as phragmen;
extern crate sp_phragmen as phragmen;
use phragmen::{Support, SupportMap, PhragmenStakedAssignment};
use std::collections::BTreeMap;
use sr_primitives::traits::{Convert, SaturatedConversion};
use sp_runtime::traits::{Convert, SaturatedConversion};
const VALIDATORS: u64 = 1000;
const NOMINATORS: u64 = 10_000;
+3 -3
View File
@@ -34,9 +34,9 @@
#![cfg_attr(not(feature = "std"), no_std)]
use rstd::{prelude::*, collections::btree_map::BTreeMap};
use sr_primitives::RuntimeDebug;
use sr_primitives::{helpers_128bit::multiply_by_rational, Perbill, Rational128};
use sr_primitives::traits::{Zero, Convert, Member, SimpleArithmetic, Saturating, Bounded};
use sp_runtime::RuntimeDebug;
use sp_runtime::{helpers_128bit::multiply_by_rational, Perbill, Rational128};
use sp_runtime::traits::{Zero, Convert, Member, SimpleArithmetic, Saturating, Bounded};
#[cfg(test)]
mod mock;
+1 -1
View File
@@ -19,7 +19,7 @@
#![cfg(test)]
use crate::{elect, PhragmenResult, PhragmenAssignment};
use sr_primitives::{
use sp_runtime::{
assert_eq_error_rate, Perbill,
traits::{Convert, Member, SaturatedConversion}
};
+1 -1
View File
@@ -21,7 +21,7 @@
use crate::mock::*;
use crate::{elect, PhragmenResult};
use substrate_test_utils::assert_eq_uvec;
use sr_primitives::Perbill;
use sp_runtime::Perbill;
#[test]
fn float_phragmen_poc_works() {
+2 -2
View File
@@ -1,12 +1,12 @@
[package]
name = "substrate-rpc-primitives"
name = "sp-rpc"
version = "2.0.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
[dependencies]
serde = { version = "1.0.101", features = ["derive"] }
primitives = { package = "substrate-primitives", path = "../core" }
primitives = { package = "sp-core", path = "../core" }
[dev-dependencies]
serde_json = "1.0.41"
@@ -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" }
+1 -1
View File
@@ -1,5 +1,5 @@
[package]
name = "substrate-serializer"
name = "sp-serializer"
version = "2.0.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
+5 -5
View File
@@ -1,14 +1,14 @@
[package]
name = "substrate-session"
name = "sp-sesssion"
version = "2.0.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
[dependencies]
sr-api = { path = "../sr-api", default-features = false }
rstd = { package = "sr-std", path = "../sr-std", default-features = false }
sr-primitives = { path = "../sr-primitives", optional = true }
sp-api = { path = "../sr-api", default-features = false }
rstd = { package = "sp-std", path = "../sr-std", default-features = false }
sp-runtime = { path = "../sr-primitives", optional = true }
[features]
default = [ "std" ]
std = [ "sr-api/std", "rstd/std", "sr-primitives" ]
std = [ "sp-api/std", "rstd/std", "sp-runtime" ]
+3 -3
View File
@@ -21,9 +21,9 @@
use rstd::vec::Vec;
#[cfg(feature = "std")]
use sr_primitives::{generic::BlockId, traits::{ProvideRuntimeApi, Block as BlockT}};
use sp_runtime::{generic::BlockId, traits::{ProvideRuntimeApi, Block as BlockT}};
sr_api::decl_runtime_apis! {
sp_api::decl_runtime_apis! {
/// Session keys runtime api.
pub trait SessionKeys {
/// Generate a set of session keys with optionally using the given seed.
@@ -44,7 +44,7 @@ pub fn generate_initial_session_keys<Block, T>(
client: std::sync::Arc<T>,
at: &BlockId<Block>,
seeds: Vec<String>,
) -> Result<(), <<T as ProvideRuntimeApi>::Api as sr_api::ApiExt<Block>>::Error>
) -> Result<(), <<T as ProvideRuntimeApi>::Api as sp_api::ApiExt<Block>>::Error>
where
Block: BlockT,
T: ProvideRuntimeApi,
+9 -9
View File
@@ -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",
]
+3 -3
View File
@@ -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()
}
+4 -4
View File
@@ -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! {
+6 -6
View File
@@ -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
@@ -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();
}
@@ -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!()
@@ -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!()
}
@@ -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!()
@@ -1,5 +1,5 @@
[package]
name = "sr-arithmetic"
name = "sp-arithmetic"
version = "2.0.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
@@ -8,9 +8,9 @@ edition = "2018"
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
integer-sqrt = "0.1.2"
num-traits = { version = "0.2.8", default-features = false }
rstd = { package = "sr-std", path = "../sr-std", default-features = false }
rstd = { package = "sp-std", path = "../sr-std", default-features = false }
serde = { version = "1.0.101", optional = true, features = ["derive"] }
substrate-debug-derive = { path = "../../primitives/core/debug-derive", default-features = false }
sp-debug-derive = { path = "../../primitives/core/debug-derive", default-features = false }
[dev-dependencies]
primitive-types = "0.6.0"
@@ -24,7 +24,7 @@ std = [
"num-traits/std",
"rstd/std",
"serde",
"substrate-debug-derive/std",
"sp-debug-derive/std",
]
[[bench]]

Some files were not shown because too many files have changed in this diff Show More