-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce OpenGov into Cere and CereDev (#238)
### Description Enabling the [OpenGov](https://wiki.polkadot.network/docs/learn-polkadot-opengov). <!-- Describe what change this PR is implementing --> ### Types of Changes <!--- What types of changes does your code introduce? --> - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [x] Breaking change (fix or feature that would cause existing functionality to change) - [x] Dependency upgrade (A change in substrate or any 3rd party crate version) ### Migrations and Hooks <!--- Check the following box with an x if the following applies: --> - [x] This change requires a runtime migration. - [ ] Modifies `on_initialize` - [ ] Modifies `on_finalize` ### Checklist <!--- All boxes need to be checked. Follow this checklist before requiring PR review --> - [x] Change has been tested locally. - [x] Change adds / updates tests. - [x] Changelog doc updated.
- Loading branch information
1 parent
7ad744e
commit c8ff9ef
Showing
18 changed files
with
1,267 additions
and
486 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
use frame_support::parameter_types; | ||
use frame_system::EnsureRootWithSuccess; | ||
|
||
use super::*; | ||
|
||
mod origins; | ||
pub use origins::{ | ||
pallet_custom_origins, GeneralAdmin, ReferendumCanceller, ReferendumKiller, Spender, | ||
StakingAdmin, Treasurer, WhitelistedCaller, | ||
}; | ||
mod tracks; | ||
pub use tracks::TracksInfo; | ||
|
||
parameter_types! { | ||
pub const VoteLockingPeriod: BlockNumber = 7 * DAYS; | ||
} | ||
|
||
impl pallet_conviction_voting::Config for Runtime { | ||
type WeightInfo = pallet_conviction_voting::weights::SubstrateWeight<Runtime>; | ||
type RuntimeEvent = RuntimeEvent; | ||
type Currency = Balances; | ||
type VoteLockingPeriod = VoteLockingPeriod; | ||
type MaxVotes = ConstU32<512>; | ||
type MaxTurnout = | ||
frame_support::traits::tokens::currency::ActiveIssuanceOf<Balances, Self::AccountId>; | ||
type Polls = Referenda; | ||
} | ||
|
||
parameter_types! { | ||
pub const AlarmInterval: BlockNumber = 1; | ||
pub const SubmissionDeposit: Balance = DOLLARS; | ||
pub const UndecidingTimeout: BlockNumber = 14 * DAYS; | ||
} | ||
|
||
parameter_types! { | ||
pub const MaxBalance: Balance = Balance::max_value(); | ||
} | ||
|
||
pub type TreasurySpender = EitherOf<EnsureRootWithSuccess<AccountId, MaxBalance>, Spender>; | ||
|
||
impl origins::pallet_custom_origins::Config for Runtime {} | ||
|
||
impl pallet_whitelist::Config for Runtime { | ||
type WeightInfo = pallet_whitelist::weights::SubstrateWeight<Runtime>; | ||
type RuntimeCall = RuntimeCall; | ||
type RuntimeEvent = RuntimeEvent; | ||
type WhitelistOrigin = EnsureRoot<Self::AccountId>; | ||
type DispatchWhitelistedOrigin = EitherOf<EnsureRoot<Self::AccountId>, WhitelistedCaller>; | ||
type Preimages = Preimage; | ||
} | ||
|
||
impl pallet_referenda::Config for Runtime { | ||
type WeightInfo = pallet_referenda::weights::SubstrateWeight<Runtime>; | ||
type RuntimeCall = RuntimeCall; | ||
type RuntimeEvent = RuntimeEvent; | ||
type Scheduler = Scheduler; | ||
type Currency = Balances; | ||
type SubmitOrigin = frame_system::EnsureSigned<AccountId>; | ||
type CancelOrigin = EitherOf<EnsureRoot<AccountId>, ReferendumCanceller>; | ||
type KillOrigin = EitherOf<EnsureRoot<AccountId>, ReferendumKiller>; | ||
type Slash = Treasury; | ||
type Votes = pallet_conviction_voting::VotesOf<Runtime>; | ||
type Tally = pallet_conviction_voting::TallyOf<Runtime>; | ||
type SubmissionDeposit = SubmissionDeposit; | ||
type MaxQueued = ConstU32<100>; | ||
type UndecidingTimeout = UndecidingTimeout; | ||
type AlarmInterval = AlarmInterval; | ||
type Tracks = TracksInfo; | ||
type Preimages = Preimage; | ||
} |
Oops, something went wrong.