mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 03:31:10 +00:00
Refactor sr_primitives. (#3214)
* refactor sr_primitives. * Fix try build error. * Line-width * Ui test. * Final fixes. * Fix build again. * bring back ui test. * Fix unsigned import. * Another ui fix. * Also refactor substrate-primitives * Fix benchmarks. * Fix doc test. * fix doc tests
This commit is contained in:
committed by
Bastian Köcher
parent
cf80af9255
commit
79feb23a22
@@ -8,14 +8,14 @@ edition = "2018"
|
||||
serde = { version = "1.0", optional = true }
|
||||
parity-codec = { version = "4.1.1", default-features = false }
|
||||
# Needed for various traits. In our case, `OnFinalize`.
|
||||
primitives = { package = "sr-primitives", path = "../../core/sr-primitives", default-features = false }
|
||||
sr-primitives = { path = "../../core/sr-primitives", default-features = false }
|
||||
# Needed for type-safe access to storage DB.
|
||||
srml-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 = "srml-system", path = "../system", default-features = false }
|
||||
|
||||
[dev-dependencies]
|
||||
substrate-primitives = { path = "../../core/primitives" }
|
||||
primitives = { package = "substrate-primitives", path = "../../core/primitives" }
|
||||
sr-std = { path = "../../core/sr-std" }
|
||||
runtime_io = { package = "sr-io", path = "../../core/sr-io" }
|
||||
|
||||
@@ -24,7 +24,7 @@ default = ["std"]
|
||||
std = [
|
||||
"serde",
|
||||
"parity-codec/std",
|
||||
"primitives/std",
|
||||
"sr-primitives/std",
|
||||
"srml-support/std",
|
||||
"system/std",
|
||||
]
|
||||
|
||||
@@ -131,9 +131,9 @@
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
use srml_support::{StorageValue, StorageMap, Parameter, decl_module, decl_event, decl_storage, ensure};
|
||||
use primitives::traits::{Member, SimpleArithmetic, Zero, StaticLookup};
|
||||
use sr_primitives::traits::{Member, SimpleArithmetic, Zero, StaticLookup};
|
||||
use system::ensure_signed;
|
||||
use primitives::traits::One;
|
||||
use sr_primitives::traits::One;
|
||||
|
||||
/// The module configuration trait.
|
||||
pub trait Trait: system::Trait {
|
||||
@@ -241,10 +241,10 @@ mod tests {
|
||||
|
||||
use runtime_io::with_externalities;
|
||||
use srml_support::{impl_outer_origin, assert_ok, assert_noop, parameter_types};
|
||||
use substrate_primitives::{H256, Blake2Hasher};
|
||||
use primitives::{H256, Blake2Hasher};
|
||||
// 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 primitives::{Perbill, traits::{BlakeTwo256, IdentityLookup}, testing::Header};
|
||||
use sr_primitives::{Perbill, traits::{BlakeTwo256, IdentityLookup}, testing::Header};
|
||||
|
||||
impl_outer_origin! {
|
||||
pub enum Origin for Test {}
|
||||
|
||||
@@ -9,8 +9,8 @@ parity-codec = { version = "4.1.1", default-features = false, features = ["deriv
|
||||
serde = { version = "1.0", optional = true }
|
||||
inherents = { package = "substrate-inherents", path = "../../core/inherents", default-features = false }
|
||||
rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false }
|
||||
primitives = { package = "sr-primitives", path = "../../core/sr-primitives", default-features = false }
|
||||
substrate-primitives = { path = "../../core/primitives", default-features = false }
|
||||
sr-primitives = { path = "../../core/sr-primitives", default-features = false }
|
||||
primitives = { package = "substrate-primitives", path = "../../core/primitives", default-features = false }
|
||||
srml-support = { path = "../support", default-features = false }
|
||||
system = { package = "srml-system", path = "../system", default-features = false }
|
||||
timestamp = { package = "srml-timestamp", path = "../timestamp", default-features = false }
|
||||
@@ -30,8 +30,8 @@ std = [
|
||||
"parity-codec/std",
|
||||
"rstd/std",
|
||||
"srml-support/std",
|
||||
"sr-primitives/std",
|
||||
"primitives/std",
|
||||
"substrate-primitives/std",
|
||||
"system/std",
|
||||
"timestamp/std",
|
||||
"staking/std",
|
||||
|
||||
@@ -53,7 +53,7 @@ pub use timestamp;
|
||||
use rstd::{result, prelude::*};
|
||||
use parity_codec::Encode;
|
||||
use srml_support::{decl_storage, decl_module, Parameter, storage::StorageValue, traits::Get};
|
||||
use primitives::{
|
||||
use sr_primitives::{
|
||||
traits::{SaturatedConversion, Saturating, Zero, One, Member, IsMember, TypedKey},
|
||||
generic::DigestItem,
|
||||
};
|
||||
|
||||
@@ -18,13 +18,13 @@
|
||||
|
||||
#![cfg(test)]
|
||||
|
||||
use primitives::{
|
||||
use sr_primitives::{
|
||||
traits::IdentityLookup, Perbill,
|
||||
testing::{Header, UintAuthorityId},
|
||||
};
|
||||
use srml_support::{impl_outer_origin, parameter_types};
|
||||
use runtime_io;
|
||||
use substrate_primitives::{H256, Blake2Hasher};
|
||||
use primitives::{H256, Blake2Hasher};
|
||||
use crate::{Trait, Module, GenesisConfig};
|
||||
|
||||
impl_outer_origin!{
|
||||
@@ -48,7 +48,7 @@ impl system::Trait for Test {
|
||||
type Index = u64;
|
||||
type BlockNumber = u64;
|
||||
type Hash = H256;
|
||||
type Hashing = ::primitives::traits::BlakeTwo256;
|
||||
type Hashing = ::sr_primitives::traits::BlakeTwo256;
|
||||
type AccountId = u64;
|
||||
type Lookup = IdentityLookup<Self::AccountId>;
|
||||
type Header = Header;
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
use lazy_static::lazy_static;
|
||||
use crate::mock::{System, Aura, new_test_ext};
|
||||
use primitives::traits::Header;
|
||||
use sr_primitives::traits::Header;
|
||||
use runtime_io::with_externalities;
|
||||
use parking_lot::Mutex;
|
||||
use crate::{AuraReport, HandleReport};
|
||||
|
||||
@@ -6,10 +6,10 @@ authors = ["Parity Technologies <admin@parity.io>"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
substrate-primitives = { path = "../../core/primitives", default-features = false }
|
||||
primitives = { package = "substrate-primitives", path = "../../core/primitives", default-features = false }
|
||||
parity-codec = { version = "4.1.1", default-features = false, features = ["derive"] }
|
||||
rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false }
|
||||
primitives = { package = "sr-primitives", path = "../../core/sr-primitives", default-features = false }
|
||||
sr-primitives = { path = "../../core/sr-primitives", default-features = false }
|
||||
srml-support = { path = "../support", default-features = false }
|
||||
system = { package = "srml-system", path = "../system", default-features = false }
|
||||
runtime_io = { package = "sr-io", path = "../../core/sr-io", default-features = false }
|
||||
@@ -18,10 +18,10 @@ runtime_io = { package = "sr-io", path = "../../core/sr-io", default-features =
|
||||
default = ["std"]
|
||||
std = [
|
||||
"parity-codec/std",
|
||||
"substrate-primitives/std",
|
||||
"primitives/std",
|
||||
"sr-primitives/std",
|
||||
"rstd/std",
|
||||
"srml-support/std",
|
||||
"primitives/std",
|
||||
"system/std",
|
||||
"runtime_io/std",
|
||||
]
|
||||
|
||||
@@ -27,8 +27,8 @@ use srml_support::traits::{FindAuthor, VerifySeal, Get};
|
||||
use srml_support::dispatch::Result as DispatchResult;
|
||||
use parity_codec::{Encode, Decode};
|
||||
use system::ensure_none;
|
||||
use primitives::traits::{SimpleArithmetic, Header as HeaderT, One, Zero};
|
||||
use primitives::weights::SimpleDispatchInfo;
|
||||
use sr_primitives::traits::{SimpleArithmetic, Header as HeaderT, One, Zero};
|
||||
use sr_primitives::weights::SimpleDispatchInfo;
|
||||
|
||||
pub trait Trait: system::Trait {
|
||||
/// Find the author of a block.
|
||||
@@ -324,11 +324,11 @@ impl<T: Trait> Module<T> {
|
||||
mod tests {
|
||||
use super::*;
|
||||
use runtime_io::with_externalities;
|
||||
use substrate_primitives::{H256, Blake2Hasher};
|
||||
use primitives::traits::{BlakeTwo256, IdentityLookup};
|
||||
use primitives::testing::Header;
|
||||
use primitives::generic::DigestItem;
|
||||
use primitives::Perbill;
|
||||
use primitives::{H256, Blake2Hasher};
|
||||
use sr_primitives::traits::{BlakeTwo256, IdentityLookup};
|
||||
use sr_primitives::testing::Header;
|
||||
use sr_primitives::generic::DigestItem;
|
||||
use sr_primitives::Perbill;
|
||||
use srml_support::{parameter_types, impl_outer_origin, ConsensusEngineId};
|
||||
|
||||
impl_outer_origin!{
|
||||
|
||||
@@ -10,7 +10,7 @@ parity-codec = { version = "4.1.1", default-features = false, features = ["deriv
|
||||
serde = { version = "1.0.93", optional = true }
|
||||
inherents = { package = "substrate-inherents", path = "../../core/inherents", default-features = false }
|
||||
rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false }
|
||||
primitives = { package = "sr-primitives", path = "../../core/sr-primitives", default-features = false }
|
||||
sr-primitives = { path = "../../core/sr-primitives", default-features = false }
|
||||
staking = { package = "srml-staking", path = "../staking", default-features = false }
|
||||
srml-support = { path = "../support", default-features = false }
|
||||
system = { package = "srml-system", path = "../system", default-features = false }
|
||||
@@ -22,7 +22,7 @@ runtime_io = { package = "sr-io", path = "../../core/sr-io", default-features =
|
||||
[dev-dependencies]
|
||||
lazy_static = "1.3.0"
|
||||
parking_lot = "0.8.0"
|
||||
substrate-primitives = { path = "../../core/primitives" }
|
||||
primitives = { package = "substrate-primitives", path = "../../core/primitives" }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
@@ -31,7 +31,7 @@ std = [
|
||||
"parity-codec/std",
|
||||
"rstd/std",
|
||||
"srml-support/std",
|
||||
"primitives/std",
|
||||
"sr-primitives/std",
|
||||
"system/std",
|
||||
"timestamp/std",
|
||||
"inherents/std",
|
||||
|
||||
@@ -24,8 +24,8 @@ pub use timestamp;
|
||||
use rstd::{result, prelude::*};
|
||||
use srml_support::{decl_storage, decl_module, StorageValue, traits::FindAuthor, traits::Get};
|
||||
use timestamp::{OnTimestampSet};
|
||||
use primitives::{generic::DigestItem, ConsensusEngineId};
|
||||
use primitives::traits::{IsMember, SaturatedConversion, Saturating, RandomnessBeacon, Convert};
|
||||
use sr_primitives::{generic::DigestItem, ConsensusEngineId};
|
||||
use sr_primitives::traits::{IsMember, SaturatedConversion, Saturating, RandomnessBeacon, Convert};
|
||||
#[cfg(feature = "std")]
|
||||
use timestamp::TimestampInherentData;
|
||||
use parity_codec::{Encode, Decode};
|
||||
|
||||
@@ -10,13 +10,13 @@ safe-mix = { version = "1.0", default-features = false}
|
||||
parity-codec = { version = "4.1.1", default-features = false, features = ["derive"] }
|
||||
substrate-keyring = { path = "../../core/keyring", optional = true }
|
||||
rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false }
|
||||
primitives = { package = "sr-primitives", path = "../../core/sr-primitives", default-features = false }
|
||||
sr-primitives = { path = "../../core/sr-primitives", default-features = false }
|
||||
srml-support = { path = "../support", default-features = false }
|
||||
system = { package = "srml-system", path = "../system", default-features = false }
|
||||
|
||||
[dev-dependencies]
|
||||
runtime_io = { package = "sr-io", path = "../../core/sr-io", default-features = false }
|
||||
substrate-primitives = { path = "../../core/primitives" }
|
||||
primitives = { package = "substrate-primitives", path = "../../core/primitives" }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
@@ -27,6 +27,6 @@ std = [
|
||||
"parity-codec/std",
|
||||
"rstd/std",
|
||||
"srml-support/std",
|
||||
"primitives/std",
|
||||
"sr-primitives/std",
|
||||
"system/std",
|
||||
]
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
//!
|
||||
//! ```
|
||||
//! use srml_support::traits::{WithdrawReasons, LockableCurrency};
|
||||
//! use primitives::traits::Bounded;
|
||||
//! use sr_primitives::traits::Bounded;
|
||||
//! pub trait Trait: system::Trait {
|
||||
//! type Currency: LockableCurrency<Self::AccountId, Moment=Self::BlockNumber>;
|
||||
//! }
|
||||
@@ -159,12 +159,12 @@ use srml_support::traits::{
|
||||
Imbalance, SignedImbalance, ReservableCurrency, Get,
|
||||
};
|
||||
use srml_support::dispatch::Result;
|
||||
use primitives::traits::{
|
||||
use sr_primitives::traits::{
|
||||
Zero, SimpleArithmetic, StaticLookup, Member, CheckedAdd, CheckedSub, MaybeSerializeDebug,
|
||||
Saturating, Bounded, SignedExtension, SaturatedConversion, DispatchError, Convert,
|
||||
};
|
||||
use primitives::transaction_validity::{TransactionPriority, ValidTransaction};
|
||||
use primitives::weights::{DispatchInfo, SimpleDispatchInfo, Weight};
|
||||
use sr_primitives::transaction_validity::{TransactionPriority, ValidTransaction};
|
||||
use sr_primitives::weights::{DispatchInfo, SimpleDispatchInfo, Weight};
|
||||
use system::{IsDeadAccount, OnNewAccount, ensure_signed, ensure_root};
|
||||
|
||||
mod mock;
|
||||
@@ -344,7 +344,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(primitives::traits::One::one());
|
||||
let per_block = locked / length.max(sr_primitives::traits::One::one());
|
||||
|
||||
(who.clone(), VestingSchedule {
|
||||
locked: locked,
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
|
||||
#![cfg(test)]
|
||||
|
||||
use primitives::{Perbill, traits::{Convert, IdentityLookup}, testing::Header, weights::{DispatchInfo, Weight}};
|
||||
use substrate_primitives::{H256, Blake2Hasher};
|
||||
use sr_primitives::{Perbill, traits::{Convert, IdentityLookup}, testing::Header, weights::{DispatchInfo, Weight}};
|
||||
use primitives::{H256, Blake2Hasher};
|
||||
use runtime_io;
|
||||
use srml_support::{impl_outer_origin, parameter_types};
|
||||
use srml_support::traits::Get;
|
||||
@@ -86,7 +86,7 @@ impl system::Trait for Runtime {
|
||||
type Index = u64;
|
||||
type BlockNumber = u64;
|
||||
type Hash = H256;
|
||||
type Hashing = ::primitives::traits::BlakeTwo256;
|
||||
type Hashing = ::sr_primitives::traits::BlakeTwo256;
|
||||
type AccountId = u64;
|
||||
type Lookup = IdentityLookup<Self::AccountId>;
|
||||
type Header = Header;
|
||||
|
||||
@@ -774,7 +774,7 @@ fn signed_extension_take_fees_is_bounded() {
|
||||
.monied(true)
|
||||
.build(),
|
||||
|| {
|
||||
use primitives::weights::Weight;
|
||||
use sr_primitives::weights::Weight;
|
||||
|
||||
// maximum weight possible
|
||||
assert!(TakeFees::<Runtime>::from(0).pre_dispatch(&1, info_from_weight(Weight::max_value()), 10).is_ok());
|
||||
|
||||
@@ -8,10 +8,10 @@ edition = "2018"
|
||||
serde = { version = "1.0", optional = true }
|
||||
safe-mix = { version = "1.0", default-features = false}
|
||||
parity-codec = { version = "4.1.1", default-features = false, features = ["derive"] }
|
||||
substrate-primitives = { path = "../../core/primitives", default-features = false }
|
||||
primitives = { package = "substrate-primitives", path = "../../core/primitives", default-features = false }
|
||||
rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false }
|
||||
runtime_io = { package = "sr-io", path = "../../core/sr-io", default-features = false }
|
||||
primitives = { package = "sr-primitives", path = "../../core/sr-primitives", default-features = false }
|
||||
sr-primitives = { path = "../../core/sr-primitives", default-features = false }
|
||||
srml-support = { path = "../support", default-features = false }
|
||||
system = { package = "srml-system", path = "../system", default-features = false }
|
||||
|
||||
@@ -24,11 +24,11 @@ default = ["std"]
|
||||
std = [
|
||||
"safe-mix/std",
|
||||
"parity-codec/std",
|
||||
"substrate-primitives/std",
|
||||
"primitives/std",
|
||||
"rstd/std",
|
||||
"serde",
|
||||
"runtime_io/std",
|
||||
"srml-support/std",
|
||||
"primitives/std",
|
||||
"sr-primitives/std",
|
||||
"system/std",
|
||||
]
|
||||
|
||||
@@ -21,9 +21,9 @@
|
||||
#![recursion_limit="128"]
|
||||
|
||||
use rstd::{prelude::*, result};
|
||||
use substrate_primitives::u32_trait::Value as U32;
|
||||
use primitives::traits::{Hash, EnsureOrigin};
|
||||
use primitives::weights::SimpleDispatchInfo;
|
||||
use primitives::u32_trait::Value as U32;
|
||||
use sr_primitives::traits::{Hash, EnsureOrigin};
|
||||
use sr_primitives::weights::SimpleDispatchInfo;
|
||||
use srml_support::{
|
||||
dispatch::{Dispatchable, Parameter}, codec::{Encode, Decode}, traits::ChangeMembers,
|
||||
StorageValue, StorageMap, decl_module, decl_event, decl_storage, ensure
|
||||
@@ -397,8 +397,8 @@ mod tests {
|
||||
use system::{EventRecord, Phase};
|
||||
use hex_literal::hex;
|
||||
use runtime_io::with_externalities;
|
||||
use substrate_primitives::{H256, Blake2Hasher};
|
||||
use primitives::{
|
||||
use primitives::{H256, Blake2Hasher};
|
||||
use sr_primitives::{
|
||||
Perbill, traits::{BlakeTwo256, IdentityLookup, Block as BlockT}, testing::Header, BuildStorage
|
||||
};
|
||||
use crate as collective;
|
||||
@@ -436,8 +436,8 @@ mod tests {
|
||||
type Event = Event;
|
||||
}
|
||||
|
||||
pub type Block = primitives::generic::Block<Header, UncheckedExtrinsic>;
|
||||
pub type UncheckedExtrinsic = primitives::generic::UncheckedExtrinsic<u32, u64, Call, ()>;
|
||||
pub type Block = sr_primitives::generic::Block<Header, UncheckedExtrinsic>;
|
||||
pub type UncheckedExtrinsic = sr_primitives::generic::UncheckedExtrinsic<u32, u64, Call, ()>;
|
||||
|
||||
srml_support::construct_runtime!(
|
||||
pub enum Test where
|
||||
|
||||
@@ -10,8 +10,8 @@ pwasm-utils = { version = "0.6.1", default-features = false }
|
||||
parity-codec = { version = "4.1.1", default-features = false, features = ["derive"] }
|
||||
parity-wasm = { version = "0.31", default-features = false }
|
||||
wasmi-validation = { version = "0.1", default-features = false }
|
||||
substrate-primitives = { path = "../../core/primitives", default-features = false }
|
||||
runtime-primitives = { package = "sr-primitives", path = "../../core/sr-primitives", default-features = false }
|
||||
primitives = { package = "substrate-primitives", path = "../../core/primitives", default-features = false }
|
||||
sr-primitives = { path = "../../core/sr-primitives", default-features = false }
|
||||
runtime-io = { package = "sr-io", path = "../../core/sr-io", default-features = false }
|
||||
rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false }
|
||||
sandbox = { package = "sr-sandbox", path = "../../core/sr-sandbox", default-features = false }
|
||||
@@ -34,8 +34,8 @@ core = [
|
||||
std = [
|
||||
"serde",
|
||||
"parity-codec/std",
|
||||
"substrate-primitives/std",
|
||||
"runtime-primitives/std",
|
||||
"primitives/std",
|
||||
"sr-primitives/std",
|
||||
"runtime-io/std",
|
||||
"rstd/std",
|
||||
"sandbox/std",
|
||||
|
||||
@@ -25,7 +25,7 @@ use rstd::cell::RefCell;
|
||||
use rstd::collections::btree_map::{BTreeMap, Entry};
|
||||
use rstd::prelude::*;
|
||||
use runtime_io::blake2_256;
|
||||
use runtime_primitives::traits::{Bounded, Zero};
|
||||
use sr_primitives::traits::{Bounded, Zero};
|
||||
use srml_support::traits::{Currency, Get, Imbalance, SignedImbalance, UpdateBalanceOutcome};
|
||||
use srml_support::{storage::child, StorageMap};
|
||||
use system;
|
||||
|
||||
@@ -21,7 +21,7 @@ use crate::gas::{Gas, GasMeter, Token, approx_gas_for_balance};
|
||||
use crate::rent;
|
||||
|
||||
use rstd::prelude::*;
|
||||
use runtime_primitives::traits::{Bounded, CheckedAdd, CheckedSub, Zero};
|
||||
use sr_primitives::traits::{Bounded, CheckedAdd, CheckedSub, Zero};
|
||||
use srml_support::traits::{WithdrawReason, Currency};
|
||||
use timestamp;
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
use crate::{GasSpent, Module, Trait, BalanceOf, NegativeImbalanceOf};
|
||||
use rstd::convert::TryFrom;
|
||||
use runtime_primitives::BLOCK_FULL;
|
||||
use runtime_primitives::traits::{CheckedMul, Zero, SaturatedConversion, SimpleArithmetic, UniqueSaturatedInto};
|
||||
use sr_primitives::BLOCK_FULL;
|
||||
use sr_primitives::traits::{CheckedMul, Zero, SaturatedConversion, SimpleArithmetic, UniqueSaturatedInto};
|
||||
use srml_support::StorageValue;
|
||||
use srml_support::traits::{Currency, ExistenceRequirement, Get, Imbalance, OnUnbalanced, WithdrawReason};
|
||||
|
||||
|
||||
@@ -96,11 +96,11 @@ use crate::wasm::{WasmLoader, WasmVm};
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
use serde::{Serialize, Deserialize};
|
||||
use substrate_primitives::crypto::UncheckedFrom;
|
||||
use primitives::crypto::UncheckedFrom;
|
||||
use rstd::{prelude::*, marker::PhantomData};
|
||||
use parity_codec::{Codec, Encode, Decode};
|
||||
use runtime_io::blake2_256;
|
||||
use runtime_primitives::traits::{
|
||||
use sr_primitives::traits::{
|
||||
Hash, StaticLookup, Zero, MaybeSerializeDebug, Member
|
||||
};
|
||||
use srml_support::dispatch::{Result, Dispatchable};
|
||||
@@ -110,7 +110,7 @@ use srml_support::{
|
||||
};
|
||||
use srml_support::traits::{OnFreeBalanceZero, OnUnbalanced, Currency, Get};
|
||||
use system::{ensure_signed, RawOrigin, ensure_root};
|
||||
use substrate_primitives::storage::well_known_keys::CHILD_STORAGE_KEY_PREFIX;
|
||||
use primitives::storage::well_known_keys::CHILD_STORAGE_KEY_PREFIX;
|
||||
use timestamp;
|
||||
|
||||
pub type CodeHash<T> = <T as system::Trait>::Hash;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use crate::{BalanceOf, ContractInfo, ContractInfoOf, TombstoneContractInfo, Trait, AliveContractInfo};
|
||||
use runtime_primitives::traits::{Bounded, CheckedDiv, CheckedMul, Saturating, Zero,
|
||||
use sr_primitives::traits::{Bounded, CheckedDiv, CheckedMul, Saturating, Zero,
|
||||
SaturatedConversion};
|
||||
use srml_support::traits::{Currency, ExistenceRequirement, Get, WithdrawReason};
|
||||
use srml_support::StorageMap;
|
||||
|
||||
@@ -29,17 +29,17 @@ use hex_literal::*;
|
||||
use parity_codec::{Decode, Encode, KeyedVec};
|
||||
use runtime_io;
|
||||
use runtime_io::with_externalities;
|
||||
use runtime_primitives::testing::{Digest, DigestItem, Header, UintAuthorityId, H256};
|
||||
use runtime_primitives::traits::{BlakeTwo256, Hash, IdentityLookup};
|
||||
use runtime_primitives::{Perbill, BuildStorage};
|
||||
use sr_primitives::testing::{Digest, DigestItem, Header, UintAuthorityId, H256};
|
||||
use sr_primitives::traits::{BlakeTwo256, Hash, IdentityLookup};
|
||||
use sr_primitives::{Perbill, BuildStorage};
|
||||
use srml_support::{
|
||||
assert_ok, assert_err, impl_outer_dispatch, impl_outer_event, impl_outer_origin, parameter_types,
|
||||
storage::child, StorageMap, StorageValue, traits::{Currency, Get},
|
||||
};
|
||||
use std::cell::RefCell;
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
use substrate_primitives::storage::well_known_keys;
|
||||
use substrate_primitives::Blake2Hasher;
|
||||
use primitives::storage::well_known_keys;
|
||||
use primitives::Blake2Hasher;
|
||||
use system::{self, EventRecord, Phase};
|
||||
use {balances, wabt};
|
||||
|
||||
@@ -196,7 +196,7 @@ impl ContractAddressFor<H256, u64> for DummyContractAddressFor {
|
||||
pub struct DummyTrieIdGenerator;
|
||||
impl TrieIdGenerator<u64> for DummyTrieIdGenerator {
|
||||
fn trie_id(account_id: &u64) -> TrieId {
|
||||
use substrate_primitives::storage::well_known_keys;
|
||||
use primitives::storage::well_known_keys;
|
||||
|
||||
let new_seed = super::AccountCounter::mutate(|v| {
|
||||
*v = v.wrapping_add(1);
|
||||
|
||||
@@ -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 runtime_primitives::traits::{Hash, Bounded};
|
||||
use sr_primitives::traits::{Hash, Bounded};
|
||||
use srml_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 runtime_primitives::traits::Zero;
|
||||
use sr_primitives::traits::Zero;
|
||||
use sandbox::{self, ReturnValue, TypedValue};
|
||||
use crate::wasm::tests::MockExt;
|
||||
use crate::wasm::Runtime;
|
||||
|
||||
@@ -173,7 +173,7 @@ impl<'a, T: Trait> crate::exec::Vm<T> for WasmVm<'a> {
|
||||
mod tests {
|
||||
use super::*;
|
||||
use std::collections::HashMap;
|
||||
use substrate_primitives::H256;
|
||||
use primitives::H256;
|
||||
use crate::exec::{CallReceipt, Ext, InstantiateReceipt, EmptyOutputBuf, StorageKey};
|
||||
use crate::gas::{Gas, GasMeter};
|
||||
use crate::tests::{Test, Call};
|
||||
|
||||
@@ -26,7 +26,7 @@ use parity_wasm::elements::{self, Internal, External, MemoryType, Type};
|
||||
use pwasm_utils;
|
||||
use pwasm_utils::rules;
|
||||
use rstd::prelude::*;
|
||||
use runtime_primitives::traits::{SaturatedConversion};
|
||||
use sr_primitives::traits::{SaturatedConversion};
|
||||
|
||||
struct ContractModule<'a> {
|
||||
/// A deserialized module. The module is valid (this is Guaranteed by `new` method).
|
||||
|
||||
@@ -27,7 +27,7 @@ use system;
|
||||
use rstd::prelude::*;
|
||||
use rstd::mem;
|
||||
use parity_codec::{Decode, Encode};
|
||||
use runtime_primitives::traits::{Bounded, SaturatedConversion};
|
||||
use sr_primitives::traits::{Bounded, SaturatedConversion};
|
||||
|
||||
/// Enumerates all possible *special* trap conditions.
|
||||
///
|
||||
|
||||
@@ -41,10 +41,10 @@ mod tests {
|
||||
pub use runtime_io::with_externalities;
|
||||
use srml_support::{impl_outer_origin, impl_outer_event, impl_outer_dispatch, parameter_types};
|
||||
use srml_support::traits::Get;
|
||||
pub use substrate_primitives::{H256, Blake2Hasher, u32_trait::{_1, _2, _3, _4}};
|
||||
pub use primitives::traits::{BlakeTwo256, IdentityLookup};
|
||||
pub use primitives::testing::{Digest, DigestItem, Header};
|
||||
pub use primitives::Perbill;
|
||||
pub use primitives::{H256, Blake2Hasher, u32_trait::{_1, _2, _3, _4}};
|
||||
pub use sr_primitives::traits::{BlakeTwo256, IdentityLookup};
|
||||
pub use sr_primitives::testing::{Digest, DigestItem, Header};
|
||||
pub use sr_primitives::Perbill;
|
||||
pub use {seats, motions};
|
||||
use std::cell::RefCell;
|
||||
|
||||
|
||||
@@ -10,12 +10,12 @@ safe-mix = { version = "1.0", default-features = false}
|
||||
parity-codec = { version = "4.1.1", default-features = false, features = ["derive"] }
|
||||
rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false }
|
||||
runtime_io = { package = "sr-io", path = "../../core/sr-io", default-features = false }
|
||||
primitives = { package = "sr-primitives", path = "../../core/sr-primitives", default-features = false }
|
||||
sr-primitives = { path = "../../core/sr-primitives", default-features = false }
|
||||
srml-support = { path = "../support", default-features = false }
|
||||
system = { package = "srml-system", path = "../system", default-features = false }
|
||||
|
||||
[dev-dependencies]
|
||||
substrate-primitives = { path = "../../core/primitives" }
|
||||
primitives = { package = "substrate-primitives", path = "../../core/primitives" }
|
||||
balances = { package = "srml-balances", path = "../balances" }
|
||||
|
||||
[features]
|
||||
@@ -27,6 +27,6 @@ std = [
|
||||
"rstd/std",
|
||||
"runtime_io/std",
|
||||
"srml-support/std",
|
||||
"primitives/std",
|
||||
"sr-primitives/std",
|
||||
"system/std",
|
||||
]
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
|
||||
use rstd::prelude::*;
|
||||
use rstd::{result, convert::TryFrom};
|
||||
use primitives::traits::{Zero, Bounded, CheckedMul, CheckedDiv, EnsureOrigin, Hash};
|
||||
use primitives::weights::SimpleDispatchInfo;
|
||||
use sr_primitives::traits::{Zero, Bounded, CheckedMul, CheckedDiv, EnsureOrigin, Hash};
|
||||
use sr_primitives::weights::SimpleDispatchInfo;
|
||||
use parity_codec::{Encode, Decode, Input, Output};
|
||||
use srml_support::{
|
||||
decl_module, decl_storage, decl_event, ensure,
|
||||
@@ -990,9 +990,9 @@ mod tests {
|
||||
impl_outer_origin, impl_outer_dispatch, assert_noop, assert_ok, parameter_types,
|
||||
traits::Contains
|
||||
};
|
||||
use substrate_primitives::{H256, Blake2Hasher};
|
||||
use primitives::{traits::{BlakeTwo256, IdentityLookup, Bounded}, testing::Header};
|
||||
use primitives::Perbill;
|
||||
use primitives::{H256, Blake2Hasher};
|
||||
use sr_primitives::{traits::{BlakeTwo256, IdentityLookup, Bounded}, testing::Header};
|
||||
use sr_primitives::Perbill;
|
||||
use balances::BalanceLock;
|
||||
use system::EnsureSignedBy;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#[cfg(feature = "std")]
|
||||
use serde::{Serialize, Deserialize};
|
||||
use parity_codec::{Encode, Decode};
|
||||
use primitives::traits::{Zero, IntegerSquareRoot};
|
||||
use sr_primitives::traits::{Zero, IntegerSquareRoot};
|
||||
use rstd::ops::{Add, Mul, Div, Rem};
|
||||
|
||||
/// A means of determining if a vote is past pass threshold.
|
||||
|
||||
@@ -8,10 +8,10 @@ edition = "2018"
|
||||
serde = { version = "1.0", optional = true }
|
||||
safe-mix = { version = "1.0", default-features = false}
|
||||
parity-codec = { version = "4.1.1", default-features = false, features = ["derive"] }
|
||||
substrate-primitives = { path = "../../core/primitives", default-features = false }
|
||||
primitives = { package = "substrate-primitives", path = "../../core/primitives", default-features = false }
|
||||
rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false }
|
||||
runtime_io = { package = "sr-io", path = "../../core/sr-io", default-features = false }
|
||||
primitives = { package = "sr-primitives", path = "../../core/sr-primitives", default-features = false }
|
||||
sr-primitives = { path = "../../core/sr-primitives", default-features = false }
|
||||
srml-support = { path = "../support", default-features = false }
|
||||
system = { package = "srml-system", path = "../system", default-features = false }
|
||||
|
||||
@@ -24,11 +24,11 @@ default = ["std"]
|
||||
std = [
|
||||
"safe-mix/std",
|
||||
"parity-codec/std",
|
||||
"substrate-primitives/std",
|
||||
"primitives/std",
|
||||
"rstd/std",
|
||||
"serde",
|
||||
"runtime_io/std",
|
||||
"srml-support/std",
|
||||
"primitives/std",
|
||||
"sr-primitives/std",
|
||||
"system/std",
|
||||
]
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
#![recursion_limit="128"]
|
||||
|
||||
use rstd::prelude::*;
|
||||
use primitives::traits::{Zero, One, StaticLookup, Bounded, Saturating};
|
||||
use primitives::weights::SimpleDispatchInfo;
|
||||
use sr_primitives::traits::{Zero, One, StaticLookup, Bounded, Saturating};
|
||||
use sr_primitives::weights::SimpleDispatchInfo;
|
||||
use runtime_io::print;
|
||||
use srml_support::{
|
||||
StorageValue, StorageMap,
|
||||
@@ -1116,8 +1116,8 @@ mod tests {
|
||||
use std::cell::RefCell;
|
||||
use srml_support::{assert_ok, assert_err, assert_noop, parameter_types};
|
||||
use runtime_io::with_externalities;
|
||||
use substrate_primitives::{H256, Blake2Hasher};
|
||||
use primitives::{
|
||||
use primitives::{H256, Blake2Hasher};
|
||||
use sr_primitives::{
|
||||
Perbill, traits::{BlakeTwo256, IdentityLookup, Block as BlockT}, testing::Header, BuildStorage
|
||||
};
|
||||
use crate as elections;
|
||||
@@ -1234,8 +1234,8 @@ mod tests {
|
||||
type DecayRatio = DecayRatio;
|
||||
}
|
||||
|
||||
pub type Block = primitives::generic::Block<Header, UncheckedExtrinsic>;
|
||||
pub type UncheckedExtrinsic = primitives::generic::UncheckedExtrinsic<u32, u64, Call, ()>;
|
||||
pub type Block = sr_primitives::generic::Block<Header, UncheckedExtrinsic>;
|
||||
pub type UncheckedExtrinsic = sr_primitives::generic::UncheckedExtrinsic<u32, u64, Call, ()>;
|
||||
|
||||
srml_support::construct_runtime!(
|
||||
pub enum Test where
|
||||
|
||||
@@ -14,7 +14,7 @@ sr-primitives = { path = "../../core/sr-primitives", default-features = false }
|
||||
|
||||
[dev-dependencies]
|
||||
sr-io = { path = "../../core/sr-io" }
|
||||
substrate-primitives = { path = "../../core/primitives" }
|
||||
primitives = { package = "substrate-primitives", path = "../../core/primitives" }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
|
||||
@@ -506,7 +506,7 @@ mod tests {
|
||||
|
||||
use srml_support::{assert_ok, impl_outer_origin, parameter_types};
|
||||
use sr_io::with_externalities;
|
||||
use substrate_primitives::{H256, Blake2Hasher};
|
||||
use primitives::{H256, Blake2Hasher};
|
||||
// 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::{
|
||||
|
||||
@@ -9,13 +9,13 @@ serde = { version = "1.0", optional = true }
|
||||
parity-codec = { version = "4.1.1", default-features = false, features = ["derive"] }
|
||||
rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false }
|
||||
runtime_io = { package = "sr-io", path = "../../core/sr-io", default-features = false }
|
||||
primitives = { package = "sr-primitives", path = "../../core/sr-primitives", default-features = false }
|
||||
sr-primitives = { path = "../../core/sr-primitives", default-features = false }
|
||||
srml-support = { path = "../support", default-features = false }
|
||||
system = { package = "srml-system", path = "../system", default-features = false }
|
||||
|
||||
[dev-dependencies]
|
||||
hex-literal = "0.2.0"
|
||||
substrate-primitives = { path = "../../core/primitives" }
|
||||
primitives = { package = "substrate-primitives", path = "../../core/primitives" }
|
||||
srml-indices = { path = "../indices" }
|
||||
balances = { package = "srml-balances", path = "../balances" }
|
||||
|
||||
@@ -26,7 +26,7 @@ std = [
|
||||
"srml-support/std",
|
||||
"serde",
|
||||
"parity-codec/std",
|
||||
"primitives/std",
|
||||
"sr-primitives/std",
|
||||
"runtime_io/std",
|
||||
"system/std",
|
||||
]
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
//! `Executive` type declaration from the node template.
|
||||
//!
|
||||
//! ```
|
||||
//! # use primitives::generic;
|
||||
//! # use sr_primitives::generic;
|
||||
//! # use srml_executive as executive;
|
||||
//! # pub struct UncheckedExtrinsic {};
|
||||
//! # pub struct Header {};
|
||||
@@ -59,8 +59,8 @@
|
||||
//! # pub type Balances = u64;
|
||||
//! # pub type AllModules = u64;
|
||||
//! # pub enum Runtime {};
|
||||
//! # use primitives::transaction_validity::TransactionValidity;
|
||||
//! # use primitives::traits::ValidateUnsigned;
|
||||
//! # use sr_primitives::transaction_validity::TransactionValidity;
|
||||
//! # use sr_primitives::traits::ValidateUnsigned;
|
||||
//! # impl ValidateUnsigned for Runtime {
|
||||
//! # type Call = ();
|
||||
//! #
|
||||
@@ -77,19 +77,19 @@
|
||||
use rstd::prelude::*;
|
||||
use rstd::marker::PhantomData;
|
||||
use rstd::result;
|
||||
use primitives::{generic::Digest, traits::{
|
||||
use sr_primitives::{generic::Digest, traits::{
|
||||
self, Header, Zero, One, Checkable, Applyable, CheckEqual, OnFinalize,
|
||||
OnInitialize, NumberFor, Block as BlockT, OffchainWorker, ValidateUnsigned
|
||||
}};
|
||||
use srml_support::Dispatchable;
|
||||
use parity_codec::{Codec, Encode};
|
||||
use system::{extrinsics_root, DigestOf};
|
||||
use primitives::{ApplyOutcome, ApplyError};
|
||||
use primitives::transaction_validity::TransactionValidity;
|
||||
use primitives::weights::GetDispatchInfo;
|
||||
use sr_primitives::{ApplyOutcome, ApplyError};
|
||||
use sr_primitives::transaction_validity::TransactionValidity;
|
||||
use sr_primitives::weights::GetDispatchInfo;
|
||||
|
||||
mod internal {
|
||||
use primitives::traits::DispatchError;
|
||||
use sr_primitives::traits::DispatchError;
|
||||
|
||||
pub enum ApplyError {
|
||||
BadSignature(&'static str),
|
||||
@@ -292,7 +292,7 @@ where
|
||||
<system::Module<System>>::note_applied_extrinsic(&r, encoded_len as u32);
|
||||
|
||||
r.map(|_| internal::ApplyOutcome::Success).or_else(|e| match e {
|
||||
primitives::BLOCK_FULL => Err(internal::ApplyError::FullBlock),
|
||||
sr_primitives::BLOCK_FULL => Err(internal::ApplyError::FullBlock),
|
||||
e => Ok(internal::ApplyOutcome::Fail(e))
|
||||
})
|
||||
}
|
||||
@@ -336,7 +336,7 @@ where
|
||||
Err("invalid account index") => return TransactionValidity::Unknown(INVALID_INDEX),
|
||||
// Technically a bad signature could also imply an out-of-date account index, but
|
||||
// that's more of an edge case.
|
||||
Err(primitives::BAD_SIGNATURE) => return TransactionValidity::Invalid(ApplyError::BadSignature as i8),
|
||||
Err(sr_primitives::BAD_SIGNATURE) => return TransactionValidity::Invalid(ApplyError::BadSignature as i8),
|
||||
Err(_) => return TransactionValidity::Invalid(UNKNOWN_ERROR),
|
||||
};
|
||||
|
||||
@@ -356,12 +356,12 @@ mod tests {
|
||||
use super::*;
|
||||
use balances::Call;
|
||||
use runtime_io::with_externalities;
|
||||
use substrate_primitives::{H256, Blake2Hasher};
|
||||
use primitives::generic::Era;
|
||||
use primitives::Perbill;
|
||||
use primitives::weights::Weight;
|
||||
use primitives::traits::{Header as HeaderT, BlakeTwo256, IdentityLookup, ConvertInto};
|
||||
use primitives::testing::{Digest, Header, Block};
|
||||
use primitives::{H256, Blake2Hasher};
|
||||
use sr_primitives::generic::Era;
|
||||
use sr_primitives::Perbill;
|
||||
use sr_primitives::weights::Weight;
|
||||
use sr_primitives::traits::{Header as HeaderT, BlakeTwo256, IdentityLookup, ConvertInto};
|
||||
use sr_primitives::testing::{Digest, Header, Block};
|
||||
use srml_support::{impl_outer_event, impl_outer_origin, parameter_types};
|
||||
use srml_support::traits::{Currency, LockIdentifier, LockableCurrency, WithdrawReasons, WithdrawReason};
|
||||
use system;
|
||||
@@ -391,7 +391,7 @@ mod tests {
|
||||
type Origin = Origin;
|
||||
type Index = u64;
|
||||
type BlockNumber = u64;
|
||||
type Hash = substrate_primitives::H256;
|
||||
type Hash = primitives::H256;
|
||||
type Hashing = BlakeTwo256;
|
||||
type AccountId = u64;
|
||||
type Lookup = IdentityLookup<u64>;
|
||||
@@ -443,7 +443,7 @@ mod tests {
|
||||
system::CheckWeight<Runtime>,
|
||||
balances::TakeFees<Runtime>
|
||||
);
|
||||
type TestXt = primitives::testing::TestXt<Call<Runtime>, SignedExtra>;
|
||||
type TestXt = sr_primitives::testing::TestXt<Call<Runtime>, SignedExtra>;
|
||||
type Executive = super::Executive<Runtime, Block<TestXt>, system::ChainContext<Runtime>, Runtime, ()>;
|
||||
|
||||
fn extra(nonce: u64, fee: u64) -> SignedExtra {
|
||||
@@ -466,7 +466,7 @@ mod tests {
|
||||
balances: vec![(1, 211)],
|
||||
vesting: vec![],
|
||||
}.assimilate_storage(&mut t.0, &mut t.1).unwrap();
|
||||
let xt = primitives::testing::TestXt(sign_extra(1, 0, 0), Call::transfer(2, 69));
|
||||
let xt = sr_primitives::testing::TestXt(sign_extra(1, 0, 0), Call::transfer(2, 69));
|
||||
let weight = xt.get_dispatch_info().weight as u64;
|
||||
let mut t = runtime_io::TestExternalities::<Blake2Hasher>::new_with_children(t);
|
||||
with_externalities(&mut t, || {
|
||||
@@ -547,7 +547,7 @@ mod tests {
|
||||
fn bad_extrinsic_not_inserted() {
|
||||
let mut t = new_test_ext(1);
|
||||
// bad nonce check!
|
||||
let xt = primitives::testing::TestXt(sign_extra(1, 30, 0), Call::transfer(33, 69));
|
||||
let xt = sr_primitives::testing::TestXt(sign_extra(1, 30, 0), Call::transfer(33, 69));
|
||||
with_externalities(&mut t, || {
|
||||
Executive::initialize_block(&Header::new(
|
||||
1,
|
||||
@@ -565,7 +565,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 = primitives::testing::TestXt(sign_extra(1, 0, 0), Call::transfer::<Runtime>(33, 0));
|
||||
let xt = sr_primitives::testing::TestXt(sign_extra(1, 0, 0), Call::transfer::<Runtime>(33, 0));
|
||||
let encoded = xt.encode();
|
||||
let encoded_len = encoded.len() as Weight;
|
||||
let limit = AvailableBlockRatio::get() * MaximumBlockWeight::get();
|
||||
@@ -581,7 +581,7 @@ mod tests {
|
||||
assert_eq!(<system::Module<Runtime>>::all_extrinsics_weight(), 0);
|
||||
|
||||
for nonce in 0..=num_to_exhaust_block {
|
||||
let xt = primitives::testing::TestXt(sign_extra(1, nonce.into(), 0), Call::transfer::<Runtime>(33, 0));
|
||||
let xt = sr_primitives::testing::TestXt(sign_extra(1, nonce.into(), 0), Call::transfer::<Runtime>(33, 0));
|
||||
let res = Executive::apply_extrinsic(xt);
|
||||
if nonce != num_to_exhaust_block {
|
||||
assert_eq!(res.unwrap(), ApplyOutcome::Success);
|
||||
@@ -596,9 +596,9 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn block_weight_and_size_is_stored_per_tx() {
|
||||
let xt = primitives::testing::TestXt(sign_extra(1, 0, 0), Call::transfer(33, 0));
|
||||
let x1 = primitives::testing::TestXt(sign_extra(1, 1, 0), Call::transfer(33, 0));
|
||||
let x2 = primitives::testing::TestXt(sign_extra(1, 2, 0), Call::transfer(33, 0));
|
||||
let xt = sr_primitives::testing::TestXt(sign_extra(1, 0, 0), Call::transfer(33, 0));
|
||||
let x1 = sr_primitives::testing::TestXt(sign_extra(1, 1, 0), Call::transfer(33, 0));
|
||||
let x2 = sr_primitives::testing::TestXt(sign_extra(1, 2, 0), Call::transfer(33, 0));
|
||||
let len = xt.clone().encode().len() as u32;
|
||||
let mut t = new_test_ext(1);
|
||||
with_externalities(&mut t, || {
|
||||
@@ -622,7 +622,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn validate_unsigned() {
|
||||
let xt = primitives::testing::TestXt(None, Call::set_balance(33, 69, 69));
|
||||
let xt = sr_primitives::testing::TestXt(None, Call::set_balance(33, 69, 69));
|
||||
let valid = TransactionValidity::Valid(Default::default());
|
||||
let mut t = new_test_ext(1);
|
||||
|
||||
@@ -645,7 +645,7 @@ mod tests {
|
||||
10,
|
||||
lock,
|
||||
);
|
||||
let xt = primitives::testing::TestXt(sign_extra(1, 0, 0), Call::transfer(2, 10));
|
||||
let xt = sr_primitives::testing::TestXt(sign_extra(1, 0, 0), Call::transfer(2, 10));
|
||||
let weight = xt.get_dispatch_info().weight as u64;
|
||||
Executive::initialize_block(&Header::new(
|
||||
1,
|
||||
|
||||
@@ -9,12 +9,12 @@ serde = { version = "1.0", default-features = false, features = ["derive"] }
|
||||
parity-codec = { version = "4.1.1", default-features = false }
|
||||
inherents = { package = "substrate-inherents", path = "../../core/inherents", default-features = false }
|
||||
rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false }
|
||||
primitives = { package = "sr-primitives", path = "../../core/sr-primitives", default-features = false }
|
||||
sr-primitives = { path = "../../core/sr-primitives", default-features = false }
|
||||
srml-support = { path = "../support", default-features = false }
|
||||
srml-system = { path = "../system", default-features = false }
|
||||
|
||||
[dev-dependencies]
|
||||
substrate-primitives = { path = "../../core/primitives", default-features = false }
|
||||
primitives = { package = "substrate-primitives", path = "../../core/primitives", default-features = false }
|
||||
sr-io = { path = "../../core/sr-io", default-features = false }
|
||||
|
||||
[features]
|
||||
@@ -24,7 +24,7 @@ std = [
|
||||
"parity-codec/std",
|
||||
"rstd/std",
|
||||
"srml-support/std",
|
||||
"primitives/std",
|
||||
"sr-primitives/std",
|
||||
"srml-system/std",
|
||||
"inherents/std",
|
||||
]
|
||||
|
||||
@@ -23,7 +23,7 @@ use inherents::{
|
||||
InherentData, MakeFatalError,
|
||||
};
|
||||
use srml_support::StorageValue;
|
||||
use primitives::traits::{One, Zero, SaturatedConversion};
|
||||
use sr_primitives::traits::{One, Zero, SaturatedConversion};
|
||||
use rstd::{prelude::*, result, cmp, vec};
|
||||
use parity_codec::Decode;
|
||||
use srml_support::{decl_module, decl_storage, for_each_tuple};
|
||||
@@ -265,10 +265,10 @@ mod tests {
|
||||
use super::*;
|
||||
|
||||
use sr_io::{with_externalities, TestExternalities};
|
||||
use substrate_primitives::H256;
|
||||
use primitives::traits::{BlakeTwo256, IdentityLookup, OnFinalize, Header as HeaderT};
|
||||
use primitives::testing::Header;
|
||||
use primitives::Perbill;
|
||||
use primitives::H256;
|
||||
use sr_primitives::traits::{BlakeTwo256, IdentityLookup, OnFinalize, Header as HeaderT};
|
||||
use sr_primitives::testing::Header;
|
||||
use sr_primitives::Perbill;
|
||||
use srml_support::{assert_ok, impl_outer_origin, parameter_types};
|
||||
use srml_system as system;
|
||||
use std::cell::RefCell;
|
||||
|
||||
@@ -8,13 +8,13 @@ edition = "2018"
|
||||
serde = { version = "1.0", optional = true }
|
||||
parity-codec = { version = "4.1.1", default-features = false, features = ["derive"] }
|
||||
rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false }
|
||||
primitives = { package = "sr-primitives", path = "../../core/sr-primitives", default-features = false }
|
||||
sr-primitives = { path = "../../core/sr-primitives", default-features = false }
|
||||
support = { package = "srml-support", path = "../support", default-features = false }
|
||||
system = { package = "srml-system", path = "../system", default-features = false }
|
||||
|
||||
[dev-dependencies]
|
||||
runtime_io = { package = "sr-io", path = "../../core/sr-io" }
|
||||
substrate-primitives = { path = "../../core/primitives" }
|
||||
primitives = { package = "substrate-primitives", path = "../../core/primitives" }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
@@ -22,7 +22,7 @@ std =[
|
||||
"serde/std",
|
||||
"parity-codec/std",
|
||||
"rstd/std",
|
||||
"primitives/std",
|
||||
"sr-primitives/std",
|
||||
"support/std",
|
||||
"system/std",
|
||||
]
|
||||
|
||||
@@ -153,7 +153,7 @@
|
||||
|
||||
use parity_codec::{Decode, Encode, HasCompact, Input, Output};
|
||||
|
||||
use primitives::traits::{
|
||||
use sr_primitives::traits::{
|
||||
CheckedAdd, CheckedSub, MaybeSerializeDebug, Member, One, Saturating, SimpleArithmetic, Zero, Bounded
|
||||
};
|
||||
|
||||
@@ -477,8 +477,8 @@ decl_storage! {
|
||||
config(endowed_accounts): Vec<T::AccountId>;
|
||||
|
||||
build(|
|
||||
storage: &mut primitives::StorageOverlay,
|
||||
_: &mut primitives::ChildrenStorageOverlay,
|
||||
storage: &mut sr_primitives::StorageOverlay,
|
||||
_: &mut sr_primitives::ChildrenStorageOverlay,
|
||||
config: &GenesisConfig<T>| {
|
||||
config.assets.iter().for_each(|asset_id| {
|
||||
config.endowed_accounts.iter().for_each(|account_id| {
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
|
||||
#![cfg(test)]
|
||||
|
||||
use primitives::{Perbill, testing::Header, traits::{BlakeTwo256, IdentityLookup}};
|
||||
use substrate_primitives::{Blake2Hasher, H256};
|
||||
use sr_primitives::{Perbill, testing::Header, traits::{BlakeTwo256, IdentityLookup}};
|
||||
use primitives::{Blake2Hasher, H256};
|
||||
use support::{parameter_types, impl_outer_event, impl_outer_origin};
|
||||
|
||||
use super::*;
|
||||
|
||||
@@ -7,10 +7,10 @@ edition = "2018"
|
||||
[dependencies]
|
||||
serde = { version = "1.0", optional = true, features = ["derive"] }
|
||||
parity-codec = { version = "4.1.1", default-features = false, features = ["derive"] }
|
||||
substrate-primitives = { path = "../../core/primitives", default-features = false }
|
||||
primitives = { package = "substrate-primitives", path = "../../core/primitives", default-features = false }
|
||||
substrate-finality-grandpa-primitives = { path = "../../core/finality-grandpa/primitives", default-features = false }
|
||||
rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false }
|
||||
primitives = { package = "sr-primitives", path = "../../core/sr-primitives", default-features = false }
|
||||
sr-primitives = { path = "../../core/sr-primitives", default-features = false }
|
||||
srml-support = { path = "../support", default-features = false }
|
||||
system = { package = "srml-system", path = "../system", default-features = false }
|
||||
session = { package = "srml-session", path = "../session", default-features = false }
|
||||
@@ -24,11 +24,11 @@ default = ["std"]
|
||||
std = [
|
||||
"serde",
|
||||
"parity-codec/std",
|
||||
"substrate-primitives/std",
|
||||
"primitives/std",
|
||||
"substrate-finality-grandpa-primitives/std",
|
||||
"rstd/std",
|
||||
"srml-support/std",
|
||||
"primitives/std",
|
||||
"sr-primitives/std",
|
||||
"system/std",
|
||||
"session/std",
|
||||
"finality-tracker/std",
|
||||
|
||||
@@ -35,8 +35,8 @@ use parity_codec::{self as codec, Encode, Decode};
|
||||
use srml_support::{
|
||||
decl_event, decl_storage, decl_module, dispatch::Result, storage::StorageValue
|
||||
};
|
||||
use primitives::{
|
||||
generic::{DigestItem, OpaqueDigestItemId}, traits::CurrentHeight
|
||||
use sr_primitives::{
|
||||
generic::{DigestItem, OpaqueDigestItemId}, traits::{CurrentHeight, Zero},
|
||||
};
|
||||
use fg_primitives::{ScheduledChange, ConsensusLog, GRANDPA_ENGINE_ID};
|
||||
pub use fg_primitives::{AuthorityId, AuthorityWeight};
|
||||
@@ -354,7 +354,6 @@ impl<T: Trait> session::OneSessionHandler<T::AccountId> for Module<T> {
|
||||
let next_authorities = validators.map(|(_, k)| (k, 1u64)).collect::<Vec<_>>();
|
||||
let last_authorities = <Module<T>>::grandpa_authorities();
|
||||
if next_authorities != last_authorities {
|
||||
use primitives::traits::Zero;
|
||||
if let Some((further_wait, median)) = <Stalled<T>>::take() {
|
||||
let _ = Self::schedule_change(next_authorities, further_wait, Some(median));
|
||||
} else {
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
|
||||
#![cfg(test)]
|
||||
|
||||
use primitives::{Perbill, DigestItem, traits::IdentityLookup, testing::{Header, UintAuthorityId}};
|
||||
use sr_primitives::{Perbill, DigestItem, traits::IdentityLookup, testing::{Header, UintAuthorityId}};
|
||||
use runtime_io;
|
||||
use srml_support::{impl_outer_origin, impl_outer_event, parameter_types};
|
||||
use substrate_primitives::{H256, Blake2Hasher};
|
||||
use primitives::{H256, Blake2Hasher};
|
||||
use parity_codec::{Encode, Decode};
|
||||
use crate::{AuthorityId, GenesisConfig, Trait, Module, ConsensusLog};
|
||||
use substrate_finality_grandpa_primitives::GRANDPA_ENGINE_ID;
|
||||
@@ -52,7 +52,7 @@ impl system::Trait for Test {
|
||||
type Index = u64;
|
||||
type BlockNumber = u64;
|
||||
type Hash = H256;
|
||||
type Hashing = ::primitives::traits::BlakeTwo256;
|
||||
type Hashing = ::sr_primitives::traits::BlakeTwo256;
|
||||
type AccountId = u64;
|
||||
type Lookup = IdentityLookup<Self::AccountId>;
|
||||
type Header = Header;
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
|
||||
#![cfg(test)]
|
||||
|
||||
use primitives::testing::Digest;
|
||||
use primitives::traits::{Header, OnFinalize};
|
||||
use sr_primitives::testing::Digest;
|
||||
use sr_primitives::traits::{Header, OnFinalize};
|
||||
use runtime_io::with_externalities;
|
||||
use crate::mock::*;
|
||||
use system::{EventRecord, Phase};
|
||||
|
||||
@@ -6,20 +6,20 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
parity-codec = { version = "4.1.1", default-features = false, features = ["derive"] }
|
||||
primitives = { package = "sr-primitives", path = "../../core/sr-primitives", default-features = false }
|
||||
sr-primitives = { path = "../../core/sr-primitives", default-features = false }
|
||||
primitives = { package = "substrate-primitives", path = "../../core/primitives", default-features = false }
|
||||
rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false }
|
||||
serde = { version = "1.0", optional = true }
|
||||
session = { package = "srml-session", path = "../session", default-features = false }
|
||||
srml-support = { path = "../support", default-features = false }
|
||||
sr-io = { package = "sr-io", path = "../../core/sr-io", default-features = false }
|
||||
substrate_primitives = { package = "substrate-primitives", path = "../../core/primitives", default-features = false }
|
||||
system = { package = "srml-system", path = "../system", default-features = false }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
std = [
|
||||
"parity-codec/std",
|
||||
"primitives/std",
|
||||
"sr-primitives/std",
|
||||
"rstd/std",
|
||||
"serde",
|
||||
"session/std",
|
||||
|
||||
@@ -68,14 +68,14 @@
|
||||
// Ensure we're `no_std` when compiling for Wasm.
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
use substrate_primitives::{
|
||||
use primitives::{
|
||||
crypto::TypedKey, offchain::CryptoKey,
|
||||
offchain::OpaqueNetworkState,
|
||||
offchain::StorageKind,
|
||||
sr25519, ed25519,
|
||||
};
|
||||
use parity_codec::{Encode, Decode};
|
||||
use primitives::{
|
||||
use sr_primitives::{
|
||||
ApplyError, traits::{Member, IsMember, Extrinsic as ExtrinsicT},
|
||||
transaction_validity::{TransactionValidity, TransactionLongevity, ValidTransaction},
|
||||
};
|
||||
|
||||
@@ -11,10 +11,10 @@ parity-codec = { version = "4.1.1", default-features = false, features = ["deriv
|
||||
substrate-keyring = { path = "../../core/keyring", optional = true }
|
||||
rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false }
|
||||
runtime-io = { package = "sr-io", path = "../../core/sr-io", default-features = false }
|
||||
primitives = { package = "sr-primitives", path = "../../core/sr-primitives", default-features = false }
|
||||
sr-primitives = { path = "../../core/sr-primitives", default-features = false }
|
||||
primitives = { package = "substrate-primitives", path = "../../core/primitives", default-features = false }
|
||||
srml-support = { path = "../support", default-features = false }
|
||||
system = { package = "srml-system", path = "../system", default-features = false }
|
||||
substrate-primitives = { path = "../../core/primitives", default-features = false }
|
||||
|
||||
[dev-dependencies]
|
||||
ref_thread_local = "0.0"
|
||||
@@ -26,10 +26,10 @@ std = [
|
||||
"safe-mix/std",
|
||||
"substrate-keyring",
|
||||
"parity-codec/std",
|
||||
"substrate-primitives/std",
|
||||
"primitives/std",
|
||||
"rstd/std",
|
||||
"runtime-io/std",
|
||||
"srml-support/std",
|
||||
"primitives/std",
|
||||
"sr-primitives/std",
|
||||
"system/std",
|
||||
]
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
use rstd::{prelude::*, result, marker::PhantomData, convert::TryInto};
|
||||
use parity_codec::{Encode, Decode, Codec, Input, Output};
|
||||
use srml_support::{StorageValue, StorageMap, Parameter, decl_module, decl_event, decl_storage};
|
||||
use primitives::traits::{One, SimpleArithmetic, StaticLookup, Member};
|
||||
use sr_primitives::traits::{One, SimpleArithmetic, StaticLookup, Member};
|
||||
use system::{IsDeadAccount, OnNewAccount};
|
||||
|
||||
use self::address::Address as RawAddress;
|
||||
|
||||
@@ -20,9 +20,9 @@
|
||||
|
||||
use std::collections::HashSet;
|
||||
use ref_thread_local::{ref_thread_local, RefThreadLocal};
|
||||
use primitives::testing::Header;
|
||||
use primitives::Perbill;
|
||||
use substrate_primitives::{H256, Blake2Hasher};
|
||||
use sr_primitives::testing::Header;
|
||||
use sr_primitives::Perbill;
|
||||
use primitives::{H256, Blake2Hasher};
|
||||
use srml_support::{impl_outer_origin, parameter_types};
|
||||
use {runtime_io, system};
|
||||
use crate::{GenesisConfig, Module, Trait, IsDeadAccount, OnNewAccount, ResolveHint};
|
||||
@@ -76,7 +76,7 @@ impl system::Trait for Runtime {
|
||||
type Index = u64;
|
||||
type BlockNumber = u64;
|
||||
type Hash = H256;
|
||||
type Hashing = ::primitives::traits::BlakeTwo256;
|
||||
type Hashing = ::sr_primitives::traits::BlakeTwo256;
|
||||
type AccountId = u64;
|
||||
type Lookup = Indices;
|
||||
type Header = Header;
|
||||
|
||||
@@ -9,7 +9,7 @@ serde = { version = "1.0", optional = true }
|
||||
safe-mix = { version = "1.0", default-features = false}
|
||||
parity-codec = { version = "4.1.1", default-features = false, features = ["derive"] }
|
||||
rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false }
|
||||
primitives = { package = "sr-primitives", path = "../../core/sr-primitives", default-features = false }
|
||||
sr-primitives = { path = "../../core/sr-primitives", default-features = false }
|
||||
srml-support = { path = "../support", default-features = false }
|
||||
system = { package = "srml-system", path = "../system", default-features = false }
|
||||
timestamp = { package = "srml-timestamp", path = "../timestamp", default-features = false }
|
||||
@@ -17,7 +17,7 @@ substrate-trie = { path = "../../core/trie", default-features = false, optional
|
||||
runtime_io = { package = "sr-io", path = "../../core/sr-io", default-features = false }
|
||||
|
||||
[dev-dependencies]
|
||||
substrate-primitives = { path = "../../core/primitives" }
|
||||
primitives = { package = "substrate-primitives", path = "../../core/primitives" }
|
||||
lazy_static = "1.0"
|
||||
|
||||
[features]
|
||||
@@ -29,7 +29,7 @@ std = [
|
||||
"parity-codec/std",
|
||||
"rstd/std",
|
||||
"srml-support/std",
|
||||
"primitives/std",
|
||||
"sr-primitives/std",
|
||||
"timestamp/std",
|
||||
"substrate-trie/std"
|
||||
]
|
||||
|
||||
@@ -27,8 +27,8 @@
|
||||
|
||||
use rstd::prelude::*;
|
||||
use parity_codec::{Encode, Decode};
|
||||
use primitives::KeyTypeId;
|
||||
use primitives::traits::{Convert, OpaqueKeys, Hash as HashT};
|
||||
use sr_primitives::KeyTypeId;
|
||||
use sr_primitives::traits::{Convert, OpaqueKeys, Hash as HashT};
|
||||
use srml_support::{
|
||||
StorageValue, StorageMap, decl_module, decl_storage,
|
||||
};
|
||||
@@ -312,8 +312,8 @@ impl<T: Trait, D: AsRef<[u8]>> srml_support::traits::KeyOwnerProofSystem<(KeyTyp
|
||||
mod tests {
|
||||
use super::*;
|
||||
use runtime_io::with_externalities;
|
||||
use substrate_primitives::Blake2Hasher;
|
||||
use primitives::{
|
||||
use primitives::Blake2Hasher;
|
||||
use sr_primitives::{
|
||||
traits::OnInitialize,
|
||||
testing::{UintAuthorityId, UINT_DUMMY_KEY},
|
||||
};
|
||||
|
||||
@@ -121,9 +121,9 @@
|
||||
|
||||
use rstd::{prelude::*, marker::PhantomData, ops::{Sub, Rem}};
|
||||
use parity_codec::Decode;
|
||||
use primitives::KeyTypeId;
|
||||
use primitives::weights::SimpleDispatchInfo;
|
||||
use primitives::traits::{Convert, Zero, Member, OpaqueKeys, TypedKey};
|
||||
use sr_primitives::KeyTypeId;
|
||||
use sr_primitives::weights::SimpleDispatchInfo;
|
||||
use sr_primitives::traits::{Convert, Zero, Member, OpaqueKeys, TypedKey};
|
||||
use srml_support::{
|
||||
dispatch::Result, ConsensusEngineId, StorageValue, StorageDoubleMap, for_each_tuple,
|
||||
decl_module, decl_event, decl_storage,
|
||||
@@ -317,8 +317,8 @@ decl_storage! {
|
||||
add_extra_genesis {
|
||||
config(keys): Vec<(T::ValidatorId, T::Keys)>;
|
||||
build(|
|
||||
storage: &mut primitives::StorageOverlay,
|
||||
_: &mut primitives::ChildrenStorageOverlay,
|
||||
storage: &mut sr_primitives::StorageOverlay,
|
||||
_: &mut sr_primitives::ChildrenStorageOverlay,
|
||||
config: &GenesisConfig<T>
|
||||
| {
|
||||
runtime_io::with_storage(storage, || {
|
||||
@@ -562,8 +562,8 @@ mod tests {
|
||||
use super::*;
|
||||
use srml_support::assert_ok;
|
||||
use runtime_io::with_externalities;
|
||||
use substrate_primitives::Blake2Hasher;
|
||||
use primitives::{
|
||||
use primitives::Blake2Hasher;
|
||||
use sr_primitives::{
|
||||
traits::OnInitialize,
|
||||
testing::UintAuthorityId,
|
||||
};
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
use super::*;
|
||||
use std::cell::RefCell;
|
||||
use srml_support::{impl_outer_origin, parameter_types};
|
||||
use substrate_primitives::H256;
|
||||
use primitives::{
|
||||
use primitives::H256;
|
||||
use sr_primitives::{
|
||||
Perbill,
|
||||
traits::{BlakeTwo256, IdentityLookup, ConvertInto},
|
||||
testing::{Header, UintAuthorityId}
|
||||
@@ -159,7 +159,7 @@ impl Trait for Test {
|
||||
#[cfg(feature = "historical")]
|
||||
impl crate::historical::Trait for Test {
|
||||
type FullIdentification = u64;
|
||||
type FullIdentificationOf = primitives::traits::ConvertInto;
|
||||
type FullIdentificationOf = sr_primitives::traits::ConvertInto;
|
||||
}
|
||||
|
||||
pub type System = system::Module<Test>;
|
||||
|
||||
@@ -11,14 +11,14 @@ parity-codec = { version = "4.1.1", default-features = false, features = ["deriv
|
||||
substrate-keyring = { path = "../../core/keyring", optional = true }
|
||||
rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false }
|
||||
runtime_io = { package = "sr-io", path = "../../core/sr-io", default-features = false }
|
||||
primitives = { package = "sr-primitives", path = "../../core/sr-primitives", default-features = false }
|
||||
sr-primitives = { path = "../../core/sr-primitives", default-features = false }
|
||||
srml-support = { path = "../support", default-features = false }
|
||||
system = { package = "srml-system", path = "../system", default-features = false }
|
||||
session = { package = "srml-session", path = "../session", default-features = false, features = ["historical"] }
|
||||
authorship = { package = "srml-authorship", path = "../authorship", default-features = false }
|
||||
|
||||
[dev-dependencies]
|
||||
substrate-primitives = { path = "../../core/primitives" }
|
||||
primitives = { package = "substrate-primitives", path = "../../core/primitives" }
|
||||
balances = { package = "srml-balances", path = "../balances" }
|
||||
timestamp = { package = "srml-timestamp", path = "../timestamp" }
|
||||
rand = "0.6.5"
|
||||
@@ -35,7 +35,7 @@ std = [
|
||||
"rstd/std",
|
||||
"runtime_io/std",
|
||||
"srml-support/std",
|
||||
"primitives/std",
|
||||
"sr-primitives/std",
|
||||
"session/std",
|
||||
"system/std",
|
||||
"authorship/std",
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
//! http://research.web3.foundation/en/latest/polkadot/Token%20Economics/#inflation-model
|
||||
|
||||
use primitives::{Perbill, traits::SimpleArithmetic};
|
||||
use sr_primitives::{Perbill, traits::SimpleArithmetic};
|
||||
|
||||
/// Linear function truncated to positive part `y = max(0, b [+ or -] a*x)` for PNPoS usage
|
||||
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
|
||||
|
||||
@@ -293,14 +293,14 @@ use srml_support::{
|
||||
}
|
||||
};
|
||||
use session::{historical::OnSessionEnding, SelectInitialValidators, SessionIndex};
|
||||
use primitives::Perbill;
|
||||
use primitives::weights::SimpleDispatchInfo;
|
||||
use primitives::traits::{
|
||||
use sr_primitives::Perbill;
|
||||
use sr_primitives::weights::SimpleDispatchInfo;
|
||||
use sr_primitives::traits::{
|
||||
Convert, Zero, One, StaticLookup, CheckedSub, CheckedShl, Saturating, Bounded,
|
||||
SaturatedConversion, SimpleArithmetic
|
||||
};
|
||||
#[cfg(feature = "std")]
|
||||
use primitives::{Serialize, Deserialize};
|
||||
use sr_primitives::{Serialize, Deserialize};
|
||||
use system::{ensure_signed, ensure_root};
|
||||
|
||||
use phragmen::{elect, ACCURACY, ExtendedBalance, equalize};
|
||||
@@ -621,8 +621,8 @@ decl_storage! {
|
||||
config(stakers):
|
||||
Vec<(T::AccountId, T::AccountId, BalanceOf<T>, StakerStatus<T::AccountId>)>;
|
||||
build(|
|
||||
storage: &mut primitives::StorageOverlay,
|
||||
_: &mut primitives::ChildrenStorageOverlay,
|
||||
storage: &mut sr_primitives::StorageOverlay,
|
||||
_: &mut sr_primitives::ChildrenStorageOverlay,
|
||||
config: &GenesisConfig<T>
|
||||
| {
|
||||
with_storage(storage, || {
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
//! Test utilities
|
||||
|
||||
use std::{collections::HashSet, cell::RefCell};
|
||||
use primitives::Perbill;
|
||||
use primitives::traits::{IdentityLookup, Convert, OpaqueKeys, OnInitialize};
|
||||
use primitives::testing::{Header, UintAuthorityId};
|
||||
use substrate_primitives::{H256, Blake2Hasher};
|
||||
use sr_primitives::Perbill;
|
||||
use sr_primitives::traits::{IdentityLookup, Convert, OpaqueKeys, OnInitialize};
|
||||
use sr_primitives::testing::{Header, UintAuthorityId};
|
||||
use primitives::{H256, Blake2Hasher};
|
||||
use runtime_io;
|
||||
use srml_support::{assert_ok, impl_outer_origin, parameter_types, EnumerableStorageMap};
|
||||
use srml_support::traits::{Currency, Get, FindAuthor};
|
||||
@@ -111,7 +111,7 @@ impl system::Trait for Test {
|
||||
type Index = u64;
|
||||
type BlockNumber = BlockNumber;
|
||||
type Hash = H256;
|
||||
type Hashing = ::primitives::traits::BlakeTwo256;
|
||||
type Hashing = ::sr_primitives::traits::BlakeTwo256;
|
||||
type AccountId = AccountId;
|
||||
type Lookup = IdentityLookup<Self::AccountId>;
|
||||
type Header = Header;
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
//! Rust implementation of the Phragmén election algorithm.
|
||||
|
||||
use rstd::{prelude::*, collections::btree_map::BTreeMap};
|
||||
use primitives::{PerU128};
|
||||
use primitives::traits::{Zero, Convert, Saturating};
|
||||
use sr_primitives::{PerU128};
|
||||
use sr_primitives::traits::{Zero, Convert, Saturating};
|
||||
use crate::{BalanceOf, RawAssignment, ExpoMap, Trait, ValidatorPrefs, IndividualExposure};
|
||||
|
||||
type Fraction = PerU128;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
use super::*;
|
||||
use runtime_io::with_externalities;
|
||||
use phragmen;
|
||||
use primitives::traits::OnInitialize;
|
||||
use sr_primitives::traits::OnInitialize;
|
||||
use srml_support::{assert_ok, assert_noop, assert_eq_uvec, EnumerableStorageMap};
|
||||
use mock::*;
|
||||
use srml_support::traits::{Currency, ReservableCurrency};
|
||||
|
||||
@@ -16,7 +16,7 @@ system = { package = "srml-system", path = "../system", default-features = false
|
||||
|
||||
[dev-dependencies]
|
||||
sr-io = { path = "../../core/sr-io", default-features = false }
|
||||
substrate-primitives = { path = "../../core/primitives" }
|
||||
primitives = { package = "substrate-primitives", path = "../../core/primitives" }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
|
||||
@@ -11,7 +11,7 @@ srml-metadata = { path = "../metadata", default-features = false }
|
||||
sr-std = { path = "../../core/sr-std", default-features = false }
|
||||
runtime_io = { package = "sr-io", path = "../../core/sr-io", default-features = false }
|
||||
sr-primitives = { path = "../../core/sr-primitives", default-features = false }
|
||||
substrate-primitives = { path = "../../core/primitives", default-features = false }
|
||||
primitives = { package = "substrate-primitives", path = "../../core/primitives", default-features = false }
|
||||
inherents = { package = "substrate-inherents", path = "../../core/inherents", default-features = false }
|
||||
srml-support-procedural = { path = "./procedural" }
|
||||
paste = "0.1"
|
||||
|
||||
@@ -531,8 +531,8 @@ fn decl_store_extra_genesis(
|
||||
impl#fparam_impl GenesisConfig#sparam #genesis_where_clause {
|
||||
pub fn build_storage #fn_generic (self) -> std::result::Result<
|
||||
(
|
||||
#scrate::runtime_primitives::StorageOverlay,
|
||||
#scrate::runtime_primitives::ChildrenStorageOverlay,
|
||||
#scrate::sr_primitives::StorageOverlay,
|
||||
#scrate::sr_primitives::ChildrenStorageOverlay,
|
||||
),
|
||||
String
|
||||
> #fn_where_clause {
|
||||
@@ -545,8 +545,8 @@ fn decl_store_extra_genesis(
|
||||
/// Assimilate the storage for this module into pre-existing overlays.
|
||||
pub fn assimilate_storage #fn_generic (
|
||||
self,
|
||||
r: &mut #scrate::runtime_primitives::StorageOverlay,
|
||||
c: &mut #scrate::runtime_primitives::ChildrenStorageOverlay,
|
||||
r: &mut #scrate::sr_primitives::StorageOverlay,
|
||||
c: &mut #scrate::sr_primitives::ChildrenStorageOverlay,
|
||||
) -> std::result::Result<(), String> #fn_where_clause {
|
||||
let storage = r;
|
||||
|
||||
@@ -559,13 +559,13 @@ fn decl_store_extra_genesis(
|
||||
}
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
impl#build_storage_impl #scrate::runtime_primitives::#impl_trait
|
||||
impl#build_storage_impl #scrate::sr_primitives::#impl_trait
|
||||
for GenesisConfig#sparam #build_storage_where_clause
|
||||
{
|
||||
fn build_module_genesis_storage(
|
||||
self,
|
||||
r: &mut #scrate::runtime_primitives::StorageOverlay,
|
||||
c: &mut #scrate::runtime_primitives::ChildrenStorageOverlay,
|
||||
r: &mut #scrate::sr_primitives::StorageOverlay,
|
||||
c: &mut #scrate::sr_primitives::ChildrenStorageOverlay,
|
||||
) -> std::result::Result<(), String> {
|
||||
self.assimilate_storage::<#fn_traitinstance> (r, c)
|
||||
}
|
||||
|
||||
@@ -749,7 +749,7 @@ macro_rules! decl_module {
|
||||
fn on_initialize() { $( $impl:tt )* }
|
||||
) => {
|
||||
impl<$trait_instance: $trait_name$(<I>, $instance: $instantiable)?>
|
||||
$crate::runtime_primitives::traits::OnInitialize<$trait_instance::BlockNumber>
|
||||
$crate::sr_primitives::traits::OnInitialize<$trait_instance::BlockNumber>
|
||||
for $module<$trait_instance$(, $instance)?> where $( $other_where_bounds )*
|
||||
{
|
||||
fn on_initialize(_block_number_not_used: $trait_instance::BlockNumber) { $( $impl )* }
|
||||
@@ -762,7 +762,7 @@ macro_rules! decl_module {
|
||||
fn on_initialize($param:ident : $param_ty:ty) { $( $impl:tt )* }
|
||||
) => {
|
||||
impl<$trait_instance: $trait_name$(<I>, $instance: $instantiable)?>
|
||||
$crate::runtime_primitives::traits::OnInitialize<$trait_instance::BlockNumber>
|
||||
$crate::sr_primitives::traits::OnInitialize<$trait_instance::BlockNumber>
|
||||
for $module<$trait_instance$(, $instance)?> where $( $other_where_bounds )*
|
||||
{
|
||||
fn on_initialize($param: $param_ty) { $( $impl )* }
|
||||
@@ -774,7 +774,7 @@ macro_rules! decl_module {
|
||||
{ $( $other_where_bounds:tt )* }
|
||||
) => {
|
||||
impl<$trait_instance: $trait_name$(<I>, $instance: $instantiable)?>
|
||||
$crate::runtime_primitives::traits::OnInitialize<$trait_instance::BlockNumber>
|
||||
$crate::sr_primitives::traits::OnInitialize<$trait_instance::BlockNumber>
|
||||
for $module<$trait_instance$(, $instance)?> where $( $other_where_bounds )*
|
||||
{}
|
||||
};
|
||||
@@ -785,7 +785,7 @@ macro_rules! decl_module {
|
||||
fn on_finalize() { $( $impl:tt )* }
|
||||
) => {
|
||||
impl<$trait_instance: $trait_name$(<I>, $instance: $instantiable)?>
|
||||
$crate::runtime_primitives::traits::OnFinalize<$trait_instance::BlockNumber>
|
||||
$crate::sr_primitives::traits::OnFinalize<$trait_instance::BlockNumber>
|
||||
for $module<$trait_instance$(, $instance)?> where $( $other_where_bounds )*
|
||||
{
|
||||
fn on_finalize(_block_number_not_used: $trait_instance::BlockNumber) { $( $impl )* }
|
||||
@@ -798,7 +798,7 @@ macro_rules! decl_module {
|
||||
fn on_finalize($param:ident : $param_ty:ty) { $( $impl:tt )* }
|
||||
) => {
|
||||
impl<$trait_instance: $trait_name$(<I>, $instance: $instantiable)?>
|
||||
$crate::runtime_primitives::traits::OnFinalize<$trait_instance::BlockNumber>
|
||||
$crate::sr_primitives::traits::OnFinalize<$trait_instance::BlockNumber>
|
||||
for $module<$trait_instance$(, $instance)?> where $( $other_where_bounds )*
|
||||
{
|
||||
fn on_finalize($param: $param_ty) { $( $impl )* }
|
||||
@@ -810,7 +810,7 @@ macro_rules! decl_module {
|
||||
{ $( $other_where_bounds:tt )* }
|
||||
) => {
|
||||
impl<$trait_instance: $trait_name$(<I>, $instance: $instantiable)?>
|
||||
$crate::runtime_primitives::traits::OnFinalize<$trait_instance::BlockNumber>
|
||||
$crate::sr_primitives::traits::OnFinalize<$trait_instance::BlockNumber>
|
||||
for $module<$trait_instance$(, $instance)?> where $( $other_where_bounds )*
|
||||
{
|
||||
}
|
||||
@@ -822,7 +822,7 @@ macro_rules! decl_module {
|
||||
fn offchain_worker() { $( $impl:tt )* }
|
||||
) => {
|
||||
impl<$trait_instance: $trait_name$(<I>, $instance: $instantiable)?>
|
||||
$crate::runtime_primitives::traits::OffchainWorker<$trait_instance::BlockNumber>
|
||||
$crate::sr_primitives::traits::OffchainWorker<$trait_instance::BlockNumber>
|
||||
for $module<$trait_instance$(, $instance)?> where $( $other_where_bounds )*
|
||||
{
|
||||
fn generate_extrinsics(_block_number_not_used: $trait_instance::BlockNumber) { $( $impl )* }
|
||||
@@ -835,7 +835,7 @@ macro_rules! decl_module {
|
||||
fn offchain_worker($param:ident : $param_ty:ty) { $( $impl:tt )* }
|
||||
) => {
|
||||
impl<$trait_instance: $trait_name$(<I>, $instance: $instantiable)?>
|
||||
$crate::runtime_primitives::traits::OffchainWorker<$trait_instance::BlockNumber>
|
||||
$crate::sr_primitives::traits::OffchainWorker<$trait_instance::BlockNumber>
|
||||
for $module<$trait_instance$(, $instance)?> where $( $other_where_bounds )*
|
||||
{
|
||||
fn generate_extrinsics($param: $param_ty) { $( $impl )* }
|
||||
@@ -847,7 +847,7 @@ macro_rules! decl_module {
|
||||
{ $( $other_where_bounds:tt )* }
|
||||
) => {
|
||||
impl<$trait_instance: $trait_name$(<I>, $instance: $instantiable)?>
|
||||
$crate::runtime_primitives::traits::OffchainWorker<$trait_instance::BlockNumber>
|
||||
$crate::sr_primitives::traits::OffchainWorker<$trait_instance::BlockNumber>
|
||||
for $module<$trait_instance$(, $instance)?> where $( $other_where_bounds )*
|
||||
{}
|
||||
};
|
||||
@@ -1595,7 +1595,7 @@ macro_rules! __check_reserved_fn_name {
|
||||
#[allow(dead_code)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::runtime_primitives::traits::{OnInitialize, OnFinalize};
|
||||
use crate::sr_primitives::traits::{OnInitialize, OnFinalize};
|
||||
use sr_primitives::weights::{DispatchInfo, DispatchClass};
|
||||
|
||||
pub trait Trait: system::Trait + Sized where Self::AccountId: From<u32> {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#[doc(hidden)]
|
||||
pub use crate::rstd::vec::Vec;
|
||||
#[doc(hidden)]
|
||||
pub use crate::runtime_primitives::traits::{Block as BlockT, Extrinsic};
|
||||
pub use crate::sr_primitives::traits::{Block as BlockT, Extrinsic};
|
||||
#[doc(hidden)]
|
||||
pub use inherents::{InherentData, ProvideInherent, CheckInherentsResult, IsFatalError};
|
||||
|
||||
|
||||
@@ -35,7 +35,6 @@ pub use codec;
|
||||
pub use once_cell;
|
||||
#[doc(hidden)]
|
||||
pub use paste;
|
||||
pub use sr_primitives as runtime_primitives;
|
||||
|
||||
pub use self::storage::hashed::generator::{
|
||||
HashedStorage, Twox256, Twox128, Blake2_256, Blake2_128, Twox64Concat
|
||||
@@ -69,7 +68,7 @@ pub use self::hashable::Hashable;
|
||||
pub use self::dispatch::{Parameter, Dispatchable, Callable, IsSubType};
|
||||
pub use self::double_map::StorageDoubleMapWithHasher;
|
||||
pub use runtime_io::{print, storage_root};
|
||||
pub use runtime_primitives::ConsensusEngineId;
|
||||
pub use sr_primitives::{self, ConsensusEngineId};
|
||||
|
||||
/// Macro for easily creating a new implementation of the `Get` trait. Use similarly to
|
||||
/// how you would declare a `const`:
|
||||
|
||||
@@ -194,10 +194,10 @@ macro_rules! construct_runtime {
|
||||
#[derive(Clone, Copy, PartialEq, Eq)]
|
||||
#[cfg_attr(feature = "std", derive(Debug))]
|
||||
pub struct $runtime;
|
||||
impl $crate::runtime_primitives::traits::GetNodeBlockType for $runtime {
|
||||
impl $crate::sr_primitives::traits::GetNodeBlockType for $runtime {
|
||||
type NodeBlock = $node_block;
|
||||
}
|
||||
impl $crate::runtime_primitives::traits::GetRuntimeBlockType for $runtime {
|
||||
impl $crate::sr_primitives::traits::GetRuntimeBlockType for $runtime {
|
||||
type RuntimeBlock = $block;
|
||||
}
|
||||
$crate::__decl_outer_event!(
|
||||
@@ -698,7 +698,7 @@ macro_rules! __decl_outer_config {
|
||||
};
|
||||
) => {
|
||||
$crate::paste::item! {
|
||||
$crate::runtime_primitives::impl_outer_config!(
|
||||
$crate::sr_primitives::impl_outer_config!(
|
||||
pub struct GenesisConfig for $runtime {
|
||||
$(
|
||||
[< $parsed_name Config >] =>
|
||||
|
||||
@@ -20,9 +20,9 @@
|
||||
|
||||
use crate::rstd::{result, marker::PhantomData, ops::Div};
|
||||
use crate::codec::{Codec, Encode, Decode};
|
||||
use substrate_primitives::u32_trait::Value as U32;
|
||||
use crate::runtime_primitives::traits::{MaybeSerializeDebug, SimpleArithmetic, Saturating};
|
||||
use crate::runtime_primitives::ConsensusEngineId;
|
||||
use primitives::u32_trait::Value as U32;
|
||||
use crate::sr_primitives::traits::{MaybeSerializeDebug, SimpleArithmetic, Saturating};
|
||||
use crate::sr_primitives::ConsensusEngineId;
|
||||
|
||||
use super::for_each_tuple;
|
||||
|
||||
|
||||
@@ -15,11 +15,11 @@
|
||||
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#[doc(hidden)]
|
||||
pub use crate::runtime_primitives::traits::ValidateUnsigned;
|
||||
pub use crate::sr_primitives::traits::ValidateUnsigned;
|
||||
#[doc(hidden)]
|
||||
pub use crate::runtime_primitives::transaction_validity::TransactionValidity;
|
||||
pub use crate::sr_primitives::transaction_validity::TransactionValidity;
|
||||
#[doc(hidden)]
|
||||
pub use crate::runtime_primitives::ApplyError;
|
||||
pub use crate::sr_primitives::ApplyError;
|
||||
|
||||
|
||||
/// Implement `ValidateUnsigned` for `Runtime`.
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
use runtime_io::{with_externalities, Blake2Hasher};
|
||||
use srml_support::{
|
||||
Parameter, traits::Get, parameter_types,
|
||||
runtime_primitives::{generic, BuildStorage, traits::{BlakeTwo256, Block as _, Verify}},
|
||||
sr_primitives::{generic, BuildStorage, traits::{BlakeTwo256, Block as _, Verify}},
|
||||
metadata::{
|
||||
DecodeDifferent, StorageMetadata, StorageEntryModifier, StorageEntryType, DefaultByteGetter,
|
||||
StorageEntryMetadata, StorageHasher
|
||||
@@ -504,4 +504,4 @@ fn instance_prefix_is_prefix_of_entries() {
|
||||
assert!(module2::Instance2::PREFIX_FOR_Map.starts_with(prefix));
|
||||
assert!(module2::Instance2::PREFIX_FOR_LinkedMap.starts_with(prefix));
|
||||
assert!(module2::Instance2::PREFIX_FOR_DoubleMap.starts_with(prefix));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use srml_support::runtime_primitives::generic;
|
||||
use srml_support::runtime_primitives::traits::{BlakeTwo256, Block as _, Verify};
|
||||
use srml_support::sr_primitives::generic;
|
||||
use srml_support::sr_primitives::traits::{BlakeTwo256, Block as _, Verify};
|
||||
use srml_support::codec::{Encode, Decode};
|
||||
use primitives::{H256, sr25519};
|
||||
use serde::{Serialize, Deserialize};
|
||||
|
||||
@@ -8,10 +8,10 @@ edition = "2018"
|
||||
serde = { version = "1.0", optional = true, features = ["derive"] }
|
||||
safe-mix = { version = "1.0", default-features = false}
|
||||
parity-codec = { version = "4.1.1", default-features = false, features = ["derive"] }
|
||||
substrate-primitives = { path = "../../core/primitives", default-features = false }
|
||||
primitives = { package = "substrate-primitives", path = "../../core/primitives", default-features = false }
|
||||
rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false }
|
||||
runtime_io = { package = "sr-io", path = "../../core/sr-io", default-features = false }
|
||||
primitives = { package = "sr-primitives", path = "../../core/sr-primitives", default-features = false }
|
||||
sr-primitives = { path = "../../core/sr-primitives", default-features = false }
|
||||
srml-support = { path = "../support", default-features = false }
|
||||
|
||||
[dev-dependencies]
|
||||
@@ -23,11 +23,11 @@ std = [
|
||||
"serde",
|
||||
"safe-mix/std",
|
||||
"parity-codec/std",
|
||||
"substrate-primitives/std",
|
||||
"primitives/std",
|
||||
"rstd/std",
|
||||
"runtime_io/std",
|
||||
"srml-support/std",
|
||||
"primitives/std",
|
||||
"sr-primitives/std",
|
||||
]
|
||||
|
||||
[[bench]]
|
||||
|
||||
@@ -18,8 +18,8 @@ use criterion::{Criterion, criterion_group, criterion_main, black_box};
|
||||
use srml_system as system;
|
||||
use srml_support::{decl_module, decl_event, impl_outer_origin, impl_outer_event};
|
||||
use runtime_io::{with_externalities, Blake2Hasher};
|
||||
use substrate_primitives::H256;
|
||||
use primitives::{Perbill, traits::{BlakeTwo256, IdentityLookup}, testing::Header};
|
||||
use primitives::H256;
|
||||
use sr_primitives::{Perbill, traits::{BlakeTwo256, IdentityLookup}, testing::Header};
|
||||
|
||||
mod module {
|
||||
use super::*;
|
||||
|
||||
@@ -77,16 +77,16 @@ use rstd::prelude::*;
|
||||
#[cfg(any(feature = "std", test))]
|
||||
use rstd::map;
|
||||
use rstd::marker::PhantomData;
|
||||
use primitives::generic::{self, Era};
|
||||
use primitives::Perbill;
|
||||
use primitives::weights::{Weight, DispatchInfo, DispatchClass, WeightMultiplier, SimpleDispatchInfo};
|
||||
use primitives::transaction_validity::{ValidTransaction, TransactionPriority, TransactionLongevity};
|
||||
use primitives::traits::{self, CheckEqual, SimpleArithmetic, Zero, SignedExtension, Convert,
|
||||
use sr_primitives::generic::{self, Era};
|
||||
use sr_primitives::Perbill;
|
||||
use sr_primitives::weights::{Weight, DispatchInfo, DispatchClass, WeightMultiplier, SimpleDispatchInfo};
|
||||
use sr_primitives::transaction_validity::{ValidTransaction, TransactionPriority, TransactionLongevity};
|
||||
use sr_primitives::traits::{self, CheckEqual, SimpleArithmetic, Zero, SignedExtension, Convert,
|
||||
SimpleBitOps, Hash, Member, MaybeDisplay, EnsureOrigin, CurrentHeight, BlockNumberToHash,
|
||||
MaybeSerializeDebugButNotDeserialize, MaybeSerializeDebug, StaticLookup, One, Bounded,
|
||||
Lookup, DispatchError, SaturatedConversion,
|
||||
};
|
||||
use substrate_primitives::storage::well_known_keys;
|
||||
use primitives::storage::well_known_keys;
|
||||
use srml_support::{
|
||||
storage, decl_module, decl_event, decl_storage, StorageDoubleMap, StorageValue, StorageMap,
|
||||
Parameter, for_each_tuple, traits::{Contains, Get}
|
||||
@@ -98,7 +98,7 @@ use parity_codec::{Encode, Decode};
|
||||
use runtime_io::{twox_128, TestExternalities, Blake2Hasher};
|
||||
|
||||
#[cfg(any(feature = "std", test))]
|
||||
use substrate_primitives::ChangesTrieConfiguration;
|
||||
use primitives::ChangesTrieConfiguration;
|
||||
|
||||
/// Handler for when a new account has been created.
|
||||
pub trait OnNewAccount<AccountId> {
|
||||
@@ -401,10 +401,14 @@ decl_storage! {
|
||||
}
|
||||
add_extra_genesis {
|
||||
config(changes_trie_config): Option<ChangesTrieConfiguration>;
|
||||
#[serde(with = "substrate_primitives::bytes")]
|
||||
#[serde(with = "primitives::bytes")]
|
||||
config(code): Vec<u8>;
|
||||
|
||||
build(|storage: &mut primitives::StorageOverlay, _: &mut primitives::ChildrenStorageOverlay, config: &GenesisConfig| {
|
||||
build(
|
||||
|storage: &mut sr_primitives::StorageOverlay,
|
||||
_: &mut sr_primitives::ChildrenStorageOverlay,
|
||||
config: &GenesisConfig|
|
||||
{
|
||||
use parity_codec::Encode;
|
||||
|
||||
storage.insert(well_known_keys::CODE.to_vec(), config.code.clone());
|
||||
@@ -1042,8 +1046,8 @@ impl<T: Trait> BlockNumberToHash for ChainContext<T> {
|
||||
mod tests {
|
||||
use super::*;
|
||||
use runtime_io::with_externalities;
|
||||
use substrate_primitives::H256;
|
||||
use primitives::{traits::{BlakeTwo256, IdentityLookup}, testing::Header};
|
||||
use primitives::H256;
|
||||
use sr_primitives::{traits::{BlakeTwo256, IdentityLookup}, testing::Header};
|
||||
use srml_support::{impl_outer_origin, parameter_types};
|
||||
|
||||
impl_outer_origin!{
|
||||
|
||||
@@ -8,14 +8,14 @@ edition = "2018"
|
||||
serde = { version = "1.0", optional = true }
|
||||
parity-codec = { version = "4.1.1", default-features = false, features = ["derive"] }
|
||||
rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false }
|
||||
runtime_primitives = { package = "sr-primitives", path = "../../core/sr-primitives", default-features = false }
|
||||
sr-primitives = { path = "../../core/sr-primitives", default-features = false }
|
||||
inherents = { package = "substrate-inherents", path = "../../core/inherents", default-features = false }
|
||||
srml-support = { path = "../support", default-features = false }
|
||||
system = { package = "srml-system", path = "../system", default-features = false }
|
||||
|
||||
[dev-dependencies]
|
||||
runtime_io = { package = "sr-io", path = "../../core/sr-io" }
|
||||
substrate-primitives = { path = "../../core/primitives" }
|
||||
primitives = { package = "substrate-primitives", path = "../../core/primitives" }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
@@ -23,7 +23,7 @@ std = [
|
||||
"inherents/std",
|
||||
"parity-codec/std",
|
||||
"rstd/std",
|
||||
"runtime_primitives/std",
|
||||
"sr-primitives/std",
|
||||
"srml-support/std",
|
||||
"serde",
|
||||
"system/std",
|
||||
|
||||
@@ -98,8 +98,8 @@ use parity_codec::Decode;
|
||||
use inherents::ProvideInherentData;
|
||||
use srml_support::{StorageValue, Parameter, decl_storage, decl_module, for_each_tuple};
|
||||
use srml_support::traits::{Time, Get};
|
||||
use runtime_primitives::traits::{SimpleArithmetic, Zero, SaturatedConversion};
|
||||
use runtime_primitives::weights::SimpleDispatchInfo;
|
||||
use sr_primitives::traits::{SimpleArithmetic, Zero, SaturatedConversion};
|
||||
use sr_primitives::weights::SimpleDispatchInfo;
|
||||
use system::ensure_none;
|
||||
use inherents::{RuntimeString, InherentIdentifier, ProvideInherent, IsFatalError, InherentData};
|
||||
|
||||
@@ -339,8 +339,8 @@ mod tests {
|
||||
|
||||
use srml_support::{impl_outer_origin, assert_ok, parameter_types};
|
||||
use runtime_io::{with_externalities, TestExternalities};
|
||||
use substrate_primitives::H256;
|
||||
use runtime_primitives::{Perbill, traits::{BlakeTwo256, IdentityLookup}, testing::Header};
|
||||
use primitives::H256;
|
||||
use sr_primitives::{Perbill, traits::{BlakeTwo256, IdentityLookup}, testing::Header};
|
||||
|
||||
impl_outer_origin! {
|
||||
pub enum Origin for Test {}
|
||||
|
||||
@@ -8,14 +8,14 @@ edition = "2018"
|
||||
serde = { version = "1.0", optional = true, features = ["derive"] }
|
||||
parity-codec = { version = "4.1.1", default-features = false, features = ["derive"] }
|
||||
rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false }
|
||||
runtime_primitives = { package = "sr-primitives", path = "../../core/sr-primitives", default-features = false }
|
||||
sr-primitives = { path = "../../core/sr-primitives", default-features = false }
|
||||
srml-support = { path = "../support", default-features = false }
|
||||
system = { package = "srml-system", path = "../system", default-features = false }
|
||||
balances = { package = "srml-balances", path = "../balances", default-features = false }
|
||||
|
||||
[dev-dependencies]
|
||||
runtime_io = { package = "sr-io", path = "../../core/sr-io" }
|
||||
substrate-primitives = { path = "../../core/primitives" }
|
||||
primitives = { package = "substrate-primitives", path = "../../core/primitives" }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
@@ -23,7 +23,7 @@ std = [
|
||||
"serde",
|
||||
"parity-codec/std",
|
||||
"rstd/std",
|
||||
"runtime_primitives/std",
|
||||
"sr-primitives/std",
|
||||
"srml-support/std",
|
||||
"system/std",
|
||||
"balances/std",
|
||||
|
||||
@@ -75,11 +75,11 @@ use srml_support::traits::{
|
||||
Currency, ExistenceRequirement, Get, Imbalance, OnDilution, OnUnbalanced,
|
||||
ReservableCurrency, WithdrawReason
|
||||
};
|
||||
use runtime_primitives::{Permill, ModuleId};
|
||||
use runtime_primitives::traits::{
|
||||
use sr_primitives::{Permill, ModuleId};
|
||||
use sr_primitives::traits::{
|
||||
Zero, EnsureOrigin, StaticLookup, CheckedSub, CheckedMul, AccountIdConversion
|
||||
};
|
||||
use runtime_primitives::weights::SimpleDispatchInfo;
|
||||
use sr_primitives::weights::SimpleDispatchInfo;
|
||||
use parity_codec::{Encode, Decode};
|
||||
use system::ensure_signed;
|
||||
|
||||
@@ -363,8 +363,8 @@ mod tests {
|
||||
|
||||
use runtime_io::with_externalities;
|
||||
use srml_support::{assert_noop, assert_ok, impl_outer_origin, parameter_types};
|
||||
use substrate_primitives::{H256, Blake2Hasher};
|
||||
use runtime_primitives::{Perbill, traits::{BlakeTwo256, OnFinalize, IdentityLookup}, testing::Header};
|
||||
use primitives::{H256, Blake2Hasher};
|
||||
use sr_primitives::{Perbill, traits::{BlakeTwo256, OnFinalize, IdentityLookup}, testing::Header};
|
||||
|
||||
impl_outer_origin! {
|
||||
pub enum Origin for Test {}
|
||||
|
||||
Reference in New Issue
Block a user