Update Substrate, introduce Society/Recovery (#757)

* Bump Substrate

* Bump RT version

* Bump substrate, add new modules

* Fix

* Bump Substrate

* Bump impl version

* Address grumbles
This commit is contained in:
Gavin Wood
2020-01-14 17:49:40 +01:00
committed by GitHub
parent d51c0d589c
commit 148909ee98
4 changed files with 197 additions and 108 deletions
+4
View File
@@ -48,7 +48,9 @@ membership = { package = "pallet-membership", git = "https://github.com/parityte
nicks = { package = "pallet-nicks", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
offences = { package = "pallet-offences", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
randomness-collective-flip = { package = "pallet-randomness-collective-flip", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
recovery = { package = "pallet-recovery", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
session = { package = "pallet-session", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
society = { package = "pallet-society", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
staking = { package = "pallet-staking", git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
pallet-staking-reward-curve = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
@@ -111,9 +113,11 @@ std = [
"membership/std",
"nicks/std",
"offences/std",
"recovery/std",
"sp-runtime/std",
"sp-staking/std",
"session/std",
"society/std",
"staking/std",
"system/std",
"system_rpc_runtime_api/std",
+52 -2
View File
@@ -78,7 +78,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
impl_name: create_runtime_str!("parity-kusama"),
authoring_version: 2,
spec_version: 1040,
impl_version: 0,
impl_version: 1,
apis: RUNTIME_API_VERSIONS,
};
@@ -174,7 +174,7 @@ pub type DealWithFees = SplitTwoWays<
impl balances::Trait for Runtime {
type Balance = Balance;
type OnFreeBalanceZero = Staking;
type OnReapAccount = System;
type OnReapAccount = (System, Recovery);
type OnNewAccount = Indices;
type Event = Event;
type DustRemoval = ();
@@ -546,6 +546,50 @@ impl utility::Trait for Runtime {
type MaxSignatories = MaxSignatories;
}
parameter_types! {
pub const ConfigDepositBase: Balance = 5 * DOLLARS;
pub const FriendDepositFactor: Balance = 50 * CENTS;
pub const MaxFriends: u16 = 9;
pub const RecoveryDeposit: Balance = 5 * DOLLARS;
}
impl recovery::Trait for Runtime {
type Event = Event;
type Call = Call;
type Currency = Balances;
type ConfigDepositBase = ConfigDepositBase;
type FriendDepositFactor = FriendDepositFactor;
type MaxFriends = MaxFriends;
type RecoveryDeposit = RecoveryDeposit;
}
parameter_types! {
pub const CandidateDeposit: Balance = 10 * DOLLARS;
pub const WrongSideDeduction: Balance = 2 * DOLLARS;
pub const MaxStrikes: u32 = 10;
pub const RotationPeriod: BlockNumber = 80 * HOURS;
pub const PeriodSpend: Balance = 500 * DOLLARS;
pub const MaxLockDuration: BlockNumber = 36 * 30 * DAYS;
pub const ChallengePeriod: BlockNumber = 7 * DAYS;
pub const MaxMembers: u32 = 999;
}
impl society::Trait for Runtime {
type Event = Event;
type Currency = Balances;
type Randomness = RandomnessCollectiveFlip;
type CandidateDeposit = CandidateDeposit;
type WrongSideDeduction = WrongSideDeduction;
type MaxStrikes = MaxStrikes;
type PeriodSpend = PeriodSpend;
type MembershipChanged = ();
type RotationPeriod = RotationPeriod;
type MaxLockDuration = MaxLockDuration;
type FounderSetOrigin = collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>;
type SuspensionJudgementOrigin = society::EnsureFounder<Runtime>;
type ChallengePeriod = ChallengePeriod;
}
construct_runtime! {
pub enum Runtime where
Block = Block,
@@ -597,6 +641,12 @@ construct_runtime! {
// Less simple identity module.
Identity: identity::{Module, Call, Storage, Event<T>},
// Society module.
Society: society::{Module, Call, Storage, Event<T>},
// Social recovery module.
Recovery: recovery::{Module, Call, Storage, Event<T>},
}
}