[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
+5 -5
View File
@@ -10,11 +10,11 @@ codec = { package = "parity-scale-codec", version = "1.0.0", default-features =
sp-std = { path = "../../primitives/std", default-features = false }
sp-io = { path = "../../primitives/io", default-features = false }
sp-runtime = { path = "../../primitives/runtime", default-features = false }
support = { package = "frame-support", path = "../support", default-features = false }
system = { package = "frame-system", path = "../system", default-features = false }
frame-support = { path = "../support", default-features = false }
frame-system = { path = "../system", default-features = false }
[dev-dependencies]
primitives = { package = "sp-core", path = "../../primitives/core" }
sp-core = { path = "../../primitives/core" }
[features]
default = ["std"]
@@ -24,6 +24,6 @@ std = [
"sp-std/std",
"sp-io/std",
"sp-runtime/std",
"support/std",
"system/std",
"frame-support/std",
"frame-system/std",
]
+10 -10
View File
@@ -51,10 +51,10 @@
//! This is an example of a module that exposes a privileged function:
//!
//! ```
//! use support::{decl_module, dispatch};
//! use system::ensure_root;
//! use frame_support::{decl_module, dispatch};
//! use frame_system::{self as system, ensure_root};
//!
//! pub trait Trait: system::Trait {}
//! pub trait Trait: frame_system::Trait {}
//!
//! decl_module! {
//! pub struct Module<T: Trait> for enum Call where origin: T::Origin {
@@ -90,15 +90,15 @@ use sp_std::prelude::*;
use sp_runtime::{
traits::{StaticLookup, Dispatchable}, DispatchError,
};
use support::{
use frame_support::{
Parameter, decl_module, decl_event, decl_storage, ensure,
weights::SimpleDispatchInfo,
};
use system::ensure_signed;
use frame_system::{self as system, ensure_signed};
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>;
/// A sudo-able call.
type Proposal: Parameter + Dispatchable<Origin=Self::Origin>;
@@ -125,7 +125,7 @@ decl_module! {
let sender = ensure_signed(origin)?;
ensure!(sender == Self::key(), "only the current sudo key can sudo");
let res = match proposal.dispatch(system::RawOrigin::Root.into()) {
let res = match proposal.dispatch(frame_system::RawOrigin::Root.into()) {
Ok(_) => true,
Err(e) => {
let e: DispatchError = e.into();
@@ -175,7 +175,7 @@ decl_module! {
let who = T::Lookup::lookup(who)?;
let res = match proposal.dispatch(system::RawOrigin::Signed(who).into()) {
let res = match proposal.dispatch(frame_system::RawOrigin::Signed(who).into()) {
Ok(_) => true,
Err(e) => {
let e: DispatchError = e.into();
@@ -190,7 +190,7 @@ decl_module! {
}
decl_event!(
pub enum Event<T> where AccountId = <T as system::Trait>::AccountId {
pub enum Event<T> where AccountId = <T as frame_system::Trait>::AccountId {
/// A sudo just took place.
Sudid(bool),
/// The sudoer just switched identity; the old key is supplied.