Companion PR to #5695 (#1030)

* add module ids to kusama runtime

* update kusam with polkadot runtimes to have moduleids configured

* trivial

* define module id for treasury in crowdfund.rs

* crodfund builds without issue

* remove commented out code

* switch crowdfund  to configurable moduleid

* test-runtime passing

* trivial syntax

* add module id to mock

* Update `Cargo.lock`

Co-authored-by: zeke <emostov@middlebury.edu>
This commit is contained in:
Bastian Köcher
2020-04-24 12:46:51 +02:00
committed by GitHub
parent 9ce4513e79
commit 88451e0b7c
4 changed files with 151 additions and 134 deletions
+9 -3
View File
@@ -12,7 +12,7 @@
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
//! The Polkadot runtime. This can be compiled with `#[no_std]`, ready for Wasm.
@@ -33,7 +33,7 @@ use runtime_common::{attestations, claims, parachains, registrar, slots,
MaximumBlockLength,
};
use sp_runtime::{
create_runtime_str, generic, impl_opaque_keys,
create_runtime_str, generic, impl_opaque_keys, ModuleId,
ApplyExtrinsicResult, KeyTypeId, Percent, Permill, Perbill, Perquintill, RuntimeDebug,
transaction_validity::{
TransactionValidity, InvalidTransaction, TransactionValidityError, TransactionSource, TransactionPriority,
@@ -54,7 +54,7 @@ use sp_core::OpaqueMetadata;
use sp_staking::SessionIndex;
use frame_support::{
parameter_types, construct_runtime, debug,
traits::{KeyOwnerProofSystem, SplitTwoWays, Randomness},
traits::{KeyOwnerProofSystem, SplitTwoWays, Randomness, LockIdentifier},
};
use im_online::sr25519::AuthorityId as ImOnlineId;
use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId;
@@ -387,6 +387,7 @@ parameter_types! {
pub const TermDuration: BlockNumber = 24 * HOURS;
pub const DesiredMembers: u32 = 13;
pub const DesiredRunnersUp: u32 = 7;
pub const ElectionsPhragmenModuleId: LockIdentifier = *b"phrelect";
}
impl elections_phragmen::Trait for Runtime {
@@ -403,6 +404,7 @@ impl elections_phragmen::Trait for Runtime {
type DesiredMembers = DesiredMembers;
type DesiredRunnersUp = DesiredRunnersUp;
type TermDuration = TermDuration;
type ModuleId = ElectionsPhragmenModuleId;
}
parameter_types! {
@@ -433,6 +435,7 @@ parameter_types! {
pub const ProposalBondMinimum: Balance = 20 * DOLLARS;
pub const SpendPeriod: BlockNumber = 6 * DAYS;
pub const Burn: Permill = Permill::from_percent(0);
pub const TreasuryModuleId: ModuleId = ModuleId(*b"py/trsry");
pub const TipCountdown: BlockNumber = 1 * DAYS;
pub const TipFindersFee: Percent = Percent::from_percent(20);
@@ -455,6 +458,7 @@ impl treasury::Trait for Runtime {
type ProposalBondMinimum = ProposalBondMinimum;
type SpendPeriod = SpendPeriod;
type Burn = Burn;
type ModuleId = TreasuryModuleId;
}
impl offences::Trait for Runtime {
@@ -694,6 +698,7 @@ parameter_types! {
pub const PeriodSpend: Balance = 500 * DOLLARS;
pub const MaxLockDuration: BlockNumber = 36 * 30 * DAYS;
pub const ChallengePeriod: BlockNumber = 7 * DAYS;
pub const SocietyModuleId: ModuleId = ModuleId(*b"py/socie");
}
impl society::Trait for Runtime {
@@ -710,6 +715,7 @@ impl society::Trait for Runtime {
type FounderSetOrigin = collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>;
type SuspensionJudgementOrigin = society::EnsureFounder<Runtime>;
type ChallengePeriod = ChallengePeriod;
type ModuleId = SocietyModuleId;
}
parameter_types! {