[big refactor] Remove crate aliasing. (#4395)

* Rename: Phase 1.

* Unify codec.

* Fixing: Phase 2

* Fixing: Phase 3.

* Fixing: Phase 4.

* Fixing: Phase 5.

* Fixing: Phase 6.

* Fixing: Phase 7.

* Fixing: Phase 8. Tests

* Fixing: Phase 9. Tests!!!

* Fixing: Phase 10. Moar tests!

* Finally done!

* More fixes.

* Rename primitives:: to sp_core::

* Apply renames in finality-grandpa.

* Fix benches.

* Fix benches 2.

* Revert node-template.

* Fix frame-system in our modules.
This commit is contained in:
Tomasz Drwięga
2019-12-16 13:36:49 +01:00
committed by Gavin Wood
parent f14d98a439
commit 8778ca7dc8
485 changed files with 4023 additions and 4005 deletions
+16 -16
View File
@@ -70,19 +70,19 @@ use sp_std::{fmt::Debug, ops::Add, iter::once};
use enumflags2::BitFlags;
use codec::{Encode, Decode};
use sp_runtime::{traits::{StaticLookup, EnsureOrigin, Zero}, RuntimeDebug};
use support::{
use frame_support::{
decl_module, decl_event, decl_storage, ensure, dispatch::Result,
traits::{Currency, ReservableCurrency, OnUnbalanced, Get},
weights::SimpleDispatchInfo,
};
use system::{ensure_signed, ensure_root};
use frame_system::{self as system, ensure_signed, ensure_root};
type BalanceOf<T> = <<T as Trait>::Currency as Currency<<T as system::Trait>::AccountId>>::Balance;
type NegativeImbalanceOf<T> = <<T as Trait>::Currency as Currency<<T as system::Trait>::AccountId>>::NegativeImbalance;
type BalanceOf<T> = <<T as Trait>::Currency as Currency<<T as frame_system::Trait>::AccountId>>::Balance;
type NegativeImbalanceOf<T> = <<T as Trait>::Currency as Currency<<T as frame_system::Trait>::AccountId>>::NegativeImbalance;
pub trait Trait: system::Trait {
pub trait Trait: frame_system::Trait {
/// The overarching event type.
type Event: From<Event<Self>> + Into<<Self as system::Trait>::Event>;
type Event: From<Event<Self>> + Into<<Self as frame_system::Trait>::Event>;
/// The currency trait.
type Currency: ReservableCurrency<Self::AccountId>;
@@ -383,7 +383,7 @@ decl_storage! {
}
decl_event!(
pub enum Event<T> where AccountId = <T as system::Trait>::AccountId, Balance = BalanceOf<T> {
pub enum Event<T> where AccountId = <T as frame_system::Trait>::AccountId, Balance = BalanceOf<T> {
/// A name was set or reset (which will remove all judgements).
IdentitySet(AccountId),
/// A name was cleared, and the given balance returned.
@@ -822,9 +822,9 @@ decl_module! {
mod tests {
use super::*;
use support::{assert_ok, assert_noop, impl_outer_origin, parameter_types, weights::Weight};
use primitives::H256;
use system::EnsureSignedBy;
use frame_support::{assert_ok, assert_noop, impl_outer_origin, parameter_types, weights::Weight};
use sp_core::H256;
use frame_system::EnsureSignedBy;
// The testing primitives are very useful for avoiding having to work with signatures
// or public keys. `u64` is used as the `AccountId` and no `Signature`s are required.
use sp_runtime::{
@@ -832,7 +832,7 @@ mod tests {
};
impl_outer_origin! {
pub enum Origin for Test {}
pub enum Origin for Test where system = frame_system {}
}
// For testing the module, we construct most of a mock runtime. This means
@@ -846,7 +846,7 @@ mod tests {
pub const MaximumBlockLength: u32 = 2 * 1024;
pub const AvailableBlockRatio: Perbill = Perbill::one();
}
impl system::Trait for Test {
impl frame_system::Trait for Test {
type Origin = Origin;
type Index = u64;
type BlockNumber = u64;
@@ -868,7 +868,7 @@ mod tests {
pub const TransferFee: u64 = 0;
pub const CreationFee: u64 = 0;
}
impl balances::Trait for Test {
impl pallet_balances::Trait for Test {
type Balance = u64;
type OnFreeBalanceZero = ();
type OnNewAccount = ();
@@ -898,15 +898,15 @@ mod tests {
type RegistrarOrigin = EnsureSignedBy<One, u64>;
type ForceOrigin = EnsureSignedBy<Two, u64>;
}
type Balances = balances::Module<Test>;
type Balances = pallet_balances::Module<Test>;
type Identity = Module<Test>;
// This function basically just builds a genesis storage key/value store according to
// our desired mockup.
fn new_test_ext() -> sp_io::TestExternalities {
let mut t = system::GenesisConfig::default().build_storage::<Test>().unwrap();
let mut t = frame_system::GenesisConfig::default().build_storage::<Test>().unwrap();
// We use default for brevity, but you can configure as desired if needed.
balances::GenesisConfig::<Test> {
pallet_balances::GenesisConfig::<Test> {
balances: vec![
(1, 10),
(2, 10),