Skip to content

Commit 4e0a1b1

Browse files
authored
decl_module! macro: use 'frame_system' instead of system as default ident (paritytech#6500)
* Use frame_system as default ident. * Remove unused 'frame_system' to 'system' renaming. * Fix construct_runtime_ui tests. * Rename system to frame_system in sudo/utility pallet test. * Bump runtime impl_version. * Update formatting.
1 parent ffc5797 commit 4e0a1b1

File tree

30 files changed

+57
-57
lines changed

30 files changed

+57
-57
lines changed

bin/node-template/pallets/template/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
/// https://github.com/paritytech/substrate/blob/master/frame/example/src/lib.rs
1111
1212
use frame_support::{decl_module, decl_storage, decl_event, decl_error, dispatch};
13-
use frame_system::{self as system, ensure_signed};
13+
use frame_system::ensure_signed;
1414

1515
#[cfg(test)]
1616
mod mock;
@@ -19,11 +19,11 @@ mod mock;
1919
mod tests;
2020

2121
/// The pallet's configuration trait.
22-
pub trait Trait: system::Trait {
22+
pub trait Trait: frame_system::Trait {
2323
// Add other types and constants required to configure this pallet.
2424

2525
/// The overarching event type.
26-
type Event: From<Event<Self>> + Into<<Self as system::Trait>::Event>;
26+
type Event: From<Event<Self>> + Into<<Self as frame_system::Trait>::Event>;
2727
}
2828

2929
// This pallet's storage items.
@@ -41,7 +41,7 @@ decl_storage! {
4141

4242
// The pallet's events
4343
decl_event!(
44-
pub enum Event<T> where AccountId = <T as system::Trait>::AccountId {
44+
pub enum Event<T> where AccountId = <T as frame_system::Trait>::AccountId {
4545
/// Just a dummy event.
4646
/// Event `Something` is declared with a parameter of the type `u32` and `AccountId`
4747
/// To emit this event, we call the deposit function, from our runtime functions

bin/node/runtime/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
9898
// implementation changes and behavior does not, then leave spec_version as
9999
// is and increment impl_version.
100100
spec_version: 255,
101-
impl_version: 0,
101+
impl_version: 1,
102102
apis: RUNTIME_API_VERSIONS,
103103
transaction_version: 1,
104104
};

frame/assets/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
//! ```rust,ignore
8888
//! use pallet_assets as assets;
8989
//! use frame_support::{decl_module, dispatch, ensure};
90-
//! use frame_system::{self as system, ensure_signed};
90+
//! use frame_system::ensure_signed;
9191
//!
9292
//! pub trait Trait: assets::Trait { }
9393
//!
@@ -135,7 +135,7 @@
135135

136136
use frame_support::{Parameter, decl_module, decl_event, decl_storage, decl_error, ensure};
137137
use sp_runtime::traits::{Member, AtLeast32Bit, AtLeast32BitUnsigned, Zero, StaticLookup};
138-
use frame_system::{self as system, ensure_signed};
138+
use frame_system::ensure_signed;
139139
use sp_runtime::traits::One;
140140

141141
/// The module configuration trait.

frame/contracts/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ use frame_support::{
112112
dispatch::{DispatchResult, DispatchResultWithPostInfo},
113113
traits::{OnUnbalanced, Currency, Get, Time, Randomness},
114114
};
115-
use frame_system::{self as system, ensure_signed, ensure_root};
115+
use frame_system::{ensure_signed, ensure_root};
116116
use pallet_contracts_primitives::{RentProjection, ContractAccessError};
117117
use frame_support::weights::Weight;
118118

frame/elections-phragmen/src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ use frame_support::{
101101
}
102102
};
103103
use sp_npos_elections::{build_support_map, ExtendedBalance, VoteWeight, ElectionResult};
104-
use frame_system::{self as system, ensure_signed, ensure_root};
104+
use frame_system::{ensure_signed, ensure_root};
105105

106106
mod benchmarking;
107107

@@ -1060,7 +1060,6 @@ mod tests {
10601060
traits::{BlakeTwo256, IdentityLookup, Block as BlockT},
10611061
};
10621062
use crate as elections_phragmen;
1063-
use frame_system as system;
10641063

10651064
parameter_types! {
10661065
pub const BlockHashCount: u64 = 250;
@@ -1225,7 +1224,7 @@ mod tests {
12251224
NodeBlock = Block,
12261225
UncheckedExtrinsic = UncheckedExtrinsic
12271226
{
1228-
System: system::{Module, Call, Event<T>},
1227+
System: frame_system::{Module, Call, Event<T>},
12291228
Balances: pallet_balances::{Module, Call, Event<T>, Config<T>},
12301229
Elections: elections_phragmen::{Module, Call, Event<T>, Config<T>},
12311230
}

frame/elections/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ use frame_support::{
3838
}
3939
};
4040
use codec::{Encode, Decode};
41-
use frame_system::{self as system, ensure_signed, ensure_root};
41+
use frame_system::{ensure_signed, ensure_root};
4242

4343
mod mock;
4444
mod tests;

frame/evm/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ use serde::{Serialize, Deserialize};
3333
use frame_support::{ensure, decl_module, decl_storage, decl_event, decl_error};
3434
use frame_support::weights::Weight;
3535
use frame_support::traits::{Currency, WithdrawReason, ExistenceRequirement, Get};
36-
use frame_system::{self as system, ensure_signed};
36+
use frame_system::ensure_signed;
3737
use sp_runtime::ModuleId;
3838
use sp_core::{U256, H256, H160, Hasher};
3939
use sp_runtime::{

frame/example/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ use frame_support::{
260260
weights::{DispatchClass, ClassifyDispatch, WeighData, Weight, PaysFee, Pays},
261261
};
262262
use sp_std::prelude::*;
263-
use frame_system::{self as system, ensure_signed, ensure_root};
263+
use frame_system::{ensure_signed, ensure_root};
264264
use codec::{Encode, Decode};
265265
use sp_runtime::{
266266
traits::{

frame/generic-asset/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ use frame_support::{
171171
},
172172
Parameter, StorageMap,
173173
};
174-
use frame_system::{self as system, ensure_signed, ensure_root};
174+
use frame_system::{ensure_signed, ensure_root};
175175

176176
mod mock;
177177
mod tests;

frame/grandpa/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ use frame_support::{
4343
decl_error, decl_event, decl_module, decl_storage, storage, traits::KeyOwnerProofSystem,
4444
Parameter,
4545
};
46-
use frame_system::{self as system, ensure_signed, DigestOf};
46+
use frame_system::{ensure_signed, DigestOf};
4747
use sp_runtime::{
4848
generic::{DigestItem, OpaqueDigestItemId},
4949
traits::Zero,

0 commit comments

Comments
 (0)