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
+5 -5
View File
@@ -8,23 +8,23 @@ edition = "2018"
serde = { version = "1.0.101", optional = true }
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false }
# Needed for various traits. In our case, `OnFinalize`.
sr-primitives = { path = "../../primitives/sr-primitives", default-features = false }
sp-runtime = { path = "../../primitives/sr-primitives", default-features = false }
# Needed for type-safe access to storage DB.
support = { package = "frame-support", path = "../support", default-features = false }
# `system` module provides us with all sorts of useful stuff and macros depend on it being around.
system = { package = "frame-system", path = "../system", default-features = false }
[dev-dependencies]
primitives = { package = "substrate-primitives", path = "../../primitives/core" }
rstd = { package = "sr-std", path = "../../primitives/sr-std" }
runtime-io = { package = "sr-io", path = "../../primitives/sr-io" }
primitives = { package = "sp-core", path = "../../primitives/core" }
rstd = { package = "sp-std", path = "../../primitives/sr-std" }
runtime-io = { package = "sp-io", path = "../../primitives/sr-io" }
[features]
default = ["std"]
std = [
"serde",
"codec/std",
"sr-primitives/std",
"sp-runtime/std",
"support/std",
"system/std",
]
+3 -3
View File
@@ -131,9 +131,9 @@
#![cfg_attr(not(feature = "std"), no_std)]
use support::{Parameter, decl_module, decl_event, decl_storage, ensure};
use sr_primitives::traits::{Member, SimpleArithmetic, Zero, StaticLookup};
use sp_runtime::traits::{Member, SimpleArithmetic, Zero, StaticLookup};
use system::ensure_signed;
use sr_primitives::traits::One;
use sp_runtime::traits::One;
/// The module configuration trait.
pub trait Trait: system::Trait {
@@ -244,7 +244,7 @@ mod tests {
use primitives::H256;
// The testing primitives are very useful for avoiding having to work with signatures
// or public keys. `u64` is used as the `AccountId` and no `Signature`s are required.
use sr_primitives::{Perbill, traits::{BlakeTwo256, IdentityLookup}, testing::Header};
use sp_runtime::{Perbill, traits::{BlakeTwo256, IdentityLookup}, testing::Header};
impl_outer_origin! {
pub enum Origin for Test {}
+9 -9
View File
@@ -5,17 +5,17 @@ authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
[dependencies]
app-crypto = { package = "substrate-application-crypto", path = "../../primitives/application-crypto", default-features = false }
app-crypto = { package = "sc-application-crypto", path = "../../primitives/application-crypto", default-features = false }
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
inherents = { package = "substrate-inherents", path = "../../primitives/inherents", default-features = false }
primitives = { package = "substrate-primitives", path = "../../primitives/core", default-features = false }
rstd = { package = "sr-std", path = "../../primitives/sr-std", default-features = false }
inherents = { package = "sp-inherents", path = "../../primitives/inherents", default-features = false }
primitives = { package = "sp-core", path = "../../primitives/core", default-features = false }
rstd = { package = "sp-std", path = "../../primitives/sr-std", default-features = false }
serde = { version = "1.0.101", optional = true }
session = { package = "pallet-session", path = "../session", default-features = false }
sr-primitives = { path = "../../primitives/sr-primitives", default-features = false }
runtime-io ={ package = "sr-io", path = "../../primitives/sr-io", default-features = false }
sp-runtime = { path = "../../primitives/sr-primitives", default-features = false }
runtime-io ={ package = "sp-io", path = "../../primitives/sr-io", default-features = false }
support = { package = "frame-support", path = "../support", default-features = false }
substrate-consensus-aura-primitives = { path = "../../primitives/consensus/aura", default-features = false}
sp-consensus-aura = { path = "../../primitives/consensus/aura", default-features = false}
system = { package = "frame-system", path = "../system", default-features = false }
sp-timestamp = { package = "sp-timestamp", path = "../../primitives/timestamp", default-features = false }
pallet-timestamp = { package = "pallet-timestamp", path = "../timestamp", default-features = false }
@@ -35,9 +35,9 @@ std = [
"primitives/std",
"rstd/std",
"serde",
"sr-primitives/std",
"sp-runtime/std",
"support/std",
"substrate-consensus-aura-primitives/std",
"sp-consensus-aura/std",
"system/std",
"sp-timestamp/std",
"pallet-timestamp/std",
+5 -5
View File
@@ -40,8 +40,8 @@
//!
//! If you're interested in hacking on this module, it is useful to understand the interaction with
//! `substrate/primitives/inherents/src/lib.rs` and, specifically, the required implementation of
//! [`ProvideInherent`](../substrate_inherents/trait.ProvideInherent.html) and
//! [`ProvideInherentData`](../substrate_inherents/trait.ProvideInherentData.html) to create and check inherents.
//! [`ProvideInherent`](../sp_inherents/trait.ProvideInherent.html) and
//! [`ProvideInherentData`](../sp_inherents/trait.ProvideInherentData.html) to create and check inherents.
#![cfg_attr(not(feature = "std"), no_std)]
@@ -53,13 +53,13 @@ use support::{
decl_storage, decl_module, Parameter, traits::{Get, FindAuthor},
ConsensusEngineId,
};
use sr_primitives::{
use sp_runtime::{
RuntimeAppPublic,
traits::{SaturatedConversion, Saturating, Zero, Member, IsMember}, generic::DigestItem,
};
use sp_timestamp::OnTimestampSet;
use inherents::{InherentIdentifier, InherentData, ProvideInherent, MakeFatalError};
use substrate_consensus_aura_primitives::{
use sp_consensus_aura::{
AURA_ENGINE_ID, ConsensusLog, AuthorityIndex,
inherents::{INHERENT_IDENTIFIER, AuraInherentData},
};
@@ -109,7 +109,7 @@ impl<T: Trait> Module<T> {
}
}
impl<T: Trait> sr_primitives::BoundToRuntimeAppPublic for Module<T> {
impl<T: Trait> sp_runtime::BoundToRuntimeAppPublic for Module<T> {
type Public = T::AuthorityId;
}
+3 -3
View File
@@ -19,8 +19,8 @@
#![cfg(test)]
use crate::{Trait, Module, GenesisConfig};
use substrate_consensus_aura_primitives::ed25519::AuthorityId;
use sr_primitives::{
use sp_consensus_aura::ed25519::AuthorityId;
use sp_runtime::{
traits::IdentityLookup, Perbill,
testing::{Header, UintAuthorityId},
};
@@ -50,7 +50,7 @@ impl system::Trait for Test {
type BlockNumber = u64;
type Call = ();
type Hash = H256;
type Hashing = ::sr_primitives::traits::BlakeTwo256;
type Hashing = ::sp_runtime::traits::BlakeTwo256;
type AccountId = u64;
type Lookup = IdentityLookup<Self::AccountId>;
type Header = Header;
@@ -5,20 +5,20 @@ authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
[dependencies]
authority-discovery-primitives = { package = "substrate-authority-discovery-primitives", path = "../../primitives/authority-discovery", default-features = false }
app-crypto = { package = "substrate-application-crypto", path = "../../primitives/application-crypto", default-features = false }
authority-discovery-primitives = { package = "sp-authority-discovery", path = "../../primitives/authority-discovery", default-features = false }
app-crypto = { package = "sc-application-crypto", path = "../../primitives/application-crypto", default-features = false }
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
primitives = { package = "substrate-primitives", path = "../../primitives/core", default-features = false }
rstd = { package = "sr-std", path = "../../primitives/sr-std", default-features = false }
primitives = { package = "sp-core", path = "../../primitives/core", default-features = false }
rstd = { package = "sp-std", path = "../../primitives/sr-std", default-features = false }
serde = { version = "1.0.101", optional = true }
runtime-io = { package = "sr-io", path = "../../primitives/sr-io", default-features = false }
runtime-io = { package = "sp-io", path = "../../primitives/sr-io", default-features = false }
session = { package = "pallet-session", path = "../session", default-features = false, features = [ "historical" ] }
sr-primitives = { path = "../../primitives/sr-primitives", default-features = false }
sp-runtime = { path = "../../primitives/sr-primitives", default-features = false }
support = { package = "frame-support", path = "../support", default-features = false }
system = { package = "frame-system", path = "../system", default-features = false }
[dev-dependencies]
sr-staking-primitives = { path = "../../primitives/sr-staking-primitives", default-features = false }
sp-staking = { path = "../../primitives/sr-staking-primitives", default-features = false }
[features]
default = ["std"]
@@ -31,7 +31,7 @@ std = [
"runtime-io/std",
"serde",
"session/std",
"sr-primitives/std",
"sp-runtime/std",
"support/std",
"system/std",
]
@@ -59,7 +59,7 @@ impl<T: Trait> Module<T> {
}
}
impl<T: Trait> sr_primitives::BoundToRuntimeAppPublic for Module<T> {
impl<T: Trait> sp_runtime::BoundToRuntimeAppPublic for Module<T> {
type Public = AuthorityId;
}
@@ -96,7 +96,7 @@ mod tests {
use app_crypto::Pair;
use primitives::{crypto::key_types, H256};
use runtime_io::TestExternalities;
use sr_primitives::{
use sp_runtime::{
testing::{Header, UintAuthorityId}, traits::{ConvertInto, IdentityLookup, OpaqueKeys},
Perbill, KeyTypeId,
};
@@ -155,7 +155,7 @@ mod tests {
type BlockNumber = BlockNumber;
type Call = ();
type Hash = H256;
type Hashing = ::sr_primitives::traits::BlakeTwo256;
type Hashing = ::sp_runtime::traits::BlakeTwo256;
type AccountId = AuthorityId;
type Lookup = IdentityLookup<Self::AccountId>;
type Header = Header;
+6 -6
View File
@@ -6,15 +6,15 @@ authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
[dependencies]
primitives = { package = "substrate-primitives", path = "../../primitives/core", default-features = false }
primitives = { package = "sp-core", path = "../../primitives/core", default-features = false }
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
inherents = { package = "substrate-inherents", path = "../../primitives/inherents", default-features = false }
inherents = { package = "sp-inherents", path = "../../primitives/inherents", default-features = false }
sp-authorship = { path = "../../primitives/authorship", default-features = false }
rstd = { package = "sr-std", path = "../../primitives/sr-std", default-features = false }
sr-primitives = { path = "../../primitives/sr-primitives", default-features = false }
rstd = { package = "sp-std", path = "../../primitives/sr-std", default-features = false }
sp-runtime = { path = "../../primitives/sr-primitives", default-features = false }
support = { package = "frame-support", path = "../support", default-features = false }
system = { package = "frame-system", path = "../system", default-features = false }
runtime-io ={ package = "sr-io", path = "../../primitives/sr-io", default-features = false }
runtime-io ={ package = "sp-io", path = "../../primitives/sr-io", default-features = false }
impl-trait-for-tuples = "0.1.3"
[features]
@@ -23,7 +23,7 @@ std = [
"codec/std",
"primitives/std",
"inherents/std",
"sr-primitives/std",
"sp-runtime/std",
"rstd/std",
"support/std",
"system/std",
+3 -3
View File
@@ -27,7 +27,7 @@ use support::traits::{FindAuthor, VerifySeal, Get};
use support::dispatch::Result as DispatchResult;
use codec::{Encode, Decode};
use system::ensure_none;
use sr_primitives::traits::{Header as HeaderT, One, Zero};
use sp_runtime::traits::{Header as HeaderT, One, Zero};
use support::weights::SimpleDispatchInfo;
use inherents::{InherentIdentifier, ProvideInherent, InherentData, MakeFatalError};
use sp_authorship::{
@@ -144,7 +144,7 @@ where
}
}
#[derive(Encode, Decode, sr_primitives::RuntimeDebug)]
#[derive(Encode, Decode, sp_runtime::RuntimeDebug)]
#[cfg_attr(any(feature = "std", test), derive(PartialEq))]
enum UncleEntryItem<BlockNumber, Hash, Author> {
InclusionHeight(BlockNumber),
@@ -362,7 +362,7 @@ impl<T: Trait> ProvideInherent for Module<T> {
mod tests {
use super::*;
use primitives::H256;
use sr_primitives::{
use sp_runtime::{
traits::{BlakeTwo256, IdentityLookup}, testing::Header, generic::DigestItem, Perbill,
};
use support::{parameter_types, impl_outer_origin, ConsensusEngineId, weights::Weight};
+10 -10
View File
@@ -8,23 +8,23 @@ edition = "2018"
hex-literal = "0.2.1"
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
serde = { version = "1.0.101", optional = true }
inherents = { package = "substrate-inherents", path = "../../primitives/inherents", default-features = false }
rstd = { package = "sr-std", path = "../../primitives/sr-std", default-features = false }
sr-primitives = { path = "../../primitives/sr-primitives", default-features = false }
sr-staking-primitives = { path = "../../primitives/sr-staking-primitives", default-features = false }
inherents = { package = "sp-inherents", path = "../../primitives/inherents", default-features = false }
rstd = { package = "sp-std", path = "../../primitives/sr-std", default-features = false }
sp-runtime = { path = "../../primitives/sr-primitives", default-features = false }
sp-staking = { path = "../../primitives/sr-staking-primitives", default-features = false }
support = { package = "frame-support", path = "../support", default-features = false }
system = { package = "frame-system", path = "../system", default-features = false }
timestamp = { package = "pallet-timestamp", path = "../timestamp", default-features = false }
sp-timestamp = { path = "../../primitives/timestamp", default-features = false }
session = { package = "pallet-session", path = "../session", default-features = false }
babe-primitives = { package = "substrate-consensus-babe-primitives", path = "../../primitives/consensus/babe", default-features = false }
runtime-io ={ package = "sr-io", path = "../../primitives/sr-io", default-features = false }
babe-primitives = { package = "sp-consensus-babe", path = "../../primitives/consensus/babe", default-features = false }
runtime-io ={ package = "sp-io", path = "../../primitives/sr-io", default-features = false }
[dev-dependencies]
lazy_static = "1.4.0"
parking_lot = "0.9.0"
sr-version = { path = "../../primitives/sr-version", default-features = false }
primitives = { package = "substrate-primitives", path = "../../primitives/core" }
sp-version = { path = "../../primitives/sr-version", default-features = false }
primitives = { package = "sp-core", path = "../../primitives/core" }
test-runtime = { package = "substrate-test-runtime", path = "../../test/utils/runtime" }
[features]
@@ -34,8 +34,8 @@ std = [
"codec/std",
"rstd/std",
"support/std",
"sr-primitives/std",
"sr-staking-primitives/std",
"sp-runtime/std",
"sp-staking/std",
"system/std",
"timestamp/std",
"sp-timestamp/std",
+5 -5
View File
@@ -26,9 +26,9 @@ use sp_timestamp;
use rstd::{result, prelude::*};
use support::{decl_storage, decl_module, traits::FindAuthor, traits::Get};
use sp_timestamp::OnTimestampSet;
use sr_primitives::{generic::DigestItem, ConsensusEngineId, Perbill};
use sr_primitives::traits::{IsMember, SaturatedConversion, Saturating, RandomnessBeacon};
use sr_staking_primitives::{
use sp_runtime::{generic::DigestItem, ConsensusEngineId, Perbill};
use sp_runtime::traits::{IsMember, SaturatedConversion, Saturating, RandomnessBeacon};
use sp_staking::{
SessionIndex,
offence::{Offence, Kind},
};
@@ -306,7 +306,7 @@ impl<T: Trait> Module<T> {
// epoch 0 as having started at the slot of block 1. We want to use
// the same randomness and validator set as signalled in the genesis,
// so we don't rotate the epoch.
now != sr_primitives::traits::One::one() && {
now != sp_runtime::traits::One::one() && {
let diff = CurrentSlot::get().saturating_sub(Self::current_epoch_start());
diff >= T::EpochDuration::get()
}
@@ -472,7 +472,7 @@ impl<T: Trait> OnTimestampSet<T::Moment> for Module<T> {
fn on_timestamp_set(_moment: T::Moment) { }
}
impl<T: Trait> sr_primitives::BoundToRuntimeAppPublic for Module<T> {
impl<T: Trait> sp_runtime::BoundToRuntimeAppPublic for Module<T> {
type Public = AuthorityId;
}
+3 -3
View File
@@ -19,10 +19,10 @@
use super::{Trait, Module, GenesisConfig};
use babe_primitives::AuthorityId;
use sr_primitives::{
use sp_runtime::{
traits::IdentityLookup, Perbill, testing::{Header, UintAuthorityId}, impl_opaque_keys,
};
use sr_version::RuntimeVersion;
use sp_version::RuntimeVersion;
use support::{impl_outer_origin, parameter_types, weights::Weight};
use runtime_io;
use primitives::{H256, Blake2Hasher};
@@ -56,7 +56,7 @@ impl system::Trait for Test {
type Call = ();
type Hash = H256;
type Version = Version;
type Hashing = sr_primitives::traits::BlakeTwo256;
type Hashing = sp_runtime::traits::BlakeTwo256;
type AccountId = DummyValidatorId;
type Lookup = IdentityLookup<Self::AccountId>;
type Header = Header;
+1 -1
View File
@@ -18,7 +18,7 @@
use super::*;
use mock::{new_test_ext, Babe, Test};
use sr_primitives::{traits::OnFinalize, testing::{Digest, DigestItem}};
use sp_runtime::{traits::OnFinalize, testing::{Digest, DigestItem}};
use session::ShouldEndSession;
const EMPTY_RANDOMNESS: [u8; 32] = [
+5 -5
View File
@@ -8,14 +8,14 @@ edition = "2018"
serde = { version = "1.0.101", optional = true }
safe-mix = { version = "1.0.0", default-features = false }
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
rstd = { package = "sr-std", path = "../../primitives/sr-std", default-features = false }
sr-primitives = { path = "../../primitives/sr-primitives", default-features = false }
rstd = { package = "sp-std", path = "../../primitives/sr-std", default-features = false }
sp-runtime = { path = "../../primitives/sr-primitives", default-features = false }
support = { package = "frame-support", path = "../support", default-features = false }
system = { package = "frame-system", path = "../system", default-features = false }
[dev-dependencies]
runtime-io = { package = "sr-io", path = "../../primitives/sr-io" }
primitives = { package = "substrate-primitives", path = "../../primitives/core" }
runtime-io = { package = "sp-io", path = "../../primitives/sr-io" }
primitives = { package = "sp-core", path = "../../primitives/core" }
transaction-payment = { package = "pallet-transaction-payment", path = "../transaction-payment" }
[features]
@@ -26,6 +26,6 @@ std = [
"codec/std",
"rstd/std",
"support/std",
"sr-primitives/std",
"sp-runtime/std",
"system/std",
]
+3 -3
View File
@@ -122,7 +122,7 @@
//!
//! ```
//! use support::traits::{WithdrawReasons, LockableCurrency};
//! use sr_primitives::traits::Bounded;
//! use sp_runtime::traits::Bounded;
//! pub trait Trait: system::Trait {
//! type Currency: LockableCurrency<Self::AccountId, Moment=Self::BlockNumber>;
//! }
@@ -172,7 +172,7 @@ use support::{
weights::SimpleDispatchInfo,
dispatch::Result,
};
use sr_primitives::{
use sp_runtime::{
RuntimeDebug,
traits::{
Zero, SimpleArithmetic, StaticLookup, Member, CheckedAdd, CheckedSub, MaybeSerializeDeserialize,
@@ -328,7 +328,7 @@ decl_storage! {
// Total genesis `balance` minus `liquid` equals funds locked for vesting
let locked = balance.saturating_sub(liquid);
// Number of units unlocked per block after `begin`
let per_block = locked / length.max(sr_primitives::traits::One::one());
let per_block = locked / length.max(sp_runtime::traits::One::one());
(who.clone(), VestingSchedule {
locked: locked,
+2 -2
View File
@@ -16,7 +16,7 @@
//! Test utilities
use sr_primitives::{Perbill, traits::{ConvertInto, IdentityLookup}, testing::Header};
use sp_runtime::{Perbill, traits::{ConvertInto, IdentityLookup}, testing::Header};
use primitives::H256;
use runtime_io;
use support::{impl_outer_origin, parameter_types};
@@ -65,7 +65,7 @@ impl system::Trait for Runtime {
type BlockNumber = u64;
type Call = ();
type Hash = H256;
type Hashing = ::sr_primitives::traits::BlakeTwo256;
type Hashing = ::sp_runtime::traits::BlakeTwo256;
type AccountId = u64;
type Lookup = IdentityLookup<Self::AccountId>;
type Header = Header;
+1 -1
View File
@@ -18,7 +18,7 @@
use super::*;
use mock::{Balances, ExtBuilder, Runtime, System, info_from_weight, CALL};
use sr_primitives::traits::SignedExtension;
use sp_runtime::traits::SignedExtension;
use support::{
assert_noop, assert_ok, assert_err,
traits::{LockableCurrency, LockIdentifier, WithdrawReason, WithdrawReasons,
+5 -5
View File
@@ -8,10 +8,10 @@ edition = "2018"
serde = { version = "1.0.101", optional = true }
safe-mix = { version = "1.0.0", default-features = false }
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
primitives = { package = "substrate-primitives", path = "../../primitives/core", default-features = false }
rstd = { package = "sr-std", path = "../../primitives/sr-std", default-features = false }
runtime-io = { package = "sr-io", path = "../../primitives/sr-io", default-features = false }
sr-primitives = { path = "../../primitives/sr-primitives", default-features = false }
primitives = { package = "sp-core", path = "../../primitives/core", default-features = false }
rstd = { package = "sp-std", path = "../../primitives/sr-std", default-features = false }
runtime-io = { package = "sp-io", path = "../../primitives/sr-io", default-features = false }
sp-runtime = { path = "../../primitives/sr-primitives", default-features = false }
support = { package = "frame-support", path = "../support", default-features = false }
system = { package = "frame-system", path = "../system", default-features = false }
@@ -29,6 +29,6 @@ std = [
"serde",
"runtime-io/std",
"support/std",
"sr-primitives/std",
"sp-runtime/std",
"system/std",
]
+5 -5
View File
@@ -25,8 +25,8 @@
use rstd::{prelude::*, result};
use primitives::u32_trait::Value as U32;
use sr_primitives::RuntimeDebug;
use sr_primitives::traits::{Hash, EnsureOrigin};
use sp_runtime::RuntimeDebug;
use sp_runtime::traits::{Hash, EnsureOrigin};
use support::weights::SimpleDispatchInfo;
use support::{
dispatch::{Dispatchable, Parameter}, codec::{Encode, Decode},
@@ -382,7 +382,7 @@ mod tests {
use system::{EventRecord, Phase};
use hex_literal::hex;
use primitives::H256;
use sr_primitives::{
use sp_runtime::{
Perbill, traits::{BlakeTwo256, IdentityLookup, Block as BlockT}, testing::Header,
BuildStorage,
};
@@ -422,8 +422,8 @@ mod tests {
type Event = Event;
}
pub type Block = sr_primitives::generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = sr_primitives::generic::UncheckedExtrinsic<u32, u64, Call, ()>;
pub type Block = sp_runtime::generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic<u32, u64, Call, ()>;
support::construct_runtime!(
pub enum Test where
+6 -6
View File
@@ -10,11 +10,11 @@ pwasm-utils = { version = "0.12.0", default-features = false }
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
parity-wasm = { version = "0.41.0", default-features = false }
wasmi-validation = { version = "0.3.0", default-features = false }
primitives = { package = "substrate-primitives", path = "../../primitives/core", default-features = false }
sr-primitives = { path = "../../primitives/sr-primitives", default-features = false }
runtime-io = { package = "sr-io", path = "../../primitives/sr-io", default-features = false }
rstd = { package = "sr-std", path = "../../primitives/sr-std", default-features = false }
sandbox = { package = "sr-sandbox", path = "../../primitives/sr-sandbox", default-features = false }
primitives = { package = "sp-core", path = "../../primitives/core", default-features = false }
sp-runtime = { path = "../../primitives/sr-primitives", default-features = false }
runtime-io = { package = "sp-io", path = "../../primitives/sr-io", default-features = false }
rstd = { package = "sp-std", path = "../../primitives/sr-std", default-features = false }
sandbox = { package = "sp-sandbox", path = "../../primitives/sr-sandbox", default-features = false }
support = { package = "frame-support", path = "../support", default-features = false }
system = { package = "frame-system", path = "../system", default-features = false }
@@ -32,7 +32,7 @@ std = [
"serde",
"codec/std",
"primitives/std",
"sr-primitives/std",
"sp-runtime/std",
"runtime-io/std",
"rstd/std",
"sandbox/std",
+3 -3
View File
@@ -10,8 +10,8 @@ jsonrpc-core = "14.0.3"
jsonrpc-core-client = "14.0.3"
jsonrpc-derive = "14.0.3"
sp-blockchain = { path = "../../../primitives/blockchain" }
primitives = { package = "substrate-primitives", path = "../../../primitives/core" }
rpc-primitives = { package = "substrate-rpc-primitives", path = "../../../primitives/rpc" }
primitives = { package = "sp-core", path = "../../../primitives/core" }
rpc-primitives = { package = "sp-rpc", path = "../../../primitives/rpc" }
serde = { version = "1.0.101", features = ["derive"] }
sr-primitives = { path = "../../../primitives/sr-primitives" }
sp-runtime = { path = "../../../primitives/sr-primitives" }
pallet-contracts-rpc-runtime-api = { path = "./runtime-api" }
@@ -5,18 +5,18 @@ authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
[dependencies]
sr-api = { path = "../../../../primitives/sr-api", default-features = false }
sp-api = { path = "../../../../primitives/sr-api", default-features = false }
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
rstd = { package = "sr-std", path = "../../../../primitives/sr-std", default-features = false }
rstd = { package = "sp-std", path = "../../../../primitives/sr-std", default-features = false }
serde = { version = "1.0.101", optional = true, features = ["derive"] }
sr-primitives = { path = "../../../../primitives/sr-primitives", default-features = false }
sp-runtime = { path = "../../../../primitives/sr-primitives", default-features = false }
[features]
default = ["std"]
std = [
"sr-api/std",
"sp-api/std",
"codec/std",
"rstd/std",
"serde",
"sr-primitives/std",
"sp-runtime/std",
]
@@ -24,7 +24,7 @@
use rstd::vec::Vec;
use codec::{Encode, Decode, Codec};
use sr_primitives::RuntimeDebug;
use sp_runtime::RuntimeDebug;
/// A result of execution of a contract.
#[derive(Eq, PartialEq, Encode, Decode, RuntimeDebug)]
@@ -59,7 +59,7 @@ pub enum GetStorageError {
IsTombstone,
}
sr_api::decl_runtime_apis! {
sp_api::decl_runtime_apis! {
/// The API to interact with contracts without using executive.
pub trait ContractsApi<AccountId, Balance> where
AccountId: Codec,
+1 -1
View File
@@ -25,7 +25,7 @@ use jsonrpc_derive::rpc;
use primitives::{H256, Bytes};
use rpc_primitives::number;
use serde::{Deserialize, Serialize};
use sr_primitives::{
use sp_runtime::{
generic::BlockId,
traits::{Block as BlockT, ProvideRuntimeApi},
};
+1 -1
View File
@@ -25,7 +25,7 @@ use rstd::cell::RefCell;
use rstd::collections::btree_map::{BTreeMap, Entry};
use rstd::prelude::*;
use runtime_io::hashing::blake2_256;
use sr_primitives::traits::{Bounded, Zero};
use sp_runtime::traits::{Bounded, Zero};
use support::traits::{Currency, Get, Imbalance, SignedImbalance, UpdateBalanceOutcome};
use support::{storage::child, StorageMap};
use system;
+3 -3
View File
@@ -21,7 +21,7 @@ use crate::gas::{Gas, GasMeter, Token, approx_gas_for_balance};
use crate::rent;
use rstd::prelude::*;
use sr_primitives::traits::{Bounded, CheckedAdd, CheckedSub, Zero};
use sp_runtime::traits::{Bounded, CheckedAdd, CheckedSub, Zero};
use support::{
storage::unhashed,
traits::{WithdrawReason, Currency, Time, Randomness},
@@ -64,7 +64,7 @@ impl ExecReturnValue {
/// VM-specific errors during execution (eg. division by 0, OOB access, failure to satisfy some
/// precondition of a system call, etc.) or errors with the orchestration (eg. out-of-gas errors, a
/// non-existent destination contract, etc.).
#[cfg_attr(test, derive(sr_primitives::RuntimeDebug))]
#[cfg_attr(test, derive(sp_runtime::RuntimeDebug))]
pub struct ExecError {
pub reason: &'static str,
/// This is an allocated buffer that may be reused. The buffer must be cleared explicitly
@@ -239,7 +239,7 @@ impl<T: Trait> Token<T> for ExecFeeToken {
}
#[cfg_attr(any(feature = "std", test), derive(PartialEq, Eq, Clone))]
#[derive(sr_primitives::RuntimeDebug)]
#[derive(sp_runtime::RuntimeDebug)]
pub enum DeferredAction<T: Trait> {
DepositEvent {
/// A list of topics this event will be deposited with.
+1 -1
View File
@@ -16,7 +16,7 @@
use crate::{GasSpent, Module, Trait, BalanceOf, NegativeImbalanceOf};
use rstd::convert::TryFrom;
use sr_primitives::traits::{
use sp_runtime::traits::{
CheckedMul, Zero, SaturatedConversion, SimpleArithmetic, UniqueSaturatedInto,
};
use support::{
+1 -1
View File
@@ -112,7 +112,7 @@ use primitives::crypto::UncheckedFrom;
use rstd::{prelude::*, marker::PhantomData, fmt::Debug};
use codec::{Codec, Encode, Decode};
use runtime_io::hashing::blake2_256;
use sr_primitives::{
use sp_runtime::{
traits::{Hash, StaticLookup, Zero, MaybeSerializeDeserialize, Member, SignedExtension},
transaction_validity::{
ValidTransaction, InvalidTransaction, TransactionValidity, TransactionValidityError,
+1 -1
View File
@@ -15,7 +15,7 @@
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
use crate::{BalanceOf, ContractInfo, ContractInfoOf, TombstoneContractInfo, Trait, AliveContractInfo};
use sr_primitives::traits::{Bounded, CheckedDiv, CheckedMul, Saturating, Zero,
use sp_runtime::traits::{Bounded, CheckedDiv, CheckedMul, Saturating, Zero,
SaturatedConversion};
use support::traits::{Currency, ExistenceRequirement, Get, WithdrawReason, OnUnbalanced};
use support::StorageMap;
+1 -1
View File
@@ -27,7 +27,7 @@ use crate::{
use assert_matches::assert_matches;
use hex_literal::*;
use codec::{Decode, Encode, KeyedVec};
use sr_primitives::{
use sp_runtime::{
Perbill, BuildStorage, transaction_validity::{InvalidTransaction, ValidTransaction},
traits::{BlakeTwo256, Hash, IdentityLookup, SignedExtension},
testing::{Digest, DigestItem, Header, UintAuthorityId, H256},
@@ -30,7 +30,7 @@ use crate::gas::{Gas, GasMeter, Token};
use crate::wasm::{prepare, runtime::Env, PrefabWasmModule};
use crate::{CodeHash, CodeStorage, PristineCode, Schedule, Trait};
use rstd::prelude::*;
use sr_primitives::traits::{Hash, Bounded};
use sp_runtime::traits::{Hash, Bounded};
use support::StorageMap;
/// Gas metering token that used for charging storing code into the code storage.
@@ -195,7 +195,7 @@ macro_rules! define_env {
mod tests {
use parity_wasm::elements::FunctionType;
use parity_wasm::elements::ValueType;
use sr_primitives::traits::Zero;
use sp_runtime::traits::Zero;
use sandbox::{self, ReturnValue, TypedValue};
use crate::wasm::tests::MockExt;
use crate::wasm::Runtime;
@@ -26,7 +26,7 @@ use parity_wasm::elements::{self, Internal, External, MemoryType, Type, ValueTyp
use pwasm_utils;
use pwasm_utils::rules;
use rstd::prelude::*;
use sr_primitives::traits::{SaturatedConversion};
use sp_runtime::traits::{SaturatedConversion};
struct ContractModule<'a> {
/// A deserialized module. The module is valid (this is Guaranteed by `new` method).
@@ -27,7 +27,7 @@ use rstd::prelude::*;
use rstd::convert::TryInto;
use rstd::mem;
use codec::{Decode, Encode};
use sr_primitives::traits::{Bounded, SaturatedConversion};
use sp_runtime::traits::{Bounded, SaturatedConversion};
/// The value returned from ext_call and ext_instantiate contract external functions if the call or
/// instantiation traps. This value is chosen as if the execution does not trap, the return value
@@ -824,7 +824,7 @@ define_env!(Env, <E: Ext>,
ext_println(ctx, str_ptr: u32, str_len: u32) => {
let data = read_sandbox_memory(ctx, str_ptr, str_len)?;
if let Ok(utf8) = core::str::from_utf8(&data) {
sr_primitives::print(utf8);
sp_runtime::print(utf8);
}
Ok(())
},
+5 -5
View File
@@ -8,14 +8,14 @@ edition = "2018"
serde = { version = "1.0.101", optional = true, features = ["derive"] }
safe-mix = { version = "1.0.0", default-features = false }
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
rstd = { package = "sr-std", path = "../../primitives/sr-std", default-features = false }
runtime-io = { package = "sr-io", path = "../../primitives/sr-io", default-features = false }
sr-primitives = { path = "../../primitives/sr-primitives", default-features = false }
rstd = { package = "sp-std", path = "../../primitives/sr-std", default-features = false }
runtime-io = { package = "sp-io", path = "../../primitives/sr-io", default-features = false }
sp-runtime = { path = "../../primitives/sr-primitives", default-features = false }
support = { package = "frame-support", path = "../support", default-features = false }
system = { package = "frame-system", path = "../system", default-features = false }
[dev-dependencies]
primitives = { package = "substrate-primitives", path = "../../primitives/core" }
primitives = { package = "sp-core", path = "../../primitives/core" }
balances = { package = "pallet-balances", path = "../balances" }
[features]
@@ -27,6 +27,6 @@ std = [
"rstd/std",
"runtime-io/std",
"support/std",
"sr-primitives/std",
"sp-runtime/std",
"system/std",
]
+3 -3
View File
@@ -20,7 +20,7 @@
use rstd::prelude::*;
use rstd::{result, convert::TryFrom};
use sr_primitives::{
use sp_runtime::{
RuntimeDebug,
traits::{Zero, Bounded, CheckedMul, CheckedDiv, EnsureOrigin, Hash, Dispatchable, Saturating},
};
@@ -597,7 +597,7 @@ decl_module! {
fn on_initialize(n: T::BlockNumber) {
if let Err(e) = Self::begin_block(n) {
sr_primitives::print(e);
sp_runtime::print(e);
}
}
@@ -1092,7 +1092,7 @@ mod tests {
weights::Weight,
};
use primitives::H256;
use sr_primitives::{traits::{BlakeTwo256, IdentityLookup, Bounded}, testing::Header, Perbill};
use sp_runtime::{traits::{BlakeTwo256, IdentityLookup, Bounded}, testing::Header, Perbill};
use balances::BalanceLock;
use system::EnsureSignedBy;
@@ -19,11 +19,11 @@
#[cfg(feature = "std")]
use serde::{Serialize, Deserialize};
use codec::{Encode, Decode};
use sr_primitives::traits::{Zero, IntegerSquareRoot};
use sp_runtime::traits::{Zero, IntegerSquareRoot};
use rstd::ops::{Add, Mul, Div, Rem};
/// A means of determining if a vote is past pass threshold.
#[derive(Clone, Copy, PartialEq, Eq, Encode, Decode, sr_primitives::RuntimeDebug)]
#[derive(Clone, Copy, PartialEq, Eq, Encode, Decode, sp_runtime::RuntimeDebug)]
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
pub enum VoteThreshold {
/// A supermajority of approvals is needed to pass this vote.
@@ -6,17 +6,17 @@ edition = "2018"
[dependencies]
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
sr-primitives = { path = "../../primitives/sr-primitives", default-features = false }
phragmen = { package = "substrate-phragmen", path = "../../primitives/phragmen", default-features = false }
sp-runtime = { path = "../../primitives/sr-primitives", default-features = false }
phragmen = { package = "sp-phragmen", path = "../../primitives/phragmen", default-features = false }
support = { package = "frame-support", path = "../support", default-features = false }
system = { package = "frame-system", path = "../system", default-features = false }
rstd = { package = "sr-std", path = "../../primitives/sr-std", default-features = false }
rstd = { package = "sp-std", path = "../../primitives/sr-std", default-features = false }
[dev-dependencies]
runtime_io = { package = "sr-io", path = "../../primitives/sr-io" }
runtime_io = { package = "sp-io", path = "../../primitives/sr-io" }
hex-literal = "0.2.1"
balances = { package = "pallet-balances", path = "../balances" }
primitives = { package = "substrate-primitives", path = "../../primitives/core" }
primitives = { package = "sp-core", path = "../../primitives/core" }
substrate-test-utils = { path = "../../test/utils" }
serde = { version = "1.0.101" }
@@ -25,7 +25,7 @@ default = ["std"]
std = [
"codec/std",
"support/std",
"sr-primitives/std",
"sp-runtime/std",
"phragmen/std",
"system/std",
"rstd/std",
@@ -83,7 +83,7 @@
#![cfg_attr(not(feature = "std"), no_std)]
use rstd::prelude::*;
use sr_primitives::{print, traits::{Zero, StaticLookup, Bounded, Convert}};
use sp_runtime::{print, traits::{Zero, StaticLookup, Bounded, Convert}};
use support::weights::SimpleDispatchInfo;
use support::{
decl_storage, decl_event, ensure, decl_module, dispatch,
@@ -746,7 +746,7 @@ mod tests {
use support::{assert_ok, assert_noop, parameter_types, weights::Weight};
use substrate_test_utils::assert_eq_uvec;
use primitives::H256;
use sr_primitives::{
use sp_runtime::{
Perbill, testing::Header, BuildStorage,
traits::{BlakeTwo256, IdentityLookup, Block as BlockT},
};
@@ -857,8 +857,8 @@ mod tests {
type BadReport = ();
}
pub type Block = sr_primitives::generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = sr_primitives::generic::UncheckedExtrinsic<u32, u64, Call, ()>;
pub type Block = sp_runtime::generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic<u32, u64, Call, ()>;
support::construct_runtime!(
pub enum Test where
+5 -5
View File
@@ -8,10 +8,10 @@ edition = "2018"
serde = { version = "1.0.101", optional = true }
safe-mix = { version = "1.0.0", default-features = false }
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
primitives = { package = "substrate-primitives", path = "../../primitives/core", default-features = false }
rstd = { package = "sr-std", path = "../../primitives/sr-std", default-features = false }
runtime-io = { package = "sr-io", path = "../../primitives/sr-io", default-features = false }
sr-primitives = { path = "../../primitives/sr-primitives", default-features = false }
primitives = { package = "sp-core", path = "../../primitives/core", default-features = false }
rstd = { package = "sp-std", path = "../../primitives/sr-std", default-features = false }
runtime-io = { package = "sp-io", path = "../../primitives/sr-io", default-features = false }
sp-runtime = { path = "../../primitives/sr-primitives", default-features = false }
support = { package = "frame-support", path = "../support", default-features = false }
system = { package = "frame-system", path = "../system", default-features = false }
@@ -29,6 +29,6 @@ std = [
"serde",
"runtime-io/std",
"support/std",
"sr-primitives/std",
"sp-runtime/std",
"system/std",
]
+1 -1
View File
@@ -24,7 +24,7 @@
#![recursion_limit="128"]
use rstd::prelude::*;
use sr_primitives::{
use sp_runtime::{
RuntimeDebug,
print,
traits::{Zero, One, StaticLookup, Bounded, Saturating},
+3 -3
View File
@@ -25,7 +25,7 @@ use support::{
weights::Weight,
};
use primitives::H256;
use sr_primitives::{
use sp_runtime::{
Perbill, BuildStorage, testing::Header, traits::{BlakeTwo256, IdentityLookup, Block as BlockT},
};
use crate as elections;
@@ -142,8 +142,8 @@ impl elections::Trait for Test {
type DecayRatio = DecayRatio;
}
pub type Block = sr_primitives::generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = sr_primitives::generic::UncheckedExtrinsic<u32, u64, Call, ()>;
pub type Block = sp_runtime::generic::Block<Header, UncheckedExtrinsic>;
pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic<u32, u64, Call, ()>;
support::construct_runtime!(
pub enum Test where
+5 -5
View File
@@ -11,10 +11,10 @@ support = { package = "frame-support", path = "../support", default-features = f
system = { package = "frame-system", path = "../system", default-features = false }
timestamp = { package = "pallet-timestamp", path = "../timestamp", default-features = false }
balances = { package = "pallet-balances", path = "../balances", default-features = false }
primitives = { package = "substrate-primitives", path = "../../primitives/core", default-features = false }
sr-primitives = { path = "../../primitives/sr-primitives", default-features = false }
rstd = { package = "sr-std", path = "../../primitives/sr-std", default-features = false }
runtime-io = { package = "sr-io", path = "../../primitives/sr-io", default-features = false }
primitives = { package = "sp-core", path = "../../primitives/core", default-features = false }
sp-runtime = { path = "../../primitives/sr-primitives", default-features = false }
rstd = { package = "sp-std", path = "../../primitives/sr-std", default-features = false }
runtime-io = { package = "sp-io", path = "../../primitives/sr-io", default-features = false }
primitive-types = { version = "0.6", default-features = false, features = ["rlp"] }
rlp = { version = "0.4", default-features = false }
evm = { version = "0.14", default-features = false }
@@ -26,7 +26,7 @@ std = [
"serde",
"codec/std",
"primitives/std",
"sr-primitives/std",
"sp-runtime/std",
"support/std",
"system/std",
"balances/std",
+1 -1
View File
@@ -4,7 +4,7 @@ use rstd::vec::Vec;
use serde::{Serialize, Deserialize};
use codec::{Encode, Decode};
use primitives::{U256, H256, H160};
use sr_primitives::traits::UniqueSaturatedInto;
use sp_runtime::traits::UniqueSaturatedInto;
use support::storage::{StorageMap, StorageDoubleMap};
use sha3::{Keccak256, Digest};
use evm::Config;
+2 -2
View File
@@ -27,9 +27,9 @@ use rstd::vec::Vec;
use support::{dispatch::Result, decl_module, decl_storage, decl_event};
use support::traits::{Currency, WithdrawReason, ExistenceRequirement};
use system::ensure_signed;
use sr_primitives::ModuleId;
use sp_runtime::ModuleId;
use support::weights::SimpleDispatchInfo;
use sr_primitives::traits::{UniqueSaturatedInto, AccountIdConversion};
use sp_runtime::traits::{UniqueSaturatedInto, AccountIdConversion};
use primitives::{U256, H256, H160};
use evm::{ExitReason, ExitSucceed, ExitError};
use evm::executor::StackExecutor;
+5 -5
View File
@@ -10,19 +10,19 @@ codec = { package = "parity-scale-codec", version = "1.0.0", default-features =
support = { package = "frame-support", path = "../support", default-features = false }
system = { package = "frame-system", path = "../system", default-features = false }
balances = { package = "pallet-balances", path = "../balances", default-features = false }
sr-primitives = { path = "../../primitives/sr-primitives", default-features = false }
rstd = { package = "sr-std", path = "../../primitives/sr-std", default-features = false }
runtime-io = { package = "sr-io", path = "../../primitives/sr-io", default-features = false }
sp-runtime = { path = "../../primitives/sr-primitives", default-features = false }
rstd = { package = "sp-std", path = "../../primitives/sr-std", default-features = false }
runtime-io = { package = "sp-io", path = "../../primitives/sr-io", default-features = false }
[dev-dependencies]
primitives = { package = "substrate-primitives", path = "../../primitives/core" }
primitives = { package = "sp-core", path = "../../primitives/core" }
[features]
default = ["std"]
std = [
"serde",
"codec/std",
"sr-primitives/std",
"sp-runtime/std",
"support/std",
"system/std",
"balances/std",
+4 -4
View File
@@ -260,7 +260,7 @@ use support::{
};
use system::{ensure_signed, ensure_root};
use codec::{Encode, Decode};
use sr_primitives::{
use sp_runtime::{
traits::{SignedExtension, Bounded, SaturatedConversion},
transaction_validity::{
ValidTransaction, TransactionValidityError, InvalidTransaction, TransactionValidity,
@@ -581,7 +581,7 @@ impl<T: Trait> Module<T> {
// sender of the transaction (if signed) are also provided.
//
// The full list of hooks that can be added to a signed extension can be found
// [here](https://crates.parity.io/sr_primitives/traits/trait.SignedExtension.html).
// [here](https://crates.parity.io/sp_runtime/traits/trait.SignedExtension.html).
//
// The signed extensions are aggregated in the runtime file of a substrate chain. All extensions
// should be aggregated in a tuple and passed to the `CheckedExtrinsic` and `UncheckedExtrinsic`
@@ -630,7 +630,7 @@ impl<T: Trait + Send + Sync> SignedExtension for WatchDummy<T> {
// check for `set_dummy`
match call {
Call::set_dummy(..) => {
sr_primitives::print("set_dummy was received.");
sp_runtime::print("set_dummy was received.");
let mut valid_tx = ValidTransaction::default();
valid_tx.priority = Bounded::max_value();
@@ -649,7 +649,7 @@ mod tests {
use primitives::H256;
// The testing primitives are very useful for avoiding having to work with signatures
// or public keys. `u64` is used as the `AccountId` and no `Signature`s are required.
use sr_primitives::{
use sp_runtime::{
Perbill, testing::Header,
traits::{BlakeTwo256, OnInitialize, OnFinalize, IdentityLookup},
};
+5 -5
View File
@@ -7,15 +7,15 @@ edition = "2018"
[dependencies]
serde = { version = "1.0.101", optional = true }
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
rstd = { package = "sr-std", path = "../../primitives/sr-std", default-features = false }
runtime-io ={ package = "sr-io", path = "../../primitives/sr-io", default-features = false }
sr-primitives = { path = "../../primitives/sr-primitives", default-features = false }
rstd = { package = "sp-std", path = "../../primitives/sr-std", default-features = false }
runtime-io ={ package = "sp-io", path = "../../primitives/sr-io", default-features = false }
sp-runtime = { path = "../../primitives/sr-primitives", default-features = false }
support = { package = "frame-support", path = "../support", default-features = false }
system = { package = "frame-system", path = "../system", default-features = false }
[dev-dependencies]
hex-literal = "0.2.1"
primitives = { package = "substrate-primitives", path = "../../primitives/core" }
primitives = { package = "sp-core", path = "../../primitives/core" }
pallet-indices = { path = "../indices" }
balances = { package = "pallet-balances", path = "../balances" }
transaction-payment = { package = "pallet-transaction-payment", path = "../transaction-payment" }
@@ -27,7 +27,7 @@ std = [
"support/std",
"serde",
"codec/std",
"sr-primitives/std",
"sp-runtime/std",
"runtime-io/std",
"system/std",
]
+17 -17
View File
@@ -50,7 +50,7 @@
//! `Executive` type declaration from the node template.
//!
//! ```
//! # use sr_primitives::generic;
//! # use sp_runtime::generic;
//! # use frame_executive as executive;
//! # pub struct UncheckedExtrinsic {};
//! # pub struct Header {};
@@ -59,9 +59,9 @@
//! # pub type Balances = u64;
//! # pub type AllModules = u64;
//! # pub enum Runtime {};
//! # use sr_primitives::transaction_validity::{TransactionValidity, UnknownTransaction};
//! # use sp_runtime::transaction_validity::{TransactionValidity, UnknownTransaction};
//! # #[allow(deprecated)]
//! # use sr_primitives::traits::ValidateUnsigned;
//! # use sp_runtime::traits::ValidateUnsigned;
//! # #[allow(deprecated)]
//! # impl ValidateUnsigned for Runtime {
//! # type Call = ();
@@ -78,7 +78,7 @@
use rstd::{prelude::*, marker::PhantomData};
use support::weights::{GetDispatchInfo, WeighBlock, DispatchInfo};
use sr_primitives::{
use sp_runtime::{
generic::Digest, ApplyExtrinsicResult,
traits::{
self, Header, Zero, One, Checkable, Applyable, CheckEqual, OnFinalize, OnInitialize,
@@ -87,7 +87,7 @@ use sr_primitives::{
transaction_validity::TransactionValidity,
};
#[allow(deprecated)]
use sr_primitives::traits::ValidateUnsigned;
use sp_runtime::traits::ValidateUnsigned;
use codec::{Codec, Encode};
use system::{extrinsics_root, DigestOf};
@@ -243,7 +243,7 @@ where
let l = uxt.encode().len();
match Self::apply_extrinsic_with_len(uxt, l, None) {
Ok(Ok(())) => (),
Ok(Err(e)) => sr_primitives::print(e),
Ok(Err(e)) => sp_runtime::print(e),
Err(e) => { let err: &'static str = e.into(); panic!(err) },
}
}
@@ -320,7 +320,7 @@ where
mod tests {
use super::*;
use primitives::H256;
use sr_primitives::{
use sp_runtime::{
generic::Era, Perbill, DispatchError, testing::{Digest, Header, Block},
traits::{Bounded, Header as HeaderT, BlakeTwo256, IdentityLookup, ConvertInto},
transaction_validity::{InvalidTransaction, UnknownTransaction, TransactionValidityError},
@@ -468,7 +468,7 @@ mod tests {
transaction_payment::ChargeTransactionPayment<Runtime>
);
type AllModules = (System, Balances, Custom);
type TestXt = sr_primitives::testing::TestXt<Call, SignedExtra>;
type TestXt = sp_runtime::testing::TestXt<Call, SignedExtra>;
type Executive = super::Executive<Runtime, Block<TestXt>, ChainContext<Runtime>, Runtime, AllModules>;
fn extra(nonce: u64, fee: u64) -> SignedExtra {
@@ -491,7 +491,7 @@ mod tests {
balances: vec![(1, 211)],
vesting: vec![],
}.assimilate_storage(&mut t).unwrap();
let xt = sr_primitives::testing::TestXt(sign_extra(1, 0, 0), Call::Balances(BalancesCall::transfer(2, 69)));
let xt = sp_runtime::testing::TestXt(sign_extra(1, 0, 0), Call::Balances(BalancesCall::transfer(2, 69)));
let weight = xt.get_dispatch_info().weight as u64;
let mut t = runtime_io::TestExternalities::new(t);
t.execute_with(|| {
@@ -572,7 +572,7 @@ mod tests {
fn bad_extrinsic_not_inserted() {
let mut t = new_test_ext(1);
// bad nonce check!
let xt = sr_primitives::testing::TestXt(sign_extra(1, 30, 0), Call::Balances(BalancesCall::transfer(33, 69)));
let xt = sp_runtime::testing::TestXt(sign_extra(1, 30, 0), Call::Balances(BalancesCall::transfer(33, 69)));
t.execute_with(|| {
Executive::initialize_block(&Header::new(
1,
@@ -590,7 +590,7 @@ mod tests {
fn block_weight_limit_enforced() {
let mut t = new_test_ext(10000);
// given: TestXt uses the encoded len as fixed Len:
let xt = sr_primitives::testing::TestXt(sign_extra(1, 0, 0), Call::Balances(BalancesCall::transfer(33, 0)));
let xt = sp_runtime::testing::TestXt(sign_extra(1, 0, 0), Call::Balances(BalancesCall::transfer(33, 0)));
let encoded = xt.encode();
let encoded_len = encoded.len() as Weight;
let limit = AvailableBlockRatio::get() * MaximumBlockWeight::get() - 175;
@@ -607,7 +607,7 @@ mod tests {
assert_eq!(<system::Module<Runtime>>::all_extrinsics_weight(), 175);
for nonce in 0..=num_to_exhaust_block {
let xt = sr_primitives::testing::TestXt(
let xt = sp_runtime::testing::TestXt(
sign_extra(1, nonce.into(), 0), Call::Balances(BalancesCall::transfer(33, 0)),
);
let res = Executive::apply_extrinsic(xt);
@@ -627,9 +627,9 @@ mod tests {
#[test]
fn block_weight_and_size_is_stored_per_tx() {
let xt = sr_primitives::testing::TestXt(sign_extra(1, 0, 0), Call::Balances(BalancesCall::transfer(33, 0)));
let x1 = sr_primitives::testing::TestXt(sign_extra(1, 1, 0), Call::Balances(BalancesCall::transfer(33, 0)));
let x2 = sr_primitives::testing::TestXt(sign_extra(1, 2, 0), Call::Balances(BalancesCall::transfer(33, 0)));
let xt = sp_runtime::testing::TestXt(sign_extra(1, 0, 0), Call::Balances(BalancesCall::transfer(33, 0)));
let x1 = sp_runtime::testing::TestXt(sign_extra(1, 1, 0), Call::Balances(BalancesCall::transfer(33, 0)));
let x2 = sp_runtime::testing::TestXt(sign_extra(1, 2, 0), Call::Balances(BalancesCall::transfer(33, 0)));
let len = xt.clone().encode().len() as u32;
let mut t = new_test_ext(1);
t.execute_with(|| {
@@ -653,7 +653,7 @@ mod tests {
#[test]
fn validate_unsigned() {
let xt = sr_primitives::testing::TestXt(None, Call::Balances(BalancesCall::set_balance(33, 69, 69)));
let xt = sp_runtime::testing::TestXt(None, Call::Balances(BalancesCall::set_balance(33, 69, 69)));
let mut t = new_test_ext(1);
t.execute_with(|| {
@@ -682,7 +682,7 @@ mod tests {
Bounded::max_value(),
lock,
);
let xt = sr_primitives::testing::TestXt(
let xt = sp_runtime::testing::TestXt(
sign_extra(1, 0, 0),
Call::System(SystemCall::remark(vec![1u8])),
);
+6 -6
View File
@@ -7,17 +7,17 @@ edition = "2018"
[dependencies]
serde = { version = "1.0.101", default-features = false, features = ["derive"] }
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 }
sr-primitives = { path = "../../primitives/sr-primitives", default-features = false }
inherents = { package = "sp-inherents", path = "../../primitives/inherents", default-features = false }
rstd = { package = "sp-std", path = "../../primitives/sr-std", default-features = false }
sp-runtime = { path = "../../primitives/sr-primitives", default-features = false }
sp-finality-tracker = { path = "../../primitives/finality-tracker", default-features = false }
support = { package = "frame-support", path = "../support", default-features = false }
frame-system = { path = "../system", default-features = false }
impl-trait-for-tuples = "0.1.3"
[dev-dependencies]
primitives = { package = "substrate-primitives", path = "../../primitives/core", default-features = false }
runtime-io = { package = "sr-io", path = "../../primitives/sr-io", default-features = false }
primitives = { package = "sp-core", path = "../../primitives/core", default-features = false }
runtime-io = { package = "sp-io", path = "../../primitives/sr-io", default-features = false }
[features]
default = ["std"]
@@ -26,7 +26,7 @@ std = [
"codec/std",
"rstd/std",
"support/std",
"sr-primitives/std",
"sp-runtime/std",
"frame-system/std",
"sp-finality-tracker/std",
"inherents/std",
+2 -2
View File
@@ -19,7 +19,7 @@
#![cfg_attr(not(feature = "std"), no_std)]
use inherents::{InherentIdentifier, ProvideInherent, InherentData, MakeFatalError};
use sr_primitives::traits::{One, Zero, SaturatedConversion};
use sp_runtime::traits::{One, Zero, SaturatedConversion};
use rstd::{prelude::*, result, cmp, vec};
use support::{decl_module, decl_storage};
use support::traits::Get;
@@ -195,7 +195,7 @@ mod tests {
use runtime_io::TestExternalities;
use primitives::H256;
use sr_primitives::{
use sp_runtime::{
testing::Header, Perbill,
traits::{BlakeTwo256, IdentityLookup, OnFinalize, Header as HeaderT},
};
+5 -5
View File
@@ -7,14 +7,14 @@ edition = "2018"
[dependencies]
serde = { version = "1.0.101", optional = true }
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
rstd = { package = "sr-std", path = "../../primitives/sr-std", default-features = false }
sr-primitives = { path = "../../primitives/sr-primitives", default-features = false }
rstd = { package = "sp-std", path = "../../primitives/sr-std", default-features = false }
sp-runtime = { path = "../../primitives/sr-primitives", default-features = false }
support = { package = "frame-support", path = "../support", default-features = false }
system = { package = "frame-system", path = "../system", default-features = false }
[dev-dependencies]
runtime-io ={ package = "sr-io", path = "../../primitives/sr-io" }
primitives = { package = "substrate-primitives", path = "../../primitives/core" }
runtime-io ={ package = "sp-io", path = "../../primitives/sr-io" }
primitives = { package = "sp-core", path = "../../primitives/core" }
[features]
default = ["std"]
@@ -22,7 +22,7 @@ std =[
"serde/std",
"codec/std",
"rstd/std",
"sr-primitives/std",
"sp-runtime/std",
"support/std",
"system/std",
]
+2 -2
View File
@@ -153,8 +153,8 @@
use codec::{Decode, Encode, HasCompact, Input, Output, Error};
use sr_primitives::RuntimeDebug;
use sr_primitives::traits::{
use sp_runtime::RuntimeDebug;
use sp_runtime::traits::{
CheckedAdd, CheckedSub, MaybeSerializeDeserialize, Member, One, Saturating, SimpleArithmetic,
Zero, Bounded,
};
+1 -1
View File
@@ -20,7 +20,7 @@
#![cfg(test)]
use sr_primitives::{
use sp_runtime::{
Perbill,
testing::Header,
traits::{BlakeTwo256, IdentityLookup},
+9 -9
View File
@@ -7,18 +7,18 @@ edition = "2018"
[dependencies]
serde = { version = "1.0.101", optional = true, features = ["derive"] }
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
primitives = { package = "substrate-primitives", path = "../../primitives/core", default-features = false }
substrate-finality-grandpa-primitives = { path = "../../primitives/finality-grandpa", default-features = false }
rstd = { package = "sr-std", path = "../../primitives/sr-std", default-features = false }
sr-primitives = { path = "../../primitives/sr-primitives", default-features = false }
sr-staking-primitives = { path = "../../primitives/sr-staking-primitives", default-features = false }
primitives = { package = "sp-core", path = "../../primitives/core", default-features = false }
sp-finality-granpda = { path = "../../primitives/finality-grandpa", default-features = false }
rstd = { package = "sp-std", path = "../../primitives/sr-std", default-features = false }
sp-runtime = { path = "../../primitives/sr-primitives", default-features = false }
sp-staking = { path = "../../primitives/sr-staking-primitives", default-features = false }
support = { package = "frame-support", path = "../support", default-features = false }
system = { package = "frame-system", path = "../system", default-features = false }
session = { package = "pallet-session", path = "../session", default-features = false }
finality-tracker = { package = "pallet-finality-tracker", path = "../finality-tracker", default-features = false }
[dev-dependencies]
runtime-io ={ package = "sr-io", path = "../../primitives/sr-io" }
runtime-io ={ package = "sp-io", path = "../../primitives/sr-io" }
[features]
default = ["std"]
@@ -26,11 +26,11 @@ std = [
"serde",
"codec/std",
"primitives/std",
"substrate-finality-grandpa-primitives/std",
"sp-finality-granpda/std",
"rstd/std",
"support/std",
"sr-primitives/std",
"sr-staking-primitives/std",
"sp-runtime/std",
"sp-staking/std",
"system/std",
"session/std",
"finality-tracker/std",
+4 -4
View File
@@ -28,15 +28,15 @@
#![cfg_attr(not(feature = "std"), no_std)]
// re-export since this is necessary for `impl_apis` in runtime.
pub use substrate_finality_grandpa_primitives as fg_primitives;
pub use sp_finality_granpda as fg_primitives;
use rstd::prelude::*;
use codec::{self as codec, Encode, Decode, Error};
use support::{decl_event, decl_storage, decl_module, dispatch::Result, storage};
use sr_primitives::{
use sp_runtime::{
generic::{DigestItem, OpaqueDigestItemId}, traits::Zero, Perbill,
};
use sr_staking_primitives::{
use sp_staking::{
SessionIndex,
offence::{Offence, Kind},
};
@@ -400,7 +400,7 @@ impl<T: Trait> Module<T> {
}
}
impl<T: Trait> sr_primitives::BoundToRuntimeAppPublic for Module<T> {
impl<T: Trait> sp_runtime::BoundToRuntimeAppPublic for Module<T> {
type Public = AuthorityId;
}
+3 -3
View File
@@ -18,13 +18,13 @@
#![cfg(test)]
use sr_primitives::{Perbill, DigestItem, traits::IdentityLookup, testing::{Header, UintAuthorityId}};
use sp_runtime::{Perbill, DigestItem, traits::IdentityLookup, testing::{Header, UintAuthorityId}};
use runtime_io;
use support::{impl_outer_origin, impl_outer_event, parameter_types, weights::Weight};
use primitives::H256;
use codec::{Encode, Decode};
use crate::{AuthorityId, AuthorityList, GenesisConfig, Trait, Module, ConsensusLog};
use substrate_finality_grandpa_primitives::GRANDPA_ENGINE_ID;
use sp_finality_granpda::GRANDPA_ENGINE_ID;
impl_outer_origin!{
pub enum Origin for Test {}
@@ -53,7 +53,7 @@ impl system::Trait for Test {
type BlockNumber = u64;
type Call = ();
type Hash = H256;
type Hashing = sr_primitives::traits::BlakeTwo256;
type Hashing = sp_runtime::traits::BlakeTwo256;
type AccountId = u64;
type Lookup = IdentityLookup<Self::AccountId>;
type Header = Header;
+2 -2
View File
@@ -18,7 +18,7 @@
#![cfg(test)]
use sr_primitives::{testing::Digest, traits::{Header, OnFinalize}};
use sp_runtime::{testing::Digest, traits::{Header, OnFinalize}};
use crate::mock::*;
use system::{EventRecord, Phase};
use codec::{Decode, Encode};
@@ -312,7 +312,7 @@ fn time_slot_have_sane_ord() {
#[test]
#[cfg(feature = "migrate-authorities")]
fn authorities_migration() {
use sr_primitives::traits::OnInitialize;
use sp_runtime::traits::OnInitialize;
with_externalities(&mut new_test_ext(vec![]), || {
let authorities = to_authorities(vec![(1, 1), (2, 1), (3, 1)]);
+8 -8
View File
@@ -5,16 +5,16 @@ authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
[dependencies]
app-crypto = { package = "substrate-application-crypto", path = "../../primitives/application-crypto", default-features = false }
app-crypto = { package = "sc-application-crypto", path = "../../primitives/application-crypto", default-features = false }
authorship = { package = "pallet-authorship", path = "../authorship", default-features = false }
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
primitives = { package="substrate-primitives", path = "../../primitives/core", default-features = false }
rstd = { package = "sr-std", path = "../../primitives/sr-std", default-features = false }
primitives = { package="sp-core", path = "../../primitives/core", default-features = false }
rstd = { package = "sp-std", path = "../../primitives/sr-std", default-features = false }
serde = { version = "1.0.101", optional = true }
session = { package = "pallet-session", path = "../session", default-features = false }
runtime-io = { package = "sr-io", path = "../../primitives/sr-io", default-features = false }
sr-primitives = { path = "../../primitives/sr-primitives", default-features = false }
sr-staking-primitives = { path = "../../primitives/sr-staking-primitives", default-features = false }
runtime-io = { package = "sp-io", path = "../../primitives/sr-io", default-features = false }
sp-runtime = { path = "../../primitives/sr-primitives", default-features = false }
sp-staking = { path = "../../primitives/sr-staking-primitives", default-features = false }
support = { package = "frame-support", path = "../support", default-features = false }
system = { package = "frame-system", path = "../system", default-features = false }
@@ -29,8 +29,8 @@ std = [
"serde",
"session/std",
"runtime-io/std",
"sr-primitives/std",
"sr-staking-primitives/std",
"sp-runtime/std",
"sp-staking/std",
"support/std",
"system/std",
]
+3 -3
View File
@@ -76,7 +76,7 @@ use primitives::offchain::{OpaqueNetworkState, StorageKind};
use rstd::prelude::*;
use rstd::convert::TryInto;
use session::historical::IdentificationTuple;
use sr_primitives::{
use sp_runtime::{
RuntimeDebug,
traits::{Convert, Member, Printable, Saturating}, Perbill,
transaction_validity::{
@@ -84,7 +84,7 @@ use sr_primitives::{
TransactionPriority,
},
};
use sr_staking_primitives::{
use sp_staking::{
SessionIndex,
offence::{ReportOffence, Offence, Kind},
};
@@ -509,7 +509,7 @@ impl<T: Trait> Module<T> {
}
}
impl<T: Trait> sr_primitives::BoundToRuntimeAppPublic for Module<T> {
impl<T: Trait> sp_runtime::BoundToRuntimeAppPublic for Module<T> {
type Public = T::AuthorityId;
}
+4 -4
View File
@@ -21,10 +21,10 @@
use std::cell::RefCell;
use crate::{Module, Trait};
use sr_primitives::Perbill;
use sr_staking_primitives::{SessionIndex, offence::ReportOffence};
use sr_primitives::testing::{Header, UintAuthorityId, TestXt};
use sr_primitives::traits::{IdentityLookup, BlakeTwo256, ConvertInto};
use sp_runtime::Perbill;
use sp_staking::{SessionIndex, offence::ReportOffence};
use sp_runtime::testing::{Header, UintAuthorityId, TestXt};
use sp_runtime::traits::{IdentityLookup, BlakeTwo256, ConvertInto};
use primitives::H256;
use support::{impl_outer_origin, impl_outer_dispatch, parameter_types, weights::Weight};
use {runtime_io, system};
+1 -1
View File
@@ -27,7 +27,7 @@ use primitives::offchain::{
testing::{TestOffchainExt, TestTransactionPoolExt},
};
use support::{dispatch, assert_noop};
use sr_primitives::testing::UintAuthorityId;
use sp_runtime::testing::UintAuthorityId;
#[test]
fn test_unresponsiveness_slash_fraction() {
+7 -7
View File
@@ -8,11 +8,11 @@ edition = "2018"
serde = { version = "1.0.101", optional = true }
safe-mix = { version = "1.0.0", default-features = false }
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
substrate-keyring = { path = "../../primitives/keyring", optional = true }
rstd = { package = "sr-std", path = "../../primitives/sr-std", default-features = false }
runtime-io = { package = "sr-io", path = "../../primitives/sr-io", default-features = false }
sr-primitives = { path = "../../primitives/sr-primitives", default-features = false }
primitives = { package = "substrate-primitives", path = "../../primitives/core", default-features = false }
sp-keyring = { path = "../../primitives/keyring", optional = true }
rstd = { package = "sp-std", path = "../../primitives/sr-std", default-features = false }
runtime-io = { package = "sp-io", path = "../../primitives/sr-io", default-features = false }
sp-runtime = { path = "../../primitives/sr-primitives", default-features = false }
primitives = { package = "sp-core", path = "../../primitives/core", default-features = false }
support = { package = "frame-support", path = "../support", default-features = false }
system = { package = "frame-system", path = "../system", default-features = false }
@@ -24,12 +24,12 @@ default = ["std"]
std = [
"serde",
"safe-mix/std",
"substrate-keyring",
"sp-keyring",
"codec/std",
"primitives/std",
"rstd/std",
"runtime-io/std",
"support/std",
"sr-primitives/std",
"sp-runtime/std",
"system/std",
]
+1 -1
View File
@@ -24,7 +24,7 @@ use codec::{Encode, Decode, Input, Output, Error};
/// An indices-aware address, which can be either a direct `AccountId` or
/// an index.
#[derive(PartialEq, Eq, Clone, sr_primitives::RuntimeDebug)]
#[derive(PartialEq, Eq, Clone, sp_runtime::RuntimeDebug)]
#[cfg_attr(feature = "std", derive(Hash))]
pub enum Address<AccountId, AccountIndex> where
AccountId: Member,
+1 -1
View File
@@ -22,7 +22,7 @@
use rstd::{prelude::*, marker::PhantomData, convert::TryInto};
use codec::{Encode, Codec};
use support::{Parameter, decl_module, decl_event, decl_storage};
use sr_primitives::traits::{One, SimpleArithmetic, StaticLookup, Member, LookupError};
use sp_runtime::traits::{One, SimpleArithmetic, StaticLookup, Member, LookupError};
use system::{IsDeadAccount, OnNewAccount};
use self::address::Address as RawAddress;
+3 -3
View File
@@ -20,8 +20,8 @@
use std::collections::HashSet;
use ref_thread_local::{ref_thread_local, RefThreadLocal};
use sr_primitives::testing::Header;
use sr_primitives::Perbill;
use sp_runtime::testing::Header;
use sp_runtime::Perbill;
use primitives::H256;
use support::{impl_outer_origin, parameter_types, weights::Weight};
use {runtime_io, system};
@@ -77,7 +77,7 @@ impl system::Trait for Runtime {
type BlockNumber = u64;
type Call = ();
type Hash = H256;
type Hashing = ::sr_primitives::traits::BlakeTwo256;
type Hashing = ::sp_runtime::traits::BlakeTwo256;
type AccountId = u64;
type Lookup = Indices;
type Header = Header;
+5 -5
View File
@@ -7,21 +7,21 @@ edition = "2018"
[dependencies]
serde = { version = "1.0.101", optional = true }
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false }
rstd = { package = "sr-std", path = "../../primitives/sr-std", default-features = false }
runtime-io = { package = "sr-io", path = "../../primitives/sr-io", default-features = false }
rstd = { package = "sp-std", path = "../../primitives/sr-std", default-features = false }
runtime-io = { package = "sp-io", path = "../../primitives/sr-io", default-features = false }
support = { package = "frame-support", path = "../support", default-features = false }
system = { package = "frame-system", path = "../system", default-features = false }
sr-primitives = { path = "../../primitives/sr-primitives", default-features = false }
sp-runtime = { path = "../../primitives/sr-primitives", default-features = false }
[dev-dependencies]
primitives = { package = "substrate-primitives", path = "../../primitives/core" }
primitives = { package = "sp-core", path = "../../primitives/core" }
[features]
default = ["std"]
std = [
"serde",
"codec/std",
"sr-primitives/std",
"sp-runtime/std",
"rstd/std",
"runtime-io/std",
"support/std",
+2 -2
View File
@@ -29,7 +29,7 @@ use support::{
weights::SimpleDispatchInfo,
};
use system::ensure_root;
use sr_primitives::traits::EnsureOrigin;
use sp_runtime::traits::EnsureOrigin;
pub trait Trait<I=DefaultInstance>: system::Trait {
/// The overarching event type.
@@ -198,7 +198,7 @@ mod tests {
use primitives::H256;
// The testing primitives are very useful for avoiding having to work with signatures
// or public keys. `u64` is used as the `AccountId` and no `Signature`s are requried.
use sr_primitives::{Perbill, traits::{BlakeTwo256, IdentityLookup}, testing::Header};
use sp_runtime::{Perbill, traits::{BlakeTwo256, IdentityLookup}, testing::Header};
use system::EnsureSignedBy;
impl_outer_origin! {
+2 -2
View File
@@ -7,8 +7,8 @@ edition = "2018"
[dependencies]
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 = "../../primitives/sr-std", default-features = false }
primitives = { package = "substrate-primitives", path = "../../primitives/core", default-features = false }
rstd = { package = "sp-std", path = "../../primitives/sr-std", default-features = false }
primitives = { package = "sp-core", path = "../../primitives/core", default-features = false }
[features]
default = ["std"]
+5 -5
View File
@@ -7,14 +7,14 @@ edition = "2018"
[dependencies]
serde = { version = "1.0.101", optional = true }
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
rstd = { package = "sr-std", path = "../../primitives/sr-std", default-features = false }
runtime-io = { package = "sr-io", path = "../../primitives/sr-io", default-features = false }
sr-primitives = { path = "../../primitives/sr-primitives", default-features = false }
rstd = { package = "sp-std", path = "../../primitives/sr-std", default-features = false }
runtime-io = { package = "sp-io", path = "../../primitives/sr-io", default-features = false }
sp-runtime = { path = "../../primitives/sr-primitives", default-features = false }
support = { package = "frame-support", path = "../support", default-features = false }
system = { package = "frame-system", path = "../system", default-features = false }
[dev-dependencies]
primitives = { package = "substrate-primitives", path = "../../primitives/core" }
primitives = { package = "sp-core", path = "../../primitives/core" }
balances = { package = "pallet-balances", path = "../balances", default-features = false }
[features]
@@ -24,7 +24,7 @@ std = [
"codec/std",
"rstd/std",
"runtime-io/std",
"sr-primitives/std",
"sp-runtime/std",
"support/std",
"system/std",
]
+2 -2
View File
@@ -39,7 +39,7 @@
#![cfg_attr(not(feature = "std"), no_std)]
use rstd::prelude::*;
use sr_primitives::{
use sp_runtime::{
traits::{StaticLookup, EnsureOrigin, Zero}
};
use support::{
@@ -234,7 +234,7 @@ mod tests {
use system::EnsureSignedBy;
// The testing primitives are very useful for avoiding having to work with signatures
// or public keys. `u64` is used as the `AccountId` and no `Signature`s are required.
use sr_primitives::{
use sp_runtime::{
Perbill, testing::Header, traits::{BlakeTwo256, IdentityLookup},
};
+7 -7
View File
@@ -7,16 +7,16 @@ edition = "2018"
[dependencies]
balances = { package = "pallet-balances", path = "../balances", default-features = false }
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
rstd = { package = "sr-std", path = "../../primitives/sr-std", default-features = false }
rstd = { package = "sp-std", path = "../../primitives/sr-std", default-features = false }
serde = { version = "1.0.101", optional = true }
sr-primitives = { path = "../../primitives/sr-primitives", default-features = false }
sr-staking-primitives = { path = "../../primitives/sr-staking-primitives", default-features = false }
sp-runtime = { path = "../../primitives/sr-primitives", default-features = false }
sp-staking = { path = "../../primitives/sr-staking-primitives", default-features = false }
support = { package = "frame-support", path = "../support", default-features = false }
system = { package = "frame-system", path = "../system", default-features = false }
[dev-dependencies]
runtime-io = { package = "sr-io", path = "../../primitives/sr-io" }
substrate-primitives = { path = "../../primitives/core" }
runtime-io = { package = "sp-io", path = "../../primitives/sr-io" }
sp-core = { path = "../../primitives/core" }
[features]
default = ["std"]
@@ -25,8 +25,8 @@ std = [
"codec/std",
"rstd/std",
"serde",
"sr-primitives/std",
"sr-staking-primitives/std",
"sp-runtime/std",
"sp-staking/std",
"support/std",
"system/std",
]
+2 -2
View File
@@ -28,8 +28,8 @@ use rstd::vec::Vec;
use support::{
decl_module, decl_event, decl_storage, Parameter,
};
use sr_primitives::traits::Hash;
use sr_staking_primitives::{
use sp_runtime::traits::Hash;
use sp_staking::{
offence::{Offence, ReportOffence, Kind, OnOffenceHandler, OffenceDetails},
};
use codec::{Encode, Decode};
+5 -5
View File
@@ -21,14 +21,14 @@
use std::cell::RefCell;
use crate::{Module, Trait};
use codec::Encode;
use sr_primitives::Perbill;
use sr_staking_primitives::{
use sp_runtime::Perbill;
use sp_staking::{
SessionIndex,
offence::{self, Kind, OffenceDetails},
};
use sr_primitives::testing::Header;
use sr_primitives::traits::{IdentityLookup, BlakeTwo256};
use substrate_primitives::H256;
use sp_runtime::testing::Header;
use sp_runtime::traits::{IdentityLookup, BlakeTwo256};
use sp_core::H256;
use support::{
impl_outer_origin, impl_outer_event, parameter_types, StorageMap, StorageDoubleMap,
weights::Weight,
+1 -1
View File
@@ -23,7 +23,7 @@ use crate::mock::{
Offences, System, Offence, TestEvent, KIND, new_test_ext, with_on_offence_fractions,
offence_reports,
};
use sr_primitives::Perbill;
use sp_runtime::Perbill;
use system::{EventRecord, Phase};
#[test]
@@ -7,14 +7,14 @@ edition = "2018"
[dependencies]
safe-mix = { version = "1.0", default-features = false }
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
sr-primitives = { path = "../../primitives/sr-primitives", default-features = false }
sp-runtime = { path = "../../primitives/sr-primitives", default-features = false }
support = { package = "frame-support", path = "../support", default-features = false }
system = { package = "frame-system", path = "../system", default-features = false }
rstd = { package = "sr-std", path = "../../primitives/sr-std", default-features = false }
rstd = { package = "sp-std", path = "../../primitives/sr-std", default-features = false }
[dev-dependencies]
primitives = { package = "substrate-primitives", path = "../../primitives/core" }
runtime-io = { package = "sr-io", path = "../../primitives/sr-io" }
primitives = { package = "sp-core", path = "../../primitives/core" }
runtime-io = { package = "sp-io", path = "../../primitives/sr-io" }
[features]
default = ["std"]
@@ -23,6 +23,6 @@ std = [
"system/std",
"codec/std",
"support/std",
"sr-primitives/std",
"sp-runtime/std",
"rstd/std",
]
@@ -53,7 +53,7 @@
#![cfg_attr(not(feature = "std"), no_std)]
use rstd::{prelude::*, convert::TryInto};
use sr_primitives::traits::Hash;
use sp_runtime::traits::Hash;
use support::{decl_module, decl_storage, traits::Randomness};
use safe_mix::TripletMix;
use codec::Encode;
@@ -153,7 +153,7 @@ impl<T: Trait> Randomness<T::Hash> for Module<T> {
mod tests {
use super::*;
use primitives::H256;
use sr_primitives::{
use sp_runtime::{
Perbill, traits::{BlakeTwo256, OnInitialize, Header as _, IdentityLookup}, testing::Header,
};
use support::{impl_outer_origin, parameter_types, weights::Weight, traits::Randomness};
+5 -5
View File
@@ -7,15 +7,15 @@ edition = "2018"
[dependencies]
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
serde = { version = "1.0.101", optional = true }
runtime-io = { package = "sr-io", path = "../../primitives/sr-io", default-features = false }
sr-primitives = { path = "../../primitives/sr-primitives", default-features = false }
rstd = { package = "sr-std", path = "../../primitives/sr-std", default-features = false }
runtime-io = { package = "sp-io", path = "../../primitives/sr-io", default-features = false }
sp-runtime = { path = "../../primitives/sr-primitives", default-features = false }
rstd = { package = "sp-std", path = "../../primitives/sr-std", default-features = false }
support = { package = "frame-support", path = "../support", default-features = false }
system = { package = "frame-system", path = "../system", default-features = false }
[dev-dependencies]
balances = { package = "pallet-balances", path = "../balances" }
primitives = { package = "substrate-primitives", path = "../../primitives/core" }
primitives = { package = "sp-core", path = "../../primitives/core" }
[features]
default = ["std"]
@@ -23,7 +23,7 @@ std = [
"codec/std",
"serde",
"runtime-io/std",
"sr-primitives/std",
"sp-runtime/std",
"rstd/std",
"support/std",
"system/std",
+1 -1
View File
@@ -98,7 +98,7 @@ use support::{
traits::{ChangeMembers, InitializeMembers, Currency, Get, ReservableCurrency},
};
use system::{self, ensure_root, ensure_signed};
use sr_primitives::{
use sp_runtime::{
traits::{EnsureOrigin, SimpleArithmetic, MaybeSerializeDeserialize, Zero, StaticLookup},
};
+1 -1
View File
@@ -23,7 +23,7 @@ use support::{impl_outer_origin, parameter_types, weights::Weight};
use primitives::H256;
// The testing primitives are very useful for avoiding having to work with signatures
// or public keys. `u64` is used as the `AccountId` and no `Signature`s are requried.
use sr_primitives::{
use sp_runtime::{
Perbill, traits::{BlakeTwo256, IdentityLookup}, testing::Header,
};
use system::EnsureSignedBy;
+1 -1
View File
@@ -20,7 +20,7 @@ use super::*;
use mock::*;
use support::{assert_ok, assert_noop};
use sr_primitives::traits::OnInitialize;
use sp_runtime::traits::OnInitialize;
type ScoredPool = Module<Test>;
type System = system::Module<Test>;
+11 -11
View File
@@ -8,33 +8,33 @@ edition = "2018"
serde = { version = "1.0.101", optional = true }
safe-mix = { version = "1.0.0", default-features = false }
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
rstd = { package = "sr-std", path = "../../primitives/sr-std", default-features = false }
sr-primitives = { path = "../../primitives/sr-primitives", default-features = false }
sr-staking-primitives = { path = "../../primitives/sr-staking-primitives", default-features = false }
rstd = { package = "sp-std", path = "../../primitives/sr-std", default-features = false }
sp-runtime = { path = "../../primitives/sr-primitives", default-features = false }
sp-staking = { path = "../../primitives/sr-staking-primitives", default-features = false }
support = { package = "frame-support", path = "../support", default-features = false }
system = { package = "frame-system", path = "../system", default-features = false }
timestamp = { package = "pallet-timestamp", path = "../timestamp", default-features = false }
substrate-trie = { path = "../../primitives/trie", default-features = false, optional = true }
runtime-io ={ package = "sr-io", path = "../../primitives/sr-io", default-features = false }
sp-trie = { path = "../../primitives/trie", default-features = false, optional = true }
runtime-io ={ package = "sp-io", path = "../../primitives/sr-io", default-features = false }
impl-trait-for-tuples = "0.1.3"
[dev-dependencies]
primitives = { package = "substrate-primitives", path = "../../primitives/core" }
app-crypto = { package = "substrate-application-crypto", path = "../../primitives/application-crypto" }
primitives = { package = "sp-core", path = "../../primitives/core" }
app-crypto = { package = "sc-application-crypto", path = "../../primitives/application-crypto" }
lazy_static = "1.4.0"
[features]
default = ["std", "historical"]
historical = ["substrate-trie"]
historical = ["sp-trie"]
std = [
"serde",
"safe-mix/std",
"codec/std",
"rstd/std",
"support/std",
"sr-primitives/std",
"sr-staking-primitives/std",
"sp-runtime/std",
"sp-staking/std",
"timestamp/std",
"substrate-trie/std",
"sp-trie/std",
"runtime-io/std",
]
+6 -6
View File
@@ -27,12 +27,12 @@
use rstd::prelude::*;
use codec::{Encode, Decode};
use sr_primitives::KeyTypeId;
use sr_primitives::traits::{Convert, OpaqueKeys, Hash as HashT};
use sp_runtime::KeyTypeId;
use sp_runtime::traits::{Convert, OpaqueKeys, Hash as HashT};
use support::{decl_module, decl_storage};
use support::{Parameter, print};
use substrate_trie::{MemoryDB, Trie, TrieMut, Recorder, EMPTY_PREFIX};
use substrate_trie::trie_types::{TrieDBMut, TrieDB};
use sp_trie::{MemoryDB, Trie, TrieMut, Recorder, EMPTY_PREFIX};
use sp_trie::trie_types::{TrieDBMut, TrieDB};
use super::{SessionIndex, Module as SessionModule};
type ValidatorCount = u32;
@@ -214,7 +214,7 @@ impl<T: Trait> ProvingTrie<T> {
}
fn from_nodes(root: T::Hash, nodes: &[Vec<u8>]) -> Self {
use substrate_trie::HashDBT;
use sp_trie::HashDBT;
let mut memory_db = MemoryDB::default();
for node in nodes {
@@ -311,7 +311,7 @@ impl<T: Trait, D: AsRef<[u8]>> support::traits::KeyOwnerProofSystem<(KeyTypeId,
mod tests {
use super::*;
use primitives::crypto::key_types::DUMMY;
use sr_primitives::{traits::OnInitialize, testing::UintAuthorityId};
use sp_runtime::{traits::OnInitialize, testing::UintAuthorityId};
use crate::mock::{
NEXT_VALIDATORS, force_new_session,
set_next_validators, Test, System, Session,
+5 -5
View File
@@ -121,10 +121,10 @@
use rstd::{prelude::*, marker::PhantomData, ops::{Sub, Rem}};
use codec::Decode;
use sr_primitives::{KeyTypeId, Perbill, RuntimeAppPublic, BoundToRuntimeAppPublic};
use sp_runtime::{KeyTypeId, Perbill, RuntimeAppPublic, BoundToRuntimeAppPublic};
use support::weights::SimpleDispatchInfo;
use sr_primitives::traits::{Convert, Zero, Member, OpaqueKeys};
use sr_staking_primitives::SessionIndex;
use sp_runtime::traits::{Convert, Zero, Member, OpaqueKeys};
use sp_staking::SessionIndex;
use support::{dispatch::Result, ConsensusEngineId, decl_module, decl_event, decl_storage};
use support::{ensure, traits::{OnFreeBalanceZero, Get, FindAuthor}, Parameter};
use system::{self, ensure_signed};
@@ -307,7 +307,7 @@ impl<AId> SessionHandler<AId> for Tuple {
/// `SessionHandler` for tests that use `UintAuthorityId` as `Keys`.
pub struct TestSessionHandler;
impl<AId> SessionHandler<AId> for TestSessionHandler {
const KEY_TYPE_IDS: &'static [KeyTypeId] = &[sr_primitives::key_types::DUMMY];
const KEY_TYPE_IDS: &'static [KeyTypeId] = &[sp_runtime::key_types::DUMMY];
fn on_genesis_session<Ks: OpaqueKeys>(_: &[(AId, Ks)]) {}
@@ -716,7 +716,7 @@ mod tests {
use super::*;
use support::assert_ok;
use primitives::crypto::key_types::DUMMY;
use sr_primitives::{traits::OnInitialize, testing::UintAuthorityId};
use sp_runtime::{traits::OnInitialize, testing::UintAuthorityId};
use mock::{
NEXT_VALIDATORS, SESSION_CHANGED, TEST_SESSION_CHANGED, authorities, force_new_session,
set_next_validators, set_session_length, session_changed, Test, Origin, System, Session,
+4 -4
View File
@@ -20,11 +20,11 @@ use super::*;
use std::cell::RefCell;
use support::{impl_outer_origin, parameter_types, weights::Weight};
use primitives::{crypto::key_types::DUMMY, H256};
use sr_primitives::{
use sp_runtime::{
Perbill, impl_opaque_keys, traits::{BlakeTwo256, IdentityLookup, ConvertInto},
testing::{Header, UintAuthorityId}
};
use sr_staking_primitives::SessionIndex;
use sp_staking::SessionIndex;
impl_opaque_keys! {
pub struct MockSessionKeys {
@@ -66,7 +66,7 @@ impl ShouldEndSession<u64> for TestShouldEndSession {
pub struct TestSessionHandler;
impl SessionHandler<u64> for TestSessionHandler {
const KEY_TYPE_IDS: &'static [sr_primitives::KeyTypeId] = &[UintAuthorityId::ID];
const KEY_TYPE_IDS: &'static [sp_runtime::KeyTypeId] = &[UintAuthorityId::ID];
fn on_genesis_session<T: OpaqueKeys>(_validators: &[(u64, T)]) {}
fn on_new_session<T: OpaqueKeys>(
changed: bool,
@@ -204,7 +204,7 @@ impl Trait for Test {
#[cfg(feature = "historical")]
impl crate::historical::Trait for Test {
type FullIdentification = u64;
type FullIdentificationOf = sr_primitives::traits::ConvertInto;
type FullIdentificationOf = sp_runtime::traits::ConvertInto;
}
pub type System = system::Module<Test>;
+10 -10
View File
@@ -8,19 +8,19 @@ edition = "2018"
serde = { version = "1.0.101", optional = true }
safe-mix = { version = "1.0.0", default-features = false }
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
substrate-keyring = { path = "../../primitives/keyring", optional = true }
rstd = { package = "sr-std", path = "../../primitives/sr-std", default-features = false }
phragmen = { package = "substrate-phragmen", path = "../../primitives/phragmen", default-features = false }
runtime-io ={ package = "sr-io", path = "../../primitives/sr-io", default-features = false }
sr-primitives = { path = "../../primitives/sr-primitives", default-features = false }
sr-staking-primitives = { path = "../../primitives/sr-staking-primitives", default-features = false }
sp-keyring = { path = "../../primitives/keyring", optional = true }
rstd = { package = "sp-std", path = "../../primitives/sr-std", default-features = false }
phragmen = { package = "sp-phragmen", path = "../../primitives/phragmen", default-features = false }
runtime-io ={ package = "sp-io", path = "../../primitives/sr-io", default-features = false }
sp-runtime = { path = "../../primitives/sr-primitives", default-features = false }
sp-staking = { path = "../../primitives/sr-staking-primitives", default-features = false }
support = { package = "frame-support", path = "../support", default-features = false }
system = { package = "frame-system", path = "../system", default-features = false }
session = { package = "pallet-session", path = "../session", default-features = false, features = ["historical"] }
authorship = { package = "pallet-authorship", path = "../authorship", default-features = false }
[dev-dependencies]
primitives = { package = "substrate-primitives", path = "../../primitives/core" }
primitives = { package = "sp-core", path = "../../primitives/core" }
balances = { package = "pallet-balances", path = "../balances" }
timestamp = { package = "pallet-timestamp", path = "../timestamp" }
pallet-staking-reward-curve = { path = "../staking/reward-curve"}
@@ -33,14 +33,14 @@ default = ["std", "equalize"]
std = [
"serde",
"safe-mix/std",
"substrate-keyring",
"sp-keyring",
"codec/std",
"rstd/std",
"phragmen/std",
"runtime-io/std",
"support/std",
"sr-primitives/std",
"sr-staking-primitives/std",
"sp-runtime/std",
"sp-staking/std",
"session/std",
"system/std",
"authorship/std",
@@ -14,4 +14,4 @@ proc-macro2 = "1.0.6"
proc-macro-crate = "0.1.4"
[dev-dependencies]
sr-primitives = { path = "../../../primitives/sr-primitives" }
sp-runtime = { path = "../../../primitives/sr-primitives" }
@@ -42,7 +42,7 @@ use syn::parse::{Parse, ParseStream};
///
/// ```
/// # fn main() {}
/// use sr_primitives::curve::PiecewiseLinear;
/// use sp_runtime::curve::PiecewiseLinear;
///
/// pallet_staking_reward_curve::build! {
/// const I_NPOS: PiecewiseLinear<'static> = curve!(
@@ -64,10 +64,10 @@ pub fn build(input: TokenStream) -> TokenStream {
let declaration = generate_piecewise_linear(points);
let test_module = generate_test_module(&input);
let imports = match crate_name("sr-primitives") {
Ok(sr_primitives) => {
let ident = syn::Ident::new(&sr_primitives, Span::call_site());
quote!( extern crate #ident as _sr_primitives; )
let imports = match crate_name("sp-runtime") {
Ok(sp_runtime) => {
let ident = syn::Ident::new(&sp_runtime, Span::call_site());
quote!( extern crate #ident as _sp_runtime; )
},
Err(e) => syn::Error::new(Span::call_site(), &e).to_compile_error(),
};
@@ -345,16 +345,16 @@ fn generate_piecewise_linear(points: Vec<(u32, u32)>) -> TokenStream2 {
points_tokens.extend(quote!(
(
_sr_primitives::Perbill::from_parts(#x_perbill),
_sr_primitives::Perbill::from_parts(#y_perbill),
_sp_runtime::Perbill::from_parts(#x_perbill),
_sp_runtime::Perbill::from_parts(#y_perbill),
),
));
}
quote!(
_sr_primitives::curve::PiecewiseLinear::<'static> {
_sp_runtime::curve::PiecewiseLinear::<'static> {
points: & [ #points_tokens ],
maximum: _sr_primitives::Perbill::from_parts(#max),
maximum: _sp_runtime::Perbill::from_parts(#max),
}
)
}
@@ -19,7 +19,7 @@
mod test_small_falloff {
pallet_staking_reward_curve::build! {
const REWARD_CURVE: sr_primitives::curve::PiecewiseLinear<'static> = curve!(
const REWARD_CURVE: sp_runtime::curve::PiecewiseLinear<'static> = curve!(
min_inflation: 0_020_000,
max_inflation: 0_200_000,
ideal_stake: 0_600_000,
@@ -32,7 +32,7 @@ mod test_small_falloff {
mod test_big_falloff {
pallet_staking_reward_curve::build! {
const REWARD_CURVE: sr_primitives::curve::PiecewiseLinear<'static> = curve!(
const REWARD_CURVE: sp_runtime::curve::PiecewiseLinear<'static> = curve!(
min_inflation: 0_100_000,
max_inflation: 0_400_000,
ideal_stake: 0_400_000,
+2 -2
View File
@@ -19,7 +19,7 @@
//! The staking rate in NPoS is the total amount of tokens staked by nominators and validators,
//! divided by the total token supply.
use sr_primitives::{Perbill, traits::SimpleArithmetic, curve::PiecewiseLinear};
use sp_runtime::{Perbill, traits::SimpleArithmetic, curve::PiecewiseLinear};
/// The total payout to all validators (and their nominators) per era.
///
@@ -47,7 +47,7 @@ pub fn compute_total_payout<N>(
#[cfg(test)]
mod test {
use sr_primitives::curve::PiecewiseLinear;
use sp_runtime::curve::PiecewiseLinear;
pallet_staking_reward_curve::build! {
const I_NPOS: PiecewiseLinear<'static> = curve!(
+3 -3
View File
@@ -266,7 +266,7 @@ use support::{
}
};
use session::{historical::OnSessionEnding, SelectInitialValidators};
use sr_primitives::{
use sp_runtime::{
Perbill,
RuntimeDebug,
curve::PiecewiseLinear,
@@ -275,12 +275,12 @@ use sr_primitives::{
SimpleArithmetic, EnsureOrigin,
}
};
use sr_staking_primitives::{
use sp_staking::{
SessionIndex,
offence::{OnOffenceHandler, OffenceDetails, Offence, ReportOffence},
};
#[cfg(feature = "std")]
use sr_primitives::{Serialize, Deserialize};
use sp_runtime::{Serialize, Deserialize};
use system::{ensure_signed, ensure_root};
use phragmen::{ExtendedBalance, PhragmenStakedAssignment};
+6 -6
View File
@@ -17,11 +17,11 @@
//! Test utilities
use std::{collections::HashSet, cell::RefCell};
use sr_primitives::{Perbill, KeyTypeId};
use sr_primitives::curve::PiecewiseLinear;
use sr_primitives::traits::{IdentityLookup, Convert, OpaqueKeys, OnInitialize, SaturatedConversion};
use sr_primitives::testing::{Header, UintAuthorityId};
use sr_staking_primitives::{SessionIndex, offence::{OffenceDetails, OnOffenceHandler}};
use sp_runtime::{Perbill, KeyTypeId};
use sp_runtime::curve::PiecewiseLinear;
use sp_runtime::traits::{IdentityLookup, Convert, OpaqueKeys, OnInitialize, SaturatedConversion};
use sp_runtime::testing::{Header, UintAuthorityId};
use sp_staking::{SessionIndex, offence::{OffenceDetails, OnOffenceHandler}};
use primitives::{H256, crypto::key_types};
use runtime_io;
use support::{
@@ -127,7 +127,7 @@ impl system::Trait for Test {
type BlockNumber = BlockNumber;
type Call = ();
type Hash = H256;
type Hashing = ::sr_primitives::traits::BlakeTwo256;
type Hashing = ::sp_runtime::traits::BlakeTwo256;
type AccountId = AccountId;
type Lookup = IdentityLookup<Self::AccountId>;
type Header = Header;
+1 -1
View File
@@ -52,7 +52,7 @@ use super::{
EraIndex, Trait, Module, Store, BalanceOf, Exposure, Perbill, SessionInterface,
NegativeImbalanceOf, UnappliedSlash,
};
use sr_primitives::traits::{Zero, Saturating};
use sp_runtime::traits::{Zero, Saturating};
use support::{
StorageMap, StorageDoubleMap,
traits::{Currency, OnUnbalanced, Imbalance},
+2 -2
View File
@@ -18,8 +18,8 @@
use super::*;
use mock::*;
use sr_primitives::{assert_eq_error_rate, traits::OnInitialize};
use sr_staking_primitives::offence::OffenceDetails;
use sp_runtime::{assert_eq_error_rate, traits::OnInitialize};
use sp_staking::offence::OffenceDetails;
use support::{assert_ok, assert_noop, traits::{Currency, ReservableCurrency}};
use substrate_test_utils::assert_eq_uvec;
+5 -5
View File
@@ -7,14 +7,14 @@ edition = "2018"
[dependencies]
serde = { version = "1.0.101", optional = true }
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
rstd = { package = "sr-std", path = "../../primitives/sr-std", default-features = false }
runtime-io = { package = "sr-io", path = "../../primitives/sr-io", default-features = false }
sr-primitives = { path = "../../primitives/sr-primitives", default-features = false }
rstd = { package = "sp-std", path = "../../primitives/sr-std", default-features = false }
runtime-io = { package = "sp-io", path = "../../primitives/sr-io", default-features = false }
sp-runtime = { path = "../../primitives/sr-primitives", default-features = false }
support = { package = "frame-support", path = "../support", default-features = false }
system = { package = "frame-system", path = "../system", default-features = false }
[dev-dependencies]
primitives = { package = "substrate-primitives", path = "../../primitives/core" }
primitives = { package = "sp-core", path = "../../primitives/core" }
[features]
default = ["std"]
@@ -23,7 +23,7 @@ std = [
"codec/std",
"rstd/std",
"runtime-io/std",
"sr-primitives/std",
"sp-runtime/std",
"support/std",
"system/std",
]
+3 -3
View File
@@ -87,7 +87,7 @@
#![cfg_attr(not(feature = "std"), no_std)]
use rstd::prelude::*;
use sr_primitives::{
use sp_runtime::{
traits::{StaticLookup, Dispatchable}, DispatchError,
};
use support::{
@@ -129,7 +129,7 @@ decl_module! {
Ok(_) => true,
Err(e) => {
let e: DispatchError = e.into();
sr_primitives::print(e);
sp_runtime::print(e);
false
}
};
@@ -179,7 +179,7 @@ decl_module! {
Ok(_) => true,
Err(e) => {
let e: DispatchError = e.into();
sr_primitives::print(e);
sp_runtime::print(e);
false
}
};
+9 -9
View File
@@ -9,16 +9,16 @@ log = "0.4"
serde = { version = "1.0.101", optional = true, features = ["derive"] }
codec = { package = "parity-scale-codec", version = "1.0.6", default-features = false, features = ["derive"] }
frame-metadata = { path = "../metadata", default-features = false }
rstd = { package = "sr-std", path = "../../primitives/sr-std", default-features = false }
runtime-io ={ package = "sr-io", path = "../../primitives/sr-io", default-features = false }
sr-primitives = { path = "../../primitives/sr-primitives", default-features = false }
primitives = { package = "substrate-primitives", path = "../../primitives/core", default-features = false }
sr-arithmetic = { path = "../../primitives/sr-arithmetic", default-features = false }
inherents = { package = "substrate-inherents", path = "../../primitives/inherents", default-features = false }
rstd = { package = "sp-std", path = "../../primitives/sr-std", default-features = false }
runtime-io ={ package = "sp-io", path = "../../primitives/sr-io", default-features = false }
sp-runtime = { path = "../../primitives/sr-primitives", default-features = false }
primitives = { package = "sp-core", path = "../../primitives/core", default-features = false }
sp-arithmetic = { path = "../../primitives/sr-arithmetic", default-features = false }
inherents = { package = "sp-inherents", path = "../../primitives/inherents", default-features = false }
frame-support-procedural = { package = "frame-support-procedural", path = "./procedural" }
paste = "0.1.6"
once_cell = { version = "0.2.4", default-features = false, optional = true }
state-machine = { package = "substrate-state-machine", path = "../../primitives/state-machine", optional = true }
state-machine = { package = "sp-state-machine", path = "../../primitives/state-machine", optional = true }
bitmask = { version = "0.5.0", default-features = false }
impl-trait-for-tuples = "0.1.3"
tracing = { version = "0.1.10", optional = true }
@@ -37,8 +37,8 @@ std = [
"runtime-io/std",
"codec/std",
"rstd/std",
"sr-primitives/std",
"sr-arithmetic/std",
"sp-runtime/std",
"sp-arithmetic/std",
"frame-metadata/std",
"inherents/std",
"state-machine",
@@ -93,10 +93,10 @@ fn construct_runtime_parsed(definition: RuntimeDefinition) -> Result<TokenStream
#[derive(Clone, Copy, PartialEq, Eq)]
#[cfg_attr(feature = "std", derive(Debug))]
pub struct #name;
impl #scrate::sr_primitives::traits::GetNodeBlockType for #name {
impl #scrate::sp_runtime::traits::GetNodeBlockType for #name {
type NodeBlock = #node_block;
}
impl #scrate::sr_primitives::traits::GetRuntimeBlockType for #name {
impl #scrate::sp_runtime::traits::GetRuntimeBlockType for #name {
type RuntimeBlock = #block;
}
@@ -193,7 +193,7 @@ fn decl_outer_config<'a>(
)
});
quote!(
#scrate::sr_primitives::impl_outer_config! {
#scrate::sp_runtime::impl_outer_config! {
pub struct GenesisConfig for #runtime {
#(#modules_tokens)*
}
@@ -132,7 +132,7 @@ fn impl_build_storage(
let builder_blocks = &builders.blocks;
let build_storage_impl_trait = quote!(
#scrate::sr_primitives::BuildModuleGenesisStorage<#runtime_generic, #inherent_instance>
#scrate::sp_runtime::BuildModuleGenesisStorage<#runtime_generic, #inherent_instance>
);
quote!{
@@ -140,8 +140,8 @@ fn impl_build_storage(
impl#genesis_impl GenesisConfig#genesis_struct #genesis_where_clause {
pub fn build_storage #fn_generic (&self) -> std::result::Result<
(
#scrate::sr_primitives::StorageOverlay,
#scrate::sr_primitives::ChildrenStorageOverlay,
#scrate::sp_runtime::StorageOverlay,
#scrate::sp_runtime::ChildrenStorageOverlay,
),
String
> #fn_where_clause {
@@ -154,8 +154,8 @@ fn impl_build_storage(
pub fn assimilate_storage #fn_generic (
&self,
tuple_storage: &mut (
#scrate::sr_primitives::StorageOverlay,
#scrate::sr_primitives::ChildrenStorageOverlay,
#scrate::sp_runtime::StorageOverlay,
#scrate::sp_runtime::ChildrenStorageOverlay,
),
) -> std::result::Result<(), String> #fn_where_clause {
#scrate::BasicExternalities::execute_with_storage(tuple_storage, || {
@@ -172,8 +172,8 @@ fn impl_build_storage(
fn build_module_genesis_storage(
&self,
storage: &mut (
#scrate::sr_primitives::StorageOverlay,
#scrate::sr_primitives::ChildrenStorageOverlay,
#scrate::sp_runtime::StorageOverlay,
#scrate::sp_runtime::ChildrenStorageOverlay,
),
) -> std::result::Result<(), String> {
self.assimilate_storage::<#fn_traitinstance> (storage)
@@ -27,12 +27,12 @@ use quote::quote;
pub mod syn_ext;
// FIXME #1569, remove the following functions, which are copied from sr-api-macros
// FIXME #1569, remove the following functions, which are copied from sp-api-macros
use proc_macro2::{TokenStream, Span};
use syn::Ident;
fn generate_hidden_includes_mod_name(unique_id: &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 access to the `frame-support` crate.

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