Make Pallet ModuleId and LockIdentifier Configurable (#5695)

* transition treasury to configurable moduleids

* make election module id configurable

* convert runtime and pallet to accept module id config elections-phragmen

* add ModuleId to evm pallet

* change society pallet to configurable module id

* delete commented out module_id

* delete commented out code and merge in upstream  master

* try and convert 4 whitespace to tab

* fix remaining space to tab conversions

* trivial cleaning

* delete comment from elections-phragrems tests

* trivial

* Update frame/elections-phragmen/src/lib.rs

* add docs for elections and elections phragmen

* make has_lock test get moduleid dynamically

* Apply suggestions from code review

Co-Authored-By: Amar Singh <asinghchrony@protonmail.com>

* make sure get is imported to evm

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Amar Singh <asinghchrony@protonmail.com>
Co-authored-by: Benjamin Kampmann <ben@gnunicorn.org>
This commit is contained in:
emostov
2020-04-24 02:47:32 -07:00
committed by GitHub
parent 2fb22de02e
commit 8ac2bac58d
9 changed files with 63 additions and 29 deletions
+6 -1
View File
@@ -21,7 +21,7 @@
use std::cell::RefCell;
use frame_support::{
StorageValue, StorageMap, parameter_types, assert_ok,
traits::{Get, ChangeMembers, Currency},
traits::{Get, ChangeMembers, Currency, LockIdentifier},
weights::Weight,
};
use sp_core::H256;
@@ -122,6 +122,10 @@ impl ChangeMembers<u64> for TestChangeMembers {
}
}
parameter_types!{
pub const ElectionModuleId: LockIdentifier = *b"py/elect";
}
impl elections::Trait for Test {
type Event = Event;
type Currency = Balances;
@@ -139,6 +143,7 @@ impl elections::Trait for Test {
type InactiveGracePeriod = InactiveGracePeriod;
type VotingPeriod = VotingPeriod;
type DecayRatio = DecayRatio;
type ModuleId = ElectionModuleId;
}
pub type Block = sp_runtime::generic::Block<Header, UncheckedExtrinsic>;