|
@@ -1,101 +1,42 @@
|
|
|
-pub(crate) mod parameters {
|
|
|
- use crate::{BalanceOf, ProposalParameters};
|
|
|
+pub(crate) mod parameters;
|
|
|
|
|
|
- // Proposal parameters for the upgrade runtime proposal
|
|
|
- pub(crate) fn upgrade_runtime<T: crate::Trait>(
|
|
|
- ) -> ProposalParameters<T::BlockNumber, BalanceOf<T>> {
|
|
|
- ProposalParameters {
|
|
|
- voting_period: T::BlockNumber::from(50000u32),
|
|
|
- grace_period: T::BlockNumber::from(10000u32),
|
|
|
- approval_quorum_percentage: 80,
|
|
|
- approval_threshold_percentage: 80,
|
|
|
- slashing_quorum_percentage: 80,
|
|
|
- slashing_threshold_percentage: 80,
|
|
|
- required_stake: Some(<BalanceOf<T>>::from(50000u32)),
|
|
|
- }
|
|
|
- }
|
|
|
+use codec::{Decode, Encode};
|
|
|
+use rstd::vec::Vec;
|
|
|
+#[cfg(feature = "std")]
|
|
|
+use serde::{Deserialize, Serialize};
|
|
|
|
|
|
- // Proposal parameters for the text proposal
|
|
|
- pub(crate) fn text_proposal<T: crate::Trait>(
|
|
|
- ) -> ProposalParameters<T::BlockNumber, BalanceOf<T>> {
|
|
|
- ProposalParameters {
|
|
|
- voting_period: T::BlockNumber::from(50000u32),
|
|
|
- grace_period: T::BlockNumber::from(10000u32),
|
|
|
- approval_quorum_percentage: 40,
|
|
|
- approval_threshold_percentage: 51,
|
|
|
- slashing_quorum_percentage: 80,
|
|
|
- slashing_threshold_percentage: 82,
|
|
|
- required_stake: Some(<BalanceOf<T>>::from(500u32)),
|
|
|
- }
|
|
|
- }
|
|
|
+use crate::ElectionParameters;
|
|
|
|
|
|
- // Proposal parameters for the 'Set Election Parameters' proposal
|
|
|
- pub(crate) fn set_election_parameters_proposal<T: crate::Trait>(
|
|
|
- ) -> ProposalParameters<T::BlockNumber, BalanceOf<T>> {
|
|
|
- ProposalParameters {
|
|
|
- voting_period: T::BlockNumber::from(50000u32),
|
|
|
- grace_period: T::BlockNumber::from(10000u32),
|
|
|
- approval_quorum_percentage: 40,
|
|
|
- approval_threshold_percentage: 51,
|
|
|
- slashing_quorum_percentage: 81,
|
|
|
- slashing_threshold_percentage: 80,
|
|
|
- required_stake: Some(<BalanceOf<T>>::from(500u32)),
|
|
|
- }
|
|
|
- }
|
|
|
+/// Proposal details provide voters the information required for the perceived voting.
|
|
|
+#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
|
|
|
+#[derive(Encode, Decode, Clone, PartialEq, Debug)]
|
|
|
+pub enum ProposalDetails<MintedBalance, CurrencyBalance, BlockNumber, AccountId, MemberId> {
|
|
|
+ /// The text of the `text proposal`
|
|
|
+ Text(Vec<u8>),
|
|
|
|
|
|
- // Proposal parameters for the 'Set council mint capacity' proposal
|
|
|
- pub(crate) fn set_council_mint_capacity_proposal<T: crate::Trait>(
|
|
|
- ) -> ProposalParameters<T::BlockNumber, BalanceOf<T>> {
|
|
|
- ProposalParameters {
|
|
|
- voting_period: T::BlockNumber::from(50000u32),
|
|
|
- grace_period: T::BlockNumber::from(10000u32),
|
|
|
- approval_quorum_percentage: 40,
|
|
|
- approval_threshold_percentage: 51,
|
|
|
- slashing_quorum_percentage: 81,
|
|
|
- slashing_threshold_percentage: 84,
|
|
|
- required_stake: Some(<BalanceOf<T>>::from(500u32)),
|
|
|
- }
|
|
|
- }
|
|
|
+ /// The hash of wasm code for the `runtime upgrade proposal`
|
|
|
+ RuntimeUpgrade(Vec<u8>),
|
|
|
|
|
|
- // Proposal parameters for the 'Set content working group mint capacity' proposal
|
|
|
- pub(crate) fn set_content_working_group_mint_capacity_proposal<T: crate::Trait>(
|
|
|
- ) -> ProposalParameters<T::BlockNumber, BalanceOf<T>> {
|
|
|
- ProposalParameters {
|
|
|
- voting_period: T::BlockNumber::from(50000u32),
|
|
|
- grace_period: T::BlockNumber::from(10000u32),
|
|
|
- approval_quorum_percentage: 40,
|
|
|
- approval_threshold_percentage: 51,
|
|
|
- slashing_quorum_percentage: 81,
|
|
|
- slashing_threshold_percentage: 85,
|
|
|
- required_stake: Some(<BalanceOf<T>>::from(500u32)),
|
|
|
- }
|
|
|
- }
|
|
|
+ /// Election parameters for the `set election parameters proposal`
|
|
|
+ SetElectionParameters(ElectionParameters<CurrencyBalance, BlockNumber>),
|
|
|
|
|
|
- // Proposal parameters for the 'Spending' proposal
|
|
|
- pub(crate) fn spending_proposal<T: crate::Trait>(
|
|
|
- ) -> ProposalParameters<T::BlockNumber, BalanceOf<T>> {
|
|
|
- ProposalParameters {
|
|
|
- voting_period: T::BlockNumber::from(50000u32),
|
|
|
- grace_period: T::BlockNumber::from(10000u32),
|
|
|
- approval_quorum_percentage: 40,
|
|
|
- approval_threshold_percentage: 51,
|
|
|
- slashing_quorum_percentage: 84,
|
|
|
- slashing_threshold_percentage: 85,
|
|
|
- required_stake: Some(<BalanceOf<T>>::from(500u32)),
|
|
|
- }
|
|
|
- }
|
|
|
+ /// Balance and destination account for the `spending proposal`
|
|
|
+ Spending(MintedBalance, AccountId),
|
|
|
+
|
|
|
+ /// New leader memberId and account_id for the `set lead proposal`
|
|
|
+ SetLead(Option<(MemberId, AccountId)>),
|
|
|
+
|
|
|
+ /// Balance for the `set council mint capacity proposal`
|
|
|
+ SetCouncilMintCapacity(MintedBalance),
|
|
|
+
|
|
|
+ /// Balance for the `set content working group mint capacity proposal`
|
|
|
+ SetContentWorkingGroupMintCapacity(MintedBalance),
|
|
|
+}
|
|
|
|
|
|
- // Proposal parameters for the 'Set lead' proposal
|
|
|
- pub(crate) fn set_lead_proposal<T: crate::Trait>(
|
|
|
- ) -> ProposalParameters<T::BlockNumber, BalanceOf<T>> {
|
|
|
- ProposalParameters {
|
|
|
- voting_period: T::BlockNumber::from(50000u32),
|
|
|
- grace_period: T::BlockNumber::from(10000u32),
|
|
|
- approval_quorum_percentage: 40,
|
|
|
- approval_threshold_percentage: 51,
|
|
|
- slashing_quorum_percentage: 81,
|
|
|
- slashing_threshold_percentage: 86,
|
|
|
- required_stake: Some(<BalanceOf<T>>::from(500u32)),
|
|
|
- }
|
|
|
+impl<MintedBalance, CurrencyBalance, BlockNumber, AccountId, MemberId> Default
|
|
|
+ for ProposalDetails<MintedBalance, CurrencyBalance, BlockNumber, AccountId, MemberId>
|
|
|
+{
|
|
|
+ fn default() -> Self {
|
|
|
+ ProposalDetails::Text(b"invalid proposal details".to_vec())
|
|
|
}
|
|
|
}
|