mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 21:41:12 +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
@@ -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>;
|
||||
|
||||
Reference in New Issue
Block a user