Browse Source

runtime: Remove deprecated ProposalDetails entries.

Shamil Gadelshin 4 years ago
parent
commit
edcf998a73

+ 0 - 1
runtime-modules/proposals/codex/src/lib.rs

@@ -72,7 +72,6 @@ pub use crate::proposal_types::{
 };
 use common::origin::ActorOriginValidator;
 use common::working_group::WorkingGroup;
-use governance::election_params::ElectionParameters;
 pub use proposal_types::{ProposalDetails, ProposalDetailsOf, ProposalEncoder};
 use proposals_discussion::ThreadMode;
 use proposals_engine::{

+ 1 - 86
runtime-modules/proposals/codex/src/proposal_types/mod.rs

@@ -5,7 +5,6 @@ use codec::{Decode, Encode};
 use serde::{Deserialize, Serialize};
 use sp_std::vec::Vec;
 
-use crate::ElectionParameters;
 use common::working_group::WorkingGroup;
 
 use working_group::{Penalty, RewardPolicy, StakePolicy};
@@ -22,10 +21,8 @@ pub type ProposalDetailsOf<T> = ProposalDetails<
     crate::BalanceOfGovernanceCurrency<T>,
     <T as frame_system::Trait>::BlockNumber,
     <T as frame_system::Trait>::AccountId,
-    working_group::OpeningId,
     crate::BalanceOf<T>,
     working_group::WorkerId<T>,
-    crate::MemberId<T>,
 >;
 
 /// Proposal details provide voters the information required for the perceived voting.
@@ -36,10 +33,8 @@ pub enum ProposalDetails<
     CurrencyBalance,
     BlockNumber,
     AccountId,
-    OpeningId,
     StakeBalance,
     WorkerId,
-    MemberId,
 > {
     /// The text of the `text` proposal
     Text(Vec<u8>),
@@ -47,45 +42,15 @@ pub enum ProposalDetails<
     /// The wasm code for the `runtime upgrade` proposal
     RuntimeUpgrade(Vec<u8>),
 
-    /// ********** Deprecated.
-    /// It is kept only for backward compatibility in the Pioneer. **********
-    /// Election parameters for the `set election parameters` proposal
-    SetElectionParameters(ElectionParameters<CurrencyBalance, BlockNumber>),
-
     /// Balance and destination account for the `spending` proposal
     Spending(MintedBalance, AccountId),
 
-    /// ********** Deprecated during the Babylon release.
-    /// It is kept only for backward compatibility in the Pioneer. **********
-    /// New leader memberId and account_id for the `set lead` proposal
-    DeprecatedSetLead(Option<(MemberId, AccountId)>),
-
-    /// ********** Deprecated during the Babylon release.
-    /// It is kept only for backward compatibility in the Pioneer. **********
-    /// Balance for the `set content working group budget capacity` proposal
-    DeprecatedSetContentWorkingGroupMintCapacity(MintedBalance),
-
-    /// ********** Deprecated during the Nicaea release.
-    /// It is kept only for backward compatibility in the Pioneer. **********
-    /// AccountId for the `evict storage provider` proposal
-    DeprecatedEvictStorageProvider(AccountId),
-
     /// Validator count for the `set validator count` proposal
     SetValidatorCount(u32),
 
-    /// ********** Deprecated during the Nicaea release.
-    /// It is kept only for backward compatibility in the Pioneer. **********
-    /// Role parameters for the `set storage role parameters` proposal
-    DeprecatedSetStorageRoleParameters(RoleParameters<CurrencyBalance, BlockNumber>),
-
     /// Add opening for the working group leader position.
     AddWorkingGroupLeaderOpening(AddOpeningParameters<BlockNumber, CurrencyBalance>),
 
-    /// ********** Deprecated during the Olympia release.
-    /// It is kept only for backward compatibility in the Pioneer. **********
-    /// Begin review applications for the working group leader position.
-    DeprecatedBeginReviewWorkingGroupLeaderApplications(OpeningId, WorkingGroup),
-
     /// Fill opening for the working group leader position.
     FillWorkingGroupLeaderOpening(FillOpeningParameters),
 
@@ -108,25 +73,14 @@ pub enum ProposalDetails<
     AmendConstitution(Vec<u8>),
 }
 
-impl<
-        MintedBalance,
-        CurrencyBalance,
-        BlockNumber,
-        AccountId,
-        OpeningId,
-        StakeBalance,
-        WorkerId,
-        MemberId,
-    > Default
+impl<MintedBalance, CurrencyBalance, BlockNumber, AccountId, StakeBalance, WorkerId> Default
     for ProposalDetails<
         MintedBalance,
         CurrencyBalance,
         BlockNumber,
         AccountId,
-        OpeningId,
         StakeBalance,
         WorkerId,
-        MemberId,
     >
 {
     fn default() -> Self {
@@ -178,42 +132,3 @@ pub struct AddOpeningParameters<BlockNumber, Balance> {
     /// Defines working group with the open position.
     pub working_group: WorkingGroup,
 }
-
-/// ********** Deprecated during the Nicaea release.
-/// It is kept only for backward compatibility in the Pioneer. **********
-#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
-#[derive(Encode, Decode, Copy, Clone, Eq, PartialEq, Debug)]
-pub struct RoleParameters<Balance, BlockNumber> {
-    /// Minimum balance required to stake to enter a role.
-    pub min_stake: Balance,
-
-    /// Minimum actors to maintain - if role is unstaking
-    /// and remaining actors would be less that this value - prevent or punish for unstaking.
-    pub min_actors: u32,
-
-    /// The maximum number of spots available to fill for a role.
-    pub max_actors: u32,
-
-    /// Fixed amount of tokens paid to actors' primary account.
-    pub reward: Balance,
-
-    /// Payouts are made at this block interval.
-    pub reward_period: BlockNumber,
-
-    /// Minimum amount of time before being able to unstake.
-    pub bonding_period: BlockNumber,
-
-    /// How long tokens remain locked for after unstaking.
-    pub unbonding_period: BlockNumber,
-
-    /// Minimum period required to be in service. unbonding before this time is highly penalized
-    pub min_service_period: BlockNumber,
-
-    /// "Startup" time allowed for roles that need to sync their infrastructure
-    /// with other providers before they are considered in service and punishable for
-    /// not delivering required level of service.
-    pub startup_grace_period: BlockNumber,
-
-    /// Small fee burned to make a request to enter role.
-    pub entry_request_fee: Balance,
-}

+ 1 - 1
runtime-modules/proposals/codex/src/tests/mod.rs

@@ -36,7 +36,7 @@ where
     empty_stake_call: EmptyStakeCall,
     successful_call: SuccessfulCall,
     proposal_parameters: ProposalParameters<u64, u64>,
-    proposal_details: ProposalDetails<u64, u64, u64, u64, u64, u64, u64, u64>,
+    proposal_details: ProposalDetails<u64, u64, u64, u64, u64, u64>,
 }
 
 impl<InsufficientRightsCall, EmptyStakeCall, SuccessfulCall>

+ 0 - 37
runtime/src/integration/proposals/proposal_encoder.rs

@@ -4,7 +4,6 @@ use proposals_codex::{ProposalDetails, ProposalDetailsOf, ProposalEncoder};
 use working_group::OpeningType;
 
 use codec::Encode;
-use frame_support::print;
 use sp_std::collections::btree_set::BTreeSet;
 use sp_std::marker::PhantomData;
 use sp_std::vec::Vec;
@@ -35,9 +34,6 @@ impl ProposalEncoder<Runtime> for ExtrinsicProposalEncoder {
             ProposalDetails::Text(text) => {
                 Call::ProposalsCodex(proposals_codex::Call::execute_text_proposal(text))
             }
-            ProposalDetails::SetElectionParameters(election_parameters) => Call::CouncilElection(
-                governance::election::Call::set_election_parameters(election_parameters),
-            ),
             ProposalDetails::Spending(balance, destination) => Call::Council(
                 governance::council::Call::spend_from_council_mint(balance, destination),
             ),
@@ -47,45 +43,12 @@ impl ProposalEncoder<Runtime> for ExtrinsicProposalEncoder {
             ProposalDetails::RuntimeUpgrade(wasm_code) => Call::ProposalsCodex(
                 proposals_codex::Call::execute_runtime_upgrade_proposal(wasm_code),
             ),
-            // ********** Deprecated during the Babylon release.
-            ProposalDetails::DeprecatedSetLead(_) => {
-                print("Error: Calling deprecated SetLead encoding option.");
-                return Vec::new();
-            }
-            // ********** Deprecated during the Babylon release.
-            ProposalDetails::DeprecatedSetContentWorkingGroupMintCapacity(_) => {
-                print(
-                    "Error: Calling deprecated SetContentWorkingGroupMintCapacity encoding option.",
-                );
-                return Vec::new();
-            }
-            // ********** Deprecated during the Nicaea release.
-            // It is kept only for backward compatibility in the Pioneer. **********
-            ProposalDetails::DeprecatedEvictStorageProvider(_) => {
-                print("Error: Calling deprecated EvictStorageProvider encoding option.");
-                return Vec::new();
-            }
-            // ********** Deprecated during the Nicaea release.
-            // It is kept only for backward compatibility in the Pioneer. **********
-            ProposalDetails::DeprecatedSetStorageRoleParameters(_) => {
-                print("Error: Calling deprecated SetStorageRoleParameters encoding option.");
-                return Vec::new();
-            }
             ProposalDetails::AddWorkingGroupLeaderOpening(add_opening_params) => {
                 wrap_working_group_call!(
                     add_opening_params.working_group,
                     Wg::create_add_opening_call(add_opening_params)
                 )
             }
-            ProposalDetails::DeprecatedBeginReviewWorkingGroupLeaderApplications(
-                _opening_id,
-                _working_group,
-            ) => {
-                print(
-                    "Error: Calling deprecated BeginReviewWorkingGroupLeaderApplications encoding option.",
-                );
-                return Vec::new();
-            }
             ProposalDetails::FillWorkingGroupLeaderOpening(fill_opening_params) => {
                 wrap_working_group_call!(
                     fill_opening_params.working_group,