Refactor primitives.

This commit is contained in:
Gav
2018-02-07 11:03:43 +01:00
parent 959b129f8d
commit 1b7f34bef2
39 changed files with 99 additions and 108 deletions
@@ -18,7 +18,7 @@
use runtime_std::prelude::*;
use support::storage::unhashed::StorageVec;
use primitives::SessionKey;
use primitives::relay::SessionKey;
struct AuthorityStorageVec {}
impl StorageVec for AuthorityStorageVec {
@@ -20,8 +20,7 @@ use std::collections::HashMap;
use runtime_std::twox_128;
use codec::{KeyedVec, Joiner};
use support::Hashable;
use primitives::relay::{Number as BlockNumber, Block};
use primitives::AccountId;
use primitives::relay::{Number as BlockNumber, Block, AccountId};
use runtime::staking::Balance;
/// Configuration of a general Polkadot genesis block.
@@ -28,8 +28,7 @@
use runtime_std::prelude::*;
use codec::KeyedVec;
use support::storage;
use primitives::{AccountId, Hash, BlockNumber};
use primitives::relay::Proposal;
use primitives::relay::{Proposal, AccountId, Hash, BlockNumber};
use runtime::{staking, system, session};
const APPROVALS_REQUIRED: &[u8] = b"gov:apr";
@@ -149,8 +148,7 @@ mod tests {
use runtime_std::{with_externalities, twox_128, TestExternalities};
use codec::{KeyedVec, Joiner};
use support::{one, two, with_env};
use primitives::AccountId;
use primitives::relay::InternalFunction;
use primitives::relay::{AccountId, InternalFunction};
use runtime::{staking, session};
fn new_test_ext() -> TestExternalities {
@@ -20,7 +20,7 @@
use runtime_std::prelude::*;
use codec::KeyedVec;
use support::{storage, StorageVec};
use primitives::{AccountId, SessionKey, BlockNumber};
use primitives::relay::{AccountId, SessionKey, BlockNumber};
use runtime::{system, staking, consensus};
const SESSION_LENGTH: &[u8] = b"ses:len";
@@ -140,7 +140,7 @@ mod tests {
use runtime_std::{with_externalities, twox_128, TestExternalities};
use codec::{KeyedVec, Joiner};
use support::{one, two, with_env};
use primitives::AccountId;
use primitives::relay::AccountId;
use runtime::{consensus, session};
fn simple_setup() -> TestExternalities {
@@ -21,7 +21,7 @@ use runtime_std::cell::RefCell;
use runtime_std::print;
use codec::KeyedVec;
use support::{storage, StorageVec};
use primitives::{BlockNumber, AccountId};
use primitives::relay::{BlockNumber, AccountId};
use runtime::{system, session, governance};
/// The balance of an account.
@@ -216,7 +216,7 @@ mod tests {
use runtime_std::{with_externalities, twox_128, TestExternalities};
use codec::{KeyedVec, Joiner};
use support::{one, two, with_env};
use primitives::AccountId;
use primitives::relay::AccountId;
use runtime::{staking, session};
#[test]
@@ -21,8 +21,8 @@ use runtime_std::prelude::*;
use runtime_std::{mem, storage_root, enumerated_trie_root};
use codec::{KeyedVec, Slicable};
use support::{Hashable, storage, with_env};
use primitives::{AccountId, Hash, TxOrder, BlockNumber};
use primitives::relay::{Block, Header, UncheckedTransaction, Function, Log};
use primitives::relay::{AccountId, Hash, TxOrder, BlockNumber, Block, Header, UncheckedTransaction,
Function, Log};
use runtime::{staking, session};
const NONCE_OF: &[u8] = b"sys:non:";
@@ -17,7 +17,8 @@
//! Timestamp manager: just handles the current timestamp.
use support::storage;
use primitives::Timestamp;
pub type Timestamp = u64;
const CURRENT_TIMESTAMP: &[u8] = b"tim:val";