Ver Fonte

Merge pull request #2178 from conectado/emergency-cancellation-proposal

Emergency cancellation proposal
shamil-gadelshin há 4 anos atrás
pai
commit
4618821ddb

+ 0 - 1
runtime-modules/forum/src/benchmarking.rs

@@ -1420,7 +1420,6 @@ benchmarks! {
                 forum_user_id.saturated_into(),
                 category_id,
                 thread_id,
-                post_id,
                 new_text
             ).into()
         );

+ 29 - 0
runtime-modules/proposals/codex/src/benchmarking.rs

@@ -313,6 +313,28 @@ benchmarks! {
         );
     }
 
+    create_proposal_veto_proposal {
+        let t in ...;
+        let d in ...;
+
+        let (account_id, member_id, general_proposal_paramters) =
+            create_proposal_parameters::<T>(t, d);
+
+        let proposal_details = ProposalDetails::VetoProposal(0.into());
+    }: create_proposal(
+        RawOrigin::Signed(account_id.clone()),
+        general_proposal_paramters.clone(),
+        proposal_details.clone()
+    )
+    verify {
+        create_proposal_verify::<T>(
+            account_id,
+            member_id,
+            general_proposal_paramters,
+            proposal_details
+        );
+    }
+
     create_proposal_create_working_group_lead_opening {
         let i in 1 .. MAX_BYTES;
         let t in ...;
@@ -1131,4 +1153,11 @@ mod tests {
             assert_ok!(test_benchmark_create_proposal_unlock_blog_post::<Test>());
         });
     }
+
+    #[test]
+    fn test_create_proposal_veto_proposal() {
+        initial_test_ext().execute_with(|| {
+            assert_ok!(test_benchmark_create_proposal_veto_proposal::<Test>());
+        });
+    }
 }

+ 78 - 30
runtime-modules/proposals/codex/src/lib.rs

@@ -91,28 +91,29 @@ pub trait WeightInfo {
     fn execute_signal_proposal(i: u32) -> Weight;
     fn create_proposal_signal(i: u32, t: u32, d: u32) -> Weight;
     fn create_proposal_runtime_upgrade(i: u32, t: u32, d: u32) -> Weight;
-    fn create_proposal_funding_request(i: u32) -> Weight;
-    fn create_proposal_set_max_validator_count(d: u32) -> Weight;
-    fn create_proposal_create_working_group_lead_opening(i: u32) -> Weight;
-    fn create_proposal_fill_working_group_lead_opening() -> Weight;
-    fn create_proposal_update_working_group_budget(d: u32) -> Weight;
+    fn create_proposal_funding_request(i: u32, d: u32) -> Weight;
+    fn create_proposal_set_max_validator_count(t: u32, d: u32) -> Weight;
+    fn create_proposal_create_working_group_lead_opening(i: u32, t: u32, d: u32) -> Weight;
+    fn create_proposal_fill_working_group_lead_opening(t: u32, d: u32) -> Weight;
+    fn create_proposal_update_working_group_budget(t: u32, d: u32) -> Weight;
     fn create_proposal_decrease_working_group_lead_stake(t: u32, d: u32) -> Weight;
-    fn create_proposal_slash_working_group_lead(t: u32, d: u32) -> Weight;
-    fn create_proposal_set_working_group_lead_reward(d: u32) -> Weight;
-    fn create_proposal_terminate_working_group_lead() -> Weight;
-    fn create_proposal_amend_constitution(i: u32, t: u32, d: u32) -> Weight;
-    fn create_proposal_cancel_working_group_lead_opening(t: u32, d: u32) -> Weight;
-    fn create_proposal_set_membership_price() -> Weight;
-    fn create_proposal_set_council_budget_increment() -> Weight;
-    fn create_proposal_set_councilor_reward(t: u32) -> Weight;
+    fn create_proposal_slash_working_group_lead(d: u32) -> Weight;
+    fn create_proposal_set_working_group_lead_reward(t: u32, d: u32) -> Weight;
+    fn create_proposal_terminate_working_group_lead(t: u32, d: u32) -> Weight;
+    fn create_proposal_amend_constitution(i: u32, d: u32) -> Weight;
+    fn create_proposal_cancel_working_group_lead_opening(d: u32) -> Weight;
+    fn create_proposal_set_membership_price(t: u32, d: u32) -> Weight;
+    fn create_proposal_set_council_budget_increment(t: u32, d: u32) -> Weight;
+    fn create_proposal_set_councilor_reward(t: u32, d: u32) -> Weight;
     fn create_proposal_set_initial_invitation_balance(t: u32, d: u32) -> Weight;
-    fn create_proposal_set_initial_invitation_count() -> Weight;
-    fn create_proposal_set_membership_lead_invitation_quota(t: u32) -> Weight;
-    fn create_proposal_set_referral_cut(t: u32) -> Weight;
+    fn create_proposal_set_initial_invitation_count(t: u32, d: u32) -> Weight;
+    fn create_proposal_set_membership_lead_invitation_quota(d: u32) -> Weight;
+    fn create_proposal_set_referral_cut(t: u32, d: u32) -> Weight;
     fn create_proposal_create_blog_post(t: u32, d: u32, h: u32, b: u32) -> Weight;
     fn create_proposal_edit_blog_post(t: u32, d: u32, h: u32, b: u32) -> Weight;
-    fn create_proposal_lock_blog_post(t: u32) -> Weight;
-    fn create_proposal_unlock_blog_post() -> Weight;
+    fn create_proposal_lock_blog_post(t: u32, d: u32) -> Weight;
+    fn create_proposal_unlock_blog_post(t: u32, d: u32) -> Weight;
+    fn create_proposal_veto_proposal(t: u32, d: u32) -> Weight;
     fn update_working_group_budget_positive_forum() -> Weight;
     fn update_working_group_budget_negative_forum() -> Weight;
     fn update_working_group_budget_positive_storage() -> Weight;
@@ -133,6 +134,7 @@ pub trait Trait:
     + common::Trait
     + council::Trait
     + staking::Trait
+    + proposals_engine::Trait
 {
     /// Proposal Codex module event type.
     type Event: From<Event<Self>> + Into<<Self as frame_system::Trait>::Event>;
@@ -264,6 +266,9 @@ pub trait Trait:
         ProposalParameters<Self::BlockNumber, BalanceOf<Self>>,
     >;
 
+    /// `Veto Proposal` proposal parameters
+    type VetoProposalProposalParameters: Get<ProposalParameters<Self::BlockNumber, BalanceOf<Self>>>;
+
     /// Gets the budget of the given WorkingGroup
     fn get_working_group_budget(working_group: WorkingGroup) -> BalanceOf<Self>;
 
@@ -483,6 +488,9 @@ decl_module! {
         const UnlockBlogPostProposalParameters:
             ProposalParameters<T::BlockNumber, BalanceOf<T>> = T::UnlockBlogPostProposalParameters::get();
 
+        const VetoProposalProposalParameters:
+            ProposalParameters<T::BlockNumber, BalanceOf<T>> = T::VetoProposalProposalParameters::get();
+
 
         /// Create a proposal, the type of proposal depends on the `proposal_details` variant
         ///
@@ -770,6 +778,9 @@ impl<T: Trait> Module<T> {
             ProposalDetails::UnlockBlogPost(..) => {
                 // Note: No checks for this proposal for now
             }
+            ProposalDetails::VetoProposal(..) => {
+                // Note: No checks for this proposal for now
+            }
         }
 
         Ok(())
@@ -834,6 +845,7 @@ impl<T: Trait> Module<T> {
             ProposalDetails::EditBlogPost(..) => T::EditBlogPostProoposalParamters::get(),
             ProposalDetails::LockBlogPost(..) => T::LockBlogPostProposalParameters::get(),
             ProposalDetails::UnlockBlogPost(..) => T::UnlockBlogPostProposalParameters::get(),
+            ProposalDetails::VetoProposal(..) => T::VetoProposalProposalParameters::get(),
         }
     }
 
@@ -895,23 +907,33 @@ impl<T: Trait> Module<T> {
                 )
             }
             ProposalDetails::FundingRequest(params) => {
-                WeightInfoCodex::<T>::create_proposal_funding_request(params.len().saturated_into())
+                WeightInfoCodex::<T>::create_proposal_funding_request(
+                    params.len().saturated_into(),
+                    description_length.saturated_into(),
+                )
             }
             ProposalDetails::SetMaxValidatorCount(..) => {
                 WeightInfoCodex::<T>::create_proposal_set_max_validator_count(
+                    title_length.saturated_into(),
                     description_length.saturated_into(),
                 )
             }
             ProposalDetails::CreateWorkingGroupLeadOpening(opening_params) => {
                 WeightInfoCodex::<T>::create_proposal_create_working_group_lead_opening(
                     opening_params.description.len().saturated_into(),
+                    title_length.saturated_into(),
+                    description_length.saturated_into(),
                 )
             }
             ProposalDetails::FillWorkingGroupLeadOpening(..) => {
-                WeightInfoCodex::<T>::create_proposal_fill_working_group_lead_opening()
+                WeightInfoCodex::<T>::create_proposal_fill_working_group_lead_opening(
+                    title_length.saturated_into(),
+                    description_length.saturated_into(),
+                )
             }
             ProposalDetails::UpdateWorkingGroupBudget(..) => {
                 WeightInfoCodex::<T>::create_proposal_update_working_group_budget(
+                    title_length.saturated_into(),
                     description_length.saturated_into(),
                 )
             }
@@ -923,40 +945,48 @@ impl<T: Trait> Module<T> {
             }
             ProposalDetails::SlashWorkingGroupLead(..) => {
                 WeightInfoCodex::<T>::create_proposal_slash_working_group_lead(
-                    title_length.saturated_into(),
                     description_length.saturated_into(),
                 )
             }
             ProposalDetails::SetWorkingGroupLeadReward(..) => {
                 WeightInfoCodex::<T>::create_proposal_set_working_group_lead_reward(
+                    title_length.saturated_into(),
                     description_length.saturated_into(),
                 )
             }
             ProposalDetails::TerminateWorkingGroupLead(..) => {
-                WeightInfoCodex::<T>::create_proposal_terminate_working_group_lead()
+                WeightInfoCodex::<T>::create_proposal_terminate_working_group_lead(
+                    title_length.saturated_into(),
+                    description_length.saturated_into(),
+                )
             }
             ProposalDetails::AmendConstitution(new_constitution) => {
                 WeightInfoCodex::<T>::create_proposal_amend_constitution(
                     new_constitution.len().saturated_into(),
-                    title_length.saturated_into(),
                     description_length.saturated_into(),
                 )
             }
             ProposalDetails::SetMembershipPrice(..) => {
-                WeightInfoCodex::<T>::create_proposal_set_membership_price()
+                WeightInfoCodex::<T>::create_proposal_set_membership_price(
+                    title_length.saturated_into(),
+                    description_length.saturated_into(),
+                )
             }
             ProposalDetails::CancelWorkingGroupLeadOpening(..) => {
                 WeightInfoCodex::<T>::create_proposal_cancel_working_group_lead_opening(
-                    title_length.saturated_into(),
                     description_length.saturated_into(),
                 )
             }
             ProposalDetails::SetCouncilBudgetIncrement(..) => {
-                WeightInfoCodex::<T>::create_proposal_set_council_budget_increment()
+                WeightInfoCodex::<T>::create_proposal_set_council_budget_increment(
+                    title_length.saturated_into(),
+                    description_length.saturated_into(),
+                )
             }
             ProposalDetails::SetCouncilorReward(..) => {
                 WeightInfoCodex::<T>::create_proposal_set_councilor_reward(
                     title_length.saturated_into(),
+                    description_length.saturated_into(),
                 )
             }
             ProposalDetails::SetInitialInvitationBalance(..) => {
@@ -966,16 +996,20 @@ impl<T: Trait> Module<T> {
                 )
             }
             ProposalDetails::SetInitialInvitationCount(..) => {
-                WeightInfoCodex::<T>::create_proposal_set_initial_invitation_count()
+                WeightInfoCodex::<T>::create_proposal_set_initial_invitation_count(
+                    title_length.saturated_into(),
+                    description_length.saturated_into(),
+                )
             }
             ProposalDetails::SetMembershipLeadInvitationQuota(..) => {
                 WeightInfoCodex::<T>::create_proposal_set_membership_lead_invitation_quota(
-                    title_length.saturated_into(),
+                    description_length.saturated_into(),
                 )
             }
             ProposalDetails::SetReferralCut(..) => {
                 WeightInfoCodex::<T>::create_proposal_set_referral_cut(
                     title_length.saturated_into(),
+                    description_length.saturated_into(),
                 )
             }
             ProposalDetails::CreateBlogPost(header, body) => {
@@ -997,10 +1031,24 @@ impl<T: Trait> Module<T> {
                 )
             }
             ProposalDetails::LockBlogPost(..) => {
-                WeightInfoCodex::<T>::create_proposal_lock_blog_post(title_length.saturated_into())
+                WeightInfoCodex::<T>::create_proposal_lock_blog_post(
+                    title_length.saturated_into(),
+                    description_length.saturated_into(),
+                )
             }
             ProposalDetails::UnlockBlogPost(..) => {
-                WeightInfoCodex::<T>::create_proposal_unlock_blog_post().saturated_into()
+                WeightInfoCodex::<T>::create_proposal_unlock_blog_post(
+                    title_length.saturated_into(),
+                    description_length.saturated_into(),
+                )
+                .saturated_into()
+            }
+            ProposalDetails::VetoProposal(..) => {
+                WeightInfoCodex::<T>::create_proposal_veto_proposal(
+                    title_length.saturated_into(),
+                    description_length.saturated_into(),
+                )
+                .saturated_into()
             }
         }
     }

+ 21 - 17
runtime-modules/proposals/codex/src/tests/mock.rs

@@ -595,6 +595,7 @@ impl crate::Trait for Test {
     type EditBlogPostProoposalParamters = DefaultProposalParameters;
     type LockBlogPostProposalParameters = DefaultProposalParameters;
     type UnlockBlogPostProposalParameters = DefaultProposalParameters;
+    type VetoProposalProposalParameters = DefaultProposalParameters;
 
     fn get_working_group_budget(working_group: WorkingGroup) -> BalanceOf<Test> {
         call_wg!(working_group<Test>, get_budget)
@@ -806,58 +807,58 @@ impl crate::WeightInfo for () {
     fn create_proposal_runtime_upgrade(_: u32, _: u32, _: u32) -> Weight {
         0
     }
-    fn create_proposal_funding_request(_: u32) -> Weight {
+    fn create_proposal_funding_request(_: u32, _: u32) -> Weight {
         0
     }
-    fn create_proposal_set_max_validator_count(_: u32) -> Weight {
+    fn create_proposal_set_max_validator_count(_: u32, _: u32) -> Weight {
         0
     }
-    fn create_proposal_create_working_group_lead_opening(_: u32) -> Weight {
+    fn create_proposal_create_working_group_lead_opening(_: u32, _: u32, _: u32) -> Weight {
         0
     }
-    fn create_proposal_fill_working_group_lead_opening() -> Weight {
+    fn create_proposal_fill_working_group_lead_opening(_: u32, _: u32) -> Weight {
         0
     }
-    fn create_proposal_update_working_group_budget(_: u32) -> Weight {
+    fn create_proposal_update_working_group_budget(_: u32, _: u32) -> Weight {
         0
     }
     fn create_proposal_decrease_working_group_lead_stake(_: u32, _: u32) -> Weight {
         0
     }
-    fn create_proposal_slash_working_group_lead(_: u32, _: u32) -> Weight {
+    fn create_proposal_slash_working_group_lead(_: u32) -> Weight {
         0
     }
-    fn create_proposal_set_working_group_lead_reward(_: u32) -> Weight {
+    fn create_proposal_set_working_group_lead_reward(_: u32, _: u32) -> Weight {
         0
     }
-    fn create_proposal_terminate_working_group_lead() -> Weight {
+    fn create_proposal_terminate_working_group_lead(_: u32, _: u32) -> Weight {
         0
     }
-    fn create_proposal_amend_constitution(_: u32, _: u32, _: u32) -> Weight {
+    fn create_proposal_amend_constitution(_: u32, _: u32) -> Weight {
         0
     }
-    fn create_proposal_cancel_working_group_lead_opening(_: u32, _: u32) -> Weight {
+    fn create_proposal_cancel_working_group_lead_opening(_: u32) -> Weight {
         0
     }
-    fn create_proposal_set_membership_price() -> Weight {
+    fn create_proposal_set_membership_price(_: u32, _: u32) -> Weight {
         0
     }
-    fn create_proposal_set_council_budget_increment() -> Weight {
+    fn create_proposal_set_council_budget_increment(_: u32, _: u32) -> Weight {
         0
     }
-    fn create_proposal_set_councilor_reward(_: u32) -> Weight {
+    fn create_proposal_set_councilor_reward(_: u32, _: u32) -> Weight {
         0
     }
     fn create_proposal_set_initial_invitation_balance(_: u32, _: u32) -> Weight {
         0
     }
-    fn create_proposal_set_initial_invitation_count() -> Weight {
+    fn create_proposal_set_initial_invitation_count(_: u32, _: u32) -> Weight {
         0
     }
     fn create_proposal_set_membership_lead_invitation_quota(_: u32) -> Weight {
         0
     }
-    fn create_proposal_set_referral_cut(_: u32) -> Weight {
+    fn create_proposal_set_referral_cut(_: u32, _: u32) -> Weight {
         0
     }
     fn create_proposal_create_blog_post(_: u32, _: u32, _: u32, _: u32) -> Weight {
@@ -866,10 +867,13 @@ impl crate::WeightInfo for () {
     fn create_proposal_edit_blog_post(_: u32, _: u32, _: u32, _: u32) -> Weight {
         0
     }
-    fn create_proposal_lock_blog_post(_: u32) -> Weight {
+    fn create_proposal_lock_blog_post(_: u32, _: u32) -> Weight {
         0
     }
-    fn create_proposal_unlock_blog_post() -> Weight {
+    fn create_proposal_unlock_blog_post(_: u32, _: u32) -> Weight {
+        0
+    }
+    fn create_proposal_veto_proposal(_: u32, _: u32) -> Weight {
         0
     }
     fn update_working_group_budget_positive_forum() -> Weight {

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

@@ -674,6 +674,59 @@ fn create_set_max_validator_count_proposal_common_checks_succeed() {
     });
 }
 
+#[test]
+fn create_veto_proposal_common_checks_succeed() {
+    initial_test_ext().execute_with(|| {
+        increase_total_balance_issuance_using_account_id(1, 500000);
+
+        let general_proposal_parameters_no_staking = GeneralProposalParameters::<Test> {
+            member_id: 1,
+            title: b"title".to_vec(),
+            description: b"body".to_vec(),
+            staking_account_id: None,
+            exact_execution_block: None,
+        };
+
+        let general_proposal_parameters = GeneralProposalParameters::<Test> {
+            member_id: 1,
+            title: b"title".to_vec(),
+            description: b"body".to_vec(),
+            staking_account_id: Some(1),
+            exact_execution_block: None,
+        };
+
+        let proposal_details = ProposalDetails::VetoProposal(0);
+
+        let proposal_fixture = ProposalTestFixture {
+            general_proposal_parameters: general_proposal_parameters.clone(),
+            proposal_details: proposal_details.clone(),
+            insufficient_rights_call: || {
+                ProposalCodex::create_proposal(
+                    RawOrigin::None.into(),
+                    general_proposal_parameters_no_staking.clone(),
+                    proposal_details.clone(),
+                )
+            },
+            empty_stake_call: || {
+                ProposalCodex::create_proposal(
+                    RawOrigin::Signed(1).into(),
+                    general_proposal_parameters_no_staking.clone(),
+                    proposal_details.clone(),
+                )
+            },
+            successful_call: || {
+                ProposalCodex::create_proposal(
+                    RawOrigin::Signed(1).into(),
+                    general_proposal_parameters.clone(),
+                    proposal_details.clone(),
+                )
+            },
+            proposal_parameters: <Test as crate::Trait>::VetoProposalProposalParameters::get(),
+        };
+        proposal_fixture.check_all();
+    });
+}
+
 #[test]
 fn create_create_blog_post_proposal_common_checks_succeed() {
     initial_test_ext().execute_with(|| {

+ 7 - 3
runtime-modules/proposals/codex/src/types.rs

@@ -24,6 +24,7 @@ pub type ProposalDetailsOf<T> = ProposalDetails<
     working_group::WorkerId<T>,
     working_group::OpeningId,
     blog::PostId,
+    <T as proposals_engine::Trait>::ProposalId,
 >;
 
 /// Kind of Balance for `Update Working Group Budget`.
@@ -39,7 +40,7 @@ pub enum BalanceKind {
 /// Proposal details provide voters the information required for the perceived voting.
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 #[derive(Encode, Decode, Clone, PartialEq, Debug, Eq)]
-pub enum ProposalDetails<Balance, BlockNumber, AccountId, WorkerId, OpeningId, PostId> {
+pub enum ProposalDetails<Balance, BlockNumber, AccountId, WorkerId, OpeningId, PostId, ProposalId> {
     /// The signal of the `Signal` proposal
     Signal(Vec<u8>),
 
@@ -116,10 +117,13 @@ pub enum ProposalDetails<Balance, BlockNumber, AccountId, WorkerId, OpeningId, P
 
     /// `Unlock Blog Post` proposal
     UnlockBlogPost(PostId),
+
+    /// `Veto Proposal` proposal
+    VetoProposal(ProposalId),
 }
 
-impl<Balance, BlockNumber, AccountId, WorkerId, OpeningId, ProposalId> Default
-    for ProposalDetails<Balance, BlockNumber, AccountId, WorkerId, OpeningId, ProposalId>
+impl<Balance, BlockNumber, AccountId, WorkerId, OpeningId, PostId, ProposalId> Default
+    for ProposalDetails<Balance, BlockNumber, AccountId, WorkerId, OpeningId, PostId, ProposalId>
 {
     fn default() -> Self {
         ProposalDetails::Signal(b"invalid proposal details".to_vec())

+ 3 - 6
runtime-modules/proposals/engine/src/lib.rs

@@ -528,18 +528,15 @@ decl_module! {
             ensure!(<Proposals<T>>::contains_key(proposal_id), Error::<T>::ProposalNotFound);
             let proposal = Self::proposals(proposal_id);
 
-            ensure!(
-                proposal.status.is_active_or_pending_execution(),
-                Error::<T>::ProposalFinalized
-            );
-
+            // Note: we don't need to check if the proposal is active pending execution or
+            // or pending constitutionality since if it in the storage `Proposals` it follows
+            // that it is in one of those states.
             //
             // == MUTATION SAFE ==
             //
 
             Self::finalize_proposal(proposal_id, proposal, ProposalDecision::Vetoed);
         }
-
     }
 }
 

+ 93 - 55
runtime-modules/proposals/engine/src/tests/mod.rs

@@ -716,7 +716,7 @@ fn cancel_proposal_fails_with_insufficient_rights() {
 }
 
 #[test]
-fn veto_proposal_succeeds() {
+fn veto_proposal_succeeds_during_voting_period() {
     initial_test_ext().execute_with(|| {
         let starting_block = 1;
         run_to_block_and_finalize(starting_block);
@@ -732,6 +732,98 @@ fn veto_proposal_succeeds() {
         // internal active proposal counter check
         assert_eq!(<ActiveProposalCount>::get(), 1);
 
+        assert!(matches!(
+            <Proposals<Test>>::get(proposal_id).status,
+            ProposalStatus::Active{..}
+        ));
+
+        let veto_proposal = VetoProposalFixture::new(proposal_id);
+        veto_proposal.veto_and_assert(Ok(()));
+
+        EventFixture::assert_last_crate_event(RawEvent::ProposalDecisionMade(
+            proposal_id,
+            ProposalDecision::Vetoed,
+        ));
+
+        assert!(!<crate::Proposals<Test>>::contains_key(proposal_id));
+        // internal active proposal counter check
+        assert_eq!(<ActiveProposalCount>::get(), 0);
+    });
+}
+
+#[test]
+fn veto_proposal_succeeds_during_grace_period() {
+    initial_test_ext().execute_with(|| {
+        let starting_block = 1;
+        run_to_block_and_finalize(starting_block);
+
+        // internal active proposal counter check
+        assert_eq!(<ActiveProposalCount>::get(), 0);
+
+        let parameters_fixture = ProposalParametersFixture::default().with_grace_period(10);
+        let dummy_proposal =
+            DummyProposalFixture::default().with_parameters(parameters_fixture.params());
+        let proposal_id = dummy_proposal.create_proposal_and_assert(Ok(1)).unwrap();
+
+        // internal active proposal counter check
+        assert_eq!(<ActiveProposalCount>::get(), 1);
+
+        let mut vote_generator = VoteGenerator::new(proposal_id);
+        vote_generator.vote_and_assert_ok(VoteKind::Approve);
+        vote_generator.vote_and_assert_ok(VoteKind::Approve);
+        vote_generator.vote_and_assert_ok(VoteKind::Approve);
+        vote_generator.vote_and_assert_ok(VoteKind::Approve);
+
+        run_to_block_and_finalize(6);
+
+        assert!(matches!(
+            <Proposals<Test>>::get(proposal_id).status,
+            ProposalStatus::PendingExecution{..}
+        ));
+
+        let veto_proposal = VetoProposalFixture::new(proposal_id);
+        veto_proposal.veto_and_assert(Ok(()));
+
+        EventFixture::assert_last_crate_event(RawEvent::ProposalDecisionMade(
+            proposal_id,
+            ProposalDecision::Vetoed,
+        ));
+
+        assert!(!<crate::Proposals<Test>>::contains_key(proposal_id));
+        // internal active proposal counter check
+        assert_eq!(<ActiveProposalCount>::get(), 0);
+    });
+}
+
+#[test]
+fn veto_proposal_succeeds_during_pending_constitutionality() {
+    initial_test_ext().execute_with(|| {
+        let starting_block = 1;
+        run_to_block_and_finalize(starting_block);
+
+        // internal active proposal counter check
+        assert_eq!(<ActiveProposalCount>::get(), 0);
+
+        let parameters_fixture = ProposalParametersFixture::default().with_constitutionality(10);
+        let dummy_proposal =
+            DummyProposalFixture::default().with_parameters(parameters_fixture.params());
+        let proposal_id = dummy_proposal.create_proposal_and_assert(Ok(1)).unwrap();
+
+        // internal active proposal counter check
+        assert_eq!(<ActiveProposalCount>::get(), 1);
+
+        let mut vote_generator = VoteGenerator::new(proposal_id);
+        vote_generator.vote_and_assert_ok(VoteKind::Approve);
+        vote_generator.vote_and_assert_ok(VoteKind::Approve);
+        vote_generator.vote_and_assert_ok(VoteKind::Approve);
+
+        run_to_block_and_finalize(6);
+
+        assert!(matches!(
+            <Proposals<Test>>::get(proposal_id).status,
+            ProposalStatus::PendingConstitutionality{..}
+        ));
+
         let veto_proposal = VetoProposalFixture::new(proposal_id);
         veto_proposal.veto_and_assert(Ok(()));
 
@@ -1098,60 +1190,6 @@ fn cancel_pending_constitutionality_proposal_by_runtime() {
     });
 }
 
-#[test]
-fn proposal_execution_vetoed_successfully_during_the_grace_period() {
-    initial_test_ext().execute_with(|| {
-        let starting_block = 1;
-        run_to_block(starting_block);
-
-        let parameters_fixture = ProposalParametersFixture::default().with_grace_period(3);
-        let dummy_proposal =
-            DummyProposalFixture::default().with_parameters(parameters_fixture.params());
-
-        let proposal_id = dummy_proposal.create_proposal_and_assert(Ok(1)).unwrap();
-
-        let mut vote_generator = VoteGenerator::new(proposal_id);
-        vote_generator.vote_and_assert_ok(VoteKind::Approve);
-        vote_generator.vote_and_assert_ok(VoteKind::Approve);
-        vote_generator.vote_and_assert_ok(VoteKind::Approve);
-        vote_generator.vote_and_assert_ok(VoteKind::Approve);
-
-        run_to_block(3);
-
-        let pre_veto_proposal = <crate::Proposals<Test>>::get(proposal_id);
-
-        assert_eq!(
-            pre_veto_proposal,
-            Proposal {
-                parameters: parameters_fixture.params(),
-                proposer_id: 1,
-                activated_at: starting_block,
-                status: ProposalStatus::approved(
-                    ApprovedProposalDecision::PendingExecution,
-                    starting_block + 1
-                ),
-                voting_results: VotingResults {
-                    abstentions: 0,
-                    approvals: 4,
-                    rejections: 0,
-                    slashes: 0,
-                },
-                exact_execution_block: None,
-                nr_of_council_confirmations: 1,
-                staking_account_id: None,
-            }
-        );
-
-        let veto_proposal = VetoProposalFixture::new(proposal_id);
-        veto_proposal.veto_and_assert(Ok(()));
-
-        EventFixture::assert_last_crate_event(RawEvent::ProposalDecisionMade(
-            proposal_id,
-            ProposalDecision::Vetoed,
-        ));
-    });
-}
-
 #[test]
 fn proposal_execution_succeeds_after_the_grace_period() {
     initial_test_ext().execute_with(|| {

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

@@ -135,6 +135,9 @@ impl ProposalEncoder<Runtime> for ExtrinsicProposalEncoder {
             ProposalDetails::UnlockBlogPost(post_id) => {
                 Call::Blog(blog::Call::unlock_post(post_id))
             }
+            ProposalDetails::VetoProposal(proposal_id) => {
+                Call::ProposalsEngine(proposals_engine::Call::veto_proposal(proposal_id))
+            }
         };
 
         call.encode()

+ 1 - 0
runtime/src/lib.rs

@@ -865,6 +865,7 @@ impl proposals_codex::Trait for Runtime {
     type EditBlogPostProoposalParamters = EditBlogPostProoposalParamters;
     type LockBlogPostProposalParameters = LockBlogPostProposalParameters;
     type UnlockBlogPostProposalParameters = UnlockBlogPostProposalParameters;
+    type VetoProposalProposalParameters = VetoProposalProposalParameters;
     type WeightInfo = weights::proposals_codex::WeightInfo;
     fn get_working_group_budget(working_group: WorkingGroup) -> Balance {
         call_wg!(working_group, get_budget)

+ 26 - 16
runtime/src/proposals_configuration/defaults.rs

@@ -288,62 +288,72 @@ pub(crate) fn set_invitation_count_proposal() -> ProposalParameters<BlockNumber,
     }
 }
 
-// TODO: decide on paramaters
 // Proposal parameters for the 'Create Blog Post' proposal
 pub(crate) fn create_blog_post_proposal() -> ProposalParameters<BlockNumber, Balance> {
     ProposalParameters {
         voting_period: 72000,
-        grace_period: 43200,
+        grace_period: 14400,
         approval_quorum_percentage: 60,
-        approval_threshold_percentage: 75,
+        approval_threshold_percentage: 80,
         slashing_quorum_percentage: 60,
         slashing_threshold_percentage: 80,
-        required_stake: Some(50_000),
+        required_stake: Some(25000),
         constitutionality: 1,
     }
 }
 
-// TODO: decide on paramaters
 // Proposal parameters for the 'Edit Blog Post' proposal
 pub(crate) fn edit_blog_post_proposal() -> ProposalParameters<BlockNumber, Balance> {
     ProposalParameters {
         voting_period: 72000,
-        grace_period: 43200,
+        grace_period: 14400,
         approval_quorum_percentage: 60,
-        approval_threshold_percentage: 75,
+        approval_threshold_percentage: 80,
         slashing_quorum_percentage: 60,
         slashing_threshold_percentage: 80,
-        required_stake: Some(50_000),
+        required_stake: Some(25000),
         constitutionality: 1,
     }
 }
 
-// TODO: decide on paramaters
 // Proposal parameters for the 'Lock Blog Post' proposal
 pub(crate) fn lock_blog_post_proposal() -> ProposalParameters<BlockNumber, Balance> {
     ProposalParameters {
         voting_period: 72000,
-        grace_period: 43200,
+        grace_period: 14400,
         approval_quorum_percentage: 60,
-        approval_threshold_percentage: 75,
+        approval_threshold_percentage: 80,
         slashing_quorum_percentage: 60,
         slashing_threshold_percentage: 80,
-        required_stake: Some(50_000),
+        required_stake: Some(25000),
         constitutionality: 1,
     }
 }
 
-// TODO: decide on paramaters
 // Proposal parameters for the 'Unlock Blog Post' proposal
 pub(crate) fn unlock_blog_post_proposal() -> ProposalParameters<BlockNumber, Balance> {
     ProposalParameters {
         voting_period: 72000,
-        grace_period: 43200,
+        grace_period: 14400,
         approval_quorum_percentage: 60,
-        approval_threshold_percentage: 75,
+        approval_threshold_percentage: 80,
         slashing_quorum_percentage: 60,
         slashing_threshold_percentage: 80,
-        required_stake: Some(50_000),
+        required_stake: Some(25000),
+        constitutionality: 1,
+    }
+}
+
+// Proposal parameters for the 'Veto Proposal' proposal
+pub(crate) fn veto_proposal_proposal() -> ProposalParameters<BlockNumber, Balance> {
+    ProposalParameters {
+        voting_period: 72200, // The longest grace period
+        grace_period: 0,
+        approval_quorum_percentage: 75,
+        approval_threshold_percentage: 80,
+        slashing_quorum_percentage: 60,
+        slashing_threshold_percentage: 66,
+        required_stake: Some(1_000_000),
         constitutionality: 1,
     }
 }

+ 6 - 1
runtime/src/proposals_configuration/mod.rs

@@ -61,6 +61,8 @@ parameter_types! {
         ALL_PROPOSALS_PARAMETERS.lock_blog_post_proposal;
     pub UnlockBlogPostProposalParameters: ProposalParameters<BlockNumber, Balance> =
         ALL_PROPOSALS_PARAMETERS.unlock_blog_post_proposal;
+    pub VetoProposalProposalParameters: ProposalParameters<BlockNumber, Balance> =
+        ALL_PROPOSALS_PARAMETERS.veto_proposal_proposal;
 }
 
 ///////////
@@ -90,6 +92,7 @@ struct AllProposalsParameters {
     pub edit_blog_post_proposal: ProposalParameters<BlockNumber, Balance>,
     pub lock_blog_post_proposal: ProposalParameters<BlockNumber, Balance>,
     pub unlock_blog_post_proposal: ProposalParameters<BlockNumber, Balance>,
+    pub veto_proposal_proposal: ProposalParameters<BlockNumber, Balance>,
 }
 
 // to initialize parameters only once.
@@ -189,7 +192,8 @@ fn convert_json_object_to_proposal_parameters(
         init_proposal_parameter_object!(params, jo.clone(), create_blog_post_proposal);
         init_proposal_parameter_object!(params, jo.clone(), edit_blog_post_proposal);
         init_proposal_parameter_object!(params, jo.clone(), lock_blog_post_proposal);
-        init_proposal_parameter_object!(params, jo, unlock_blog_post_proposal);
+        init_proposal_parameter_object!(params, jo.clone(), unlock_blog_post_proposal);
+        init_proposal_parameter_object!(params, jo, veto_proposal_proposal);
     }
 
     params
@@ -324,5 +328,6 @@ fn default_parameters() -> AllProposalsParameters {
         edit_blog_post_proposal: defaults::edit_blog_post_proposal(),
         lock_blog_post_proposal: defaults::lock_blog_post_proposal(),
         unlock_blog_post_proposal: defaults::unlock_blog_post_proposal(),
+        veto_proposal_proposal: defaults::veto_proposal_proposal(),
     }
 }

+ 10 - 0
runtime/src/proposals_configuration/sample_proposal_parameters.json

@@ -239,5 +239,15 @@
         "slashing_threshold_percentage": 6,
         "required_stake": 7,
         "constitutionality": 8
+    },
+    "veto_proposal_proposal": {
+        "voting_period": 1,
+        "grace_period": 2,
+        "approval_quorum_percentage": 3,
+        "approval_threshold_percentage": 4,
+        "slashing_quorum_percentage": 5,
+        "slashing_threshold_percentage": 6,
+        "required_stake": 7,
+        "constitutionality": 8
     }
 }

+ 9 - 0
runtime/src/proposals_configuration/tests.rs

@@ -228,3 +228,12 @@ fn proposal_parameters_are_initialized_unlock_blog_post_proposal() {
 
     assert_eq!(default_proposal_parameters(), actual_params);
 }
+
+// Enable during the conditional compilation tests.
+#[test]
+#[ignore]
+fn proposal_parameters_are_initialized_veto_proposal_proposal() {
+    let actual_params = super::VetoProposalProposalParameters::get();
+
+    assert_eq!(default_proposal_parameters(), actual_params);
+}

+ 62 - 2
runtime/src/tests/proposals_integration/mod.rs

@@ -494,10 +494,10 @@ where
                 let lead_account_id = [self.lead_id as u8; 32].into();
                 set_membership_leader(lead_account_id, self.lead_id);
             }
-
-            increase_total_balance_issuance_using_account_id(account_id.clone().into(), 1_500_000);
         }
 
+        increase_total_balance_issuance_using_account_id(account_id.clone().into(), 1_500_000);
+
         assert_eq!((self.successful_call)(), Ok(()));
 
         // Council size is 3
@@ -727,6 +727,66 @@ fn unlock_blog_post_proposal_execution_succeeds() {
     });
 }
 
+#[test]
+fn veto_proposal_proposal_execution_succeeds() {
+    initial_test_ext().execute_with(|| {
+        let member_id = 10;
+        let account_id: [u8; 32] = [member_id; 32];
+        let council_budget = 5_000_000;
+        assert!(Council::set_budget(RawOrigin::Root.into(), council_budget).is_ok());
+
+        let proposal_id = ProposalsEngine::proposal_count() + 1;
+        let codex_extrinsic_test_fixture = CodexProposalTestFixture::default_for_call(|| {
+            let general_proposal_parameters = GeneralProposalParameters::<Runtime> {
+                member_id: member_id.into(),
+                title: b"title".to_vec(),
+                description: b"body".to_vec(),
+                staking_account_id: Some(account_id.into()),
+                exact_execution_block: None,
+            };
+
+            ProposalCodex::create_proposal(
+                RawOrigin::Signed(account_id.clone().into()).into(),
+                general_proposal_parameters,
+                ProposalDetails::AmendConstitution(vec![0u8]),
+            )
+        })
+        .with_member_id(member_id as u64);
+
+        codex_extrinsic_test_fixture.call_extrinsic_and_assert();
+
+        assert!(proposals_engine::Proposals::<Runtime>::contains_key(1));
+
+        let member_id = 14;
+        let account_id: [u8; 32] = [member_id; 32];
+
+        let codex_extrinsic_test_fixture = CodexProposalTestFixture::default_for_call(|| {
+            let general_proposal_parameters = GeneralProposalParameters::<Runtime> {
+                member_id: member_id.into(),
+                title: b"title".to_vec(),
+                description: b"body".to_vec(),
+                staking_account_id: Some(account_id.into()),
+                exact_execution_block: None,
+            };
+
+            ProposalCodex::create_proposal(
+                RawOrigin::Signed(account_id.clone().into()).into(),
+                general_proposal_parameters,
+                ProposalDetails::VetoProposal(proposal_id),
+            )
+        })
+        .with_member_id(member_id as u64)
+        .with_expected_proposal_id(2)
+        .with_setup_enviroment(false);
+
+        assert!(proposals_engine::Proposals::<Runtime>::contains_key(1));
+
+        codex_extrinsic_test_fixture.call_extrinsic_and_assert();
+
+        assert!(!proposals_engine::Proposals::<Runtime>::contains_key(1));
+    });
+}
+
 #[test]
 fn set_validator_count_proposal_execution_succeeds() {
     initial_test_ext().execute_with(|| {

+ 138 - 123
runtime/src/weights/proposals_codex.rs

@@ -8,214 +8,229 @@ use frame_support::weights::{constants::RocksDbWeight as DbWeight, Weight};
 pub struct WeightInfo;
 impl proposals_codex::WeightInfo for WeightInfo {
     fn execute_signal_proposal(i: u32) -> Weight {
-        (14_205_000 as Weight).saturating_add((36_000 as Weight).saturating_mul(i as Weight))
+        (84_026_000 as Weight).saturating_add((145_000 as Weight).saturating_mul(i as Weight))
     }
     fn create_proposal_signal(i: u32, t: u32, d: u32) -> Weight {
-        (381_500_000 as Weight)
-            .saturating_add((280_000 as Weight).saturating_mul(i as Weight))
-            .saturating_add((4_369_000 as Weight).saturating_mul(t as Weight))
-            .saturating_add((56_000 as Weight).saturating_mul(d as Weight))
+        (0 as Weight)
+            .saturating_add((376_000 as Weight).saturating_mul(i as Weight))
+            .saturating_add((4_900_000 as Weight).saturating_mul(t as Weight))
+            .saturating_add((365_000 as Weight).saturating_mul(d as Weight))
             .saturating_add(DbWeight::get().reads(6 as Weight))
-            .saturating_add(DbWeight::get().writes(10 as Weight))
+            .saturating_add(DbWeight::get().writes(9 as Weight))
     }
     fn create_proposal_runtime_upgrade(i: u32, t: u32, d: u32) -> Weight {
-        (417_621_000 as Weight)
-            .saturating_add((282_000 as Weight).saturating_mul(i as Weight))
-            .saturating_add((2_246_000 as Weight).saturating_mul(t as Weight))
-            .saturating_add((47_000 as Weight).saturating_mul(d as Weight))
+        (0 as Weight)
+            .saturating_add((378_000 as Weight).saturating_mul(i as Weight))
+            .saturating_add((2_563_000 as Weight).saturating_mul(t as Weight))
+            .saturating_add((390_000 as Weight).saturating_mul(d as Weight))
             .saturating_add(DbWeight::get().reads(6 as Weight))
-            .saturating_add(DbWeight::get().writes(10 as Weight))
+            .saturating_add(DbWeight::get().writes(9 as Weight))
     }
-    // WARNING! Some components were not used: ["t", "d"]
-    fn create_proposal_funding_request(i: u32) -> Weight {
-        (1_073_701_000 as Weight)
-            .saturating_add((20_213_000 as Weight).saturating_mul(i as Weight))
+    // WARNING! Some components were not used: ["t"]
+    fn create_proposal_funding_request(i: u32, d: u32) -> Weight {
+        (859_709_000 as Weight)
+            .saturating_add((19_988_000 as Weight).saturating_mul(i as Weight))
+            .saturating_add((160_000 as Weight).saturating_mul(d as Weight))
             .saturating_add(DbWeight::get().reads(6 as Weight))
-            .saturating_add(DbWeight::get().writes(10 as Weight))
+            .saturating_add(DbWeight::get().writes(9 as Weight))
     }
-    // WARNING! Some components were not used: ["t"]
-    fn create_proposal_set_max_validator_count(d: u32) -> Weight {
-        (680_435_000 as Weight)
-            .saturating_add((1_000 as Weight).saturating_mul(d as Weight))
+    fn create_proposal_set_max_validator_count(t: u32, d: u32) -> Weight {
+        (737_041_000 as Weight)
+            .saturating_add((436_000 as Weight).saturating_mul(t as Weight))
+            .saturating_add((232_000 as Weight).saturating_mul(d as Weight))
             .saturating_add(DbWeight::get().reads(7 as Weight))
-            .saturating_add(DbWeight::get().writes(10 as Weight))
+            .saturating_add(DbWeight::get().writes(9 as Weight))
     }
-    // WARNING! Some components were not used: ["t", "d"]
-    fn create_proposal_create_working_group_lead_opening(i: u32) -> Weight {
-        (1_658_073_000 as Weight)
-            .saturating_add((401_000 as Weight).saturating_mul(i as Weight))
+    fn create_proposal_veto_proposal(t: u32, d: u32) -> Weight {
+        (714_146_000 as Weight)
+            .saturating_add((667_000 as Weight).saturating_mul(t as Weight))
+            .saturating_add((235_000 as Weight).saturating_mul(d as Weight))
             .saturating_add(DbWeight::get().reads(6 as Weight))
-            .saturating_add(DbWeight::get().writes(10 as Weight))
+            .saturating_add(DbWeight::get().writes(9 as Weight))
     }
-    // WARNING! Some components were not used: ["t", "d"]
-    fn create_proposal_fill_working_group_lead_opening() -> Weight {
-        (688_697_000 as Weight)
+    fn create_proposal_create_working_group_lead_opening(i: u32, t: u32, d: u32) -> Weight {
+        (318_298_000 as Weight)
+            .saturating_add((439_000 as Weight).saturating_mul(i as Weight))
+            .saturating_add((1_090_000 as Weight).saturating_mul(t as Weight))
+            .saturating_add((346_000 as Weight).saturating_mul(d as Weight))
             .saturating_add(DbWeight::get().reads(6 as Weight))
-            .saturating_add(DbWeight::get().writes(10 as Weight))
+            .saturating_add(DbWeight::get().writes(9 as Weight))
     }
-    // WARNING! Some components were not used: ["t"]
-    fn create_proposal_update_working_group_budget(d: u32) -> Weight {
-        (677_232_000 as Weight)
-            .saturating_add((1_000 as Weight).saturating_mul(d as Weight))
+    fn create_proposal_fill_working_group_lead_opening(t: u32, d: u32) -> Weight {
+        (735_636_000 as Weight)
+            .saturating_add((518_000 as Weight).saturating_mul(t as Weight))
+            .saturating_add((235_000 as Weight).saturating_mul(d as Weight))
             .saturating_add(DbWeight::get().reads(6 as Weight))
-            .saturating_add(DbWeight::get().writes(10 as Weight))
+            .saturating_add(DbWeight::get().writes(9 as Weight))
     }
-    fn create_proposal_decrease_working_group_lead_stake(t: u32, d: u32) -> Weight {
-        (673_696_000 as Weight)
-            .saturating_add((57_000 as Weight).saturating_mul(t as Weight))
-            .saturating_add((1_000 as Weight).saturating_mul(d as Weight))
+    fn create_proposal_update_working_group_budget(t: u32, d: u32) -> Weight {
+        (751_256_000 as Weight)
+            .saturating_add((235_000 as Weight).saturating_mul(t as Weight))
+            .saturating_add((234_000 as Weight).saturating_mul(d as Weight))
             .saturating_add(DbWeight::get().reads(6 as Weight))
-            .saturating_add(DbWeight::get().writes(10 as Weight))
+            .saturating_add(DbWeight::get().writes(9 as Weight))
     }
-    fn create_proposal_slash_working_group_lead(t: u32, d: u32) -> Weight {
-        (665_717_000 as Weight)
-            .saturating_add((416_000 as Weight).saturating_mul(t as Weight))
-            .saturating_add((2_000 as Weight).saturating_mul(d as Weight))
+    fn create_proposal_decrease_working_group_lead_stake(t: u32, d: u32) -> Weight {
+        (737_989_000 as Weight)
+            .saturating_add((349_000 as Weight).saturating_mul(t as Weight))
+            .saturating_add((236_000 as Weight).saturating_mul(d as Weight))
             .saturating_add(DbWeight::get().reads(6 as Weight))
-            .saturating_add(DbWeight::get().writes(10 as Weight))
+            .saturating_add(DbWeight::get().writes(9 as Weight))
     }
     // WARNING! Some components were not used: ["t"]
-    fn create_proposal_set_working_group_lead_reward(d: u32) -> Weight {
-        (681_995_000 as Weight)
-            .saturating_add((10_000 as Weight).saturating_mul(d as Weight))
+    fn create_proposal_slash_working_group_lead(d: u32) -> Weight {
+        (829_696_000 as Weight)
+            .saturating_add((230_000 as Weight).saturating_mul(d as Weight))
             .saturating_add(DbWeight::get().reads(6 as Weight))
-            .saturating_add(DbWeight::get().writes(10 as Weight))
+            .saturating_add(DbWeight::get().writes(9 as Weight))
     }
-    // WARNING! Some components were not used: ["t", "d"]
-    fn create_proposal_terminate_working_group_lead() -> Weight {
-        (672_205_000 as Weight)
+    fn create_proposal_set_working_group_lead_reward(t: u32, d: u32) -> Weight {
+        (692_873_000 as Weight)
+            .saturating_add((1_313_000 as Weight).saturating_mul(t as Weight))
+            .saturating_add((237_000 as Weight).saturating_mul(d as Weight))
             .saturating_add(DbWeight::get().reads(6 as Weight))
-            .saturating_add(DbWeight::get().writes(10 as Weight))
+            .saturating_add(DbWeight::get().writes(9 as Weight))
     }
-    fn create_proposal_amend_constitution(i: u32, t: u32, d: u32) -> Weight {
-        (415_625_000 as Weight)
-            .saturating_add((298_000 as Weight).saturating_mul(i as Weight))
-            .saturating_add((3_229_000 as Weight).saturating_mul(t as Weight))
-            .saturating_add((34_000 as Weight).saturating_mul(d as Weight))
+    fn create_proposal_terminate_working_group_lead(t: u32, d: u32) -> Weight {
+        (319_918_000 as Weight)
+            .saturating_add((9_527_000 as Weight).saturating_mul(t as Weight))
+            .saturating_add((324_000 as Weight).saturating_mul(d as Weight))
             .saturating_add(DbWeight::get().reads(6 as Weight))
-            .saturating_add(DbWeight::get().writes(10 as Weight))
+            .saturating_add(DbWeight::get().writes(9 as Weight))
     }
-    fn create_proposal_cancel_working_group_lead_opening(t: u32, d: u32) -> Weight {
-        (650_522_000 as Weight)
-            .saturating_add((406_000 as Weight).saturating_mul(t as Weight))
-            .saturating_add((5_000 as Weight).saturating_mul(d as Weight))
+    // WARNING! Some components were not used: ["t"]
+    fn create_proposal_amend_constitution(i: u32, d: u32) -> Weight {
+        (914_780_000 as Weight)
+            .saturating_add((362_000 as Weight).saturating_mul(i as Weight))
+            .saturating_add((405_000 as Weight).saturating_mul(d as Weight))
+            .saturating_add(DbWeight::get().reads(6 as Weight))
+            .saturating_add(DbWeight::get().writes(9 as Weight))
+    }
+    // WARNING! Some components were not used: ["t"]
+    fn create_proposal_cancel_working_group_lead_opening(d: u32) -> Weight {
+        (837_566_000 as Weight)
+            .saturating_add((217_000 as Weight).saturating_mul(d as Weight))
             .saturating_add(DbWeight::get().reads(6 as Weight))
-            .saturating_add(DbWeight::get().writes(10 as Weight))
+            .saturating_add(DbWeight::get().writes(9 as Weight))
     }
-    // WARNING! Some components were not used: ["t", "d"]
-    fn create_proposal_set_membership_price() -> Weight {
-        (688_555_000 as Weight)
+    fn create_proposal_set_membership_price(t: u32, d: u32) -> Weight {
+        (700_754_000 as Weight)
+            .saturating_add((788_000 as Weight).saturating_mul(t as Weight))
+            .saturating_add((236_000 as Weight).saturating_mul(d as Weight))
             .saturating_add(DbWeight::get().reads(6 as Weight))
-            .saturating_add(DbWeight::get().writes(10 as Weight))
+            .saturating_add(DbWeight::get().writes(9 as Weight))
     }
-    // WARNING! Some components were not used: ["t", "d"]
-    fn create_proposal_set_council_budget_increment() -> Weight {
-        (677_145_000 as Weight)
+    fn create_proposal_set_council_budget_increment(t: u32, d: u32) -> Weight {
+        (729_517_000 as Weight)
+            .saturating_add((446_000 as Weight).saturating_mul(t as Weight))
+            .saturating_add((231_000 as Weight).saturating_mul(d as Weight))
             .saturating_add(DbWeight::get().reads(6 as Weight))
-            .saturating_add(DbWeight::get().writes(10 as Weight))
+            .saturating_add(DbWeight::get().writes(9 as Weight))
     }
-    // WARNING! Some components were not used: ["d"]
-    fn create_proposal_set_councilor_reward(t: u32) -> Weight {
-        (691_635_000 as Weight)
-            .saturating_add((538_000 as Weight).saturating_mul(t as Weight))
+    fn create_proposal_set_councilor_reward(t: u32, d: u32) -> Weight {
+        (728_569_000 as Weight)
+            .saturating_add((445_000 as Weight).saturating_mul(t as Weight))
+            .saturating_add((231_000 as Weight).saturating_mul(d as Weight))
             .saturating_add(DbWeight::get().reads(6 as Weight))
-            .saturating_add(DbWeight::get().writes(10 as Weight))
+            .saturating_add(DbWeight::get().writes(9 as Weight))
     }
     fn create_proposal_set_initial_invitation_balance(t: u32, d: u32) -> Weight {
-        (647_455_000 as Weight)
-            .saturating_add((605_000 as Weight).saturating_mul(t as Weight))
-            .saturating_add((6_000 as Weight).saturating_mul(d as Weight))
+        (720_097_000 as Weight)
+            .saturating_add((603_000 as Weight).saturating_mul(t as Weight))
+            .saturating_add((233_000 as Weight).saturating_mul(d as Weight))
             .saturating_add(DbWeight::get().reads(6 as Weight))
-            .saturating_add(DbWeight::get().writes(10 as Weight))
+            .saturating_add(DbWeight::get().writes(9 as Weight))
     }
-    // WARNING! Some components were not used: ["t", "d"]
-    fn create_proposal_set_initial_invitation_count() -> Weight {
-        (708_072_000 as Weight)
+    fn create_proposal_set_initial_invitation_count(t: u32, d: u32) -> Weight {
+        (718_767_000 as Weight)
+            .saturating_add((591_000 as Weight).saturating_mul(t as Weight))
+            .saturating_add((233_000 as Weight).saturating_mul(d as Weight))
             .saturating_add(DbWeight::get().reads(6 as Weight))
-            .saturating_add(DbWeight::get().writes(10 as Weight))
+            .saturating_add(DbWeight::get().writes(9 as Weight))
     }
-    // WARNING! Some components were not used: ["d"]
-    fn create_proposal_set_membership_lead_invitation_quota(t: u32) -> Weight {
-        (729_756_000 as Weight)
-            .saturating_add((462_000 as Weight).saturating_mul(t as Weight))
+    // WARNING! Some components were not used: ["t"]
+    fn create_proposal_set_membership_lead_invitation_quota(d: u32) -> Weight {
+        (794_786_000 as Weight)
+            .saturating_add((230_000 as Weight).saturating_mul(d as Weight))
             .saturating_add(DbWeight::get().reads(6 as Weight))
-            .saturating_add(DbWeight::get().writes(10 as Weight))
+            .saturating_add(DbWeight::get().writes(9 as Weight))
     }
-    // WARNING! Some components were not used: ["d"]
-    fn create_proposal_set_referral_cut(t: u32) -> Weight {
-        (669_708_000 as Weight)
-            .saturating_add((263_000 as Weight).saturating_mul(t as Weight))
+    fn create_proposal_set_referral_cut(t: u32, d: u32) -> Weight {
+        (727_615_000 as Weight)
+            .saturating_add((451_000 as Weight).saturating_mul(t as Weight))
+            .saturating_add((235_000 as Weight).saturating_mul(d as Weight))
             .saturating_add(DbWeight::get().reads(6 as Weight))
-            .saturating_add(DbWeight::get().writes(10 as Weight))
+            .saturating_add(DbWeight::get().writes(9 as Weight))
     }
     fn create_proposal_create_blog_post(t: u32, d: u32, h: u32, b: u32) -> Weight {
         (0 as Weight)
-            .saturating_add((26_565_000 as Weight).saturating_mul(t as Weight))
-            .saturating_add((473_000 as Weight).saturating_mul(d as Weight))
-            .saturating_add((389_000 as Weight).saturating_mul(h as Weight))
-            .saturating_add((392_000 as Weight).saturating_mul(b as Weight))
+            .saturating_add((30_282_000 as Weight).saturating_mul(t as Weight))
+            .saturating_add((746_000 as Weight).saturating_mul(d as Weight))
+            .saturating_add((323_000 as Weight).saturating_mul(h as Weight))
+            .saturating_add((352_000 as Weight).saturating_mul(b as Weight))
             .saturating_add(DbWeight::get().reads(6 as Weight))
-            .saturating_add(DbWeight::get().writes(10 as Weight))
+            .saturating_add(DbWeight::get().writes(9 as Weight))
     }
     fn create_proposal_edit_blog_post(t: u32, d: u32, h: u32, b: u32) -> Weight {
-        (0 as Weight)
-            .saturating_add((51_663_000 as Weight).saturating_mul(t as Weight))
-            .saturating_add((415_000 as Weight).saturating_mul(d as Weight))
-            .saturating_add((381_000 as Weight).saturating_mul(h as Weight))
-            .saturating_add((408_000 as Weight).saturating_mul(b as Weight))
+        (528_348_000 as Weight)
+            .saturating_add((13_015_000 as Weight).saturating_mul(t as Weight))
+            .saturating_add((737_000 as Weight).saturating_mul(d as Weight))
+            .saturating_add((318_000 as Weight).saturating_mul(h as Weight))
+            .saturating_add((356_000 as Weight).saturating_mul(b as Weight))
             .saturating_add(DbWeight::get().reads(6 as Weight))
-            .saturating_add(DbWeight::get().writes(10 as Weight))
+            .saturating_add(DbWeight::get().writes(9 as Weight))
     }
-    // WARNING! Some components were not used: ["d"]
-    fn create_proposal_lock_blog_post(t: u32) -> Weight {
-        (732_383_000 as Weight)
-            .saturating_add((13_000 as Weight).saturating_mul(t as Weight))
+    fn create_proposal_lock_blog_post(t: u32, d: u32) -> Weight {
+        (633_768_000 as Weight)
+            .saturating_add((2_369_000 as Weight).saturating_mul(t as Weight))
+            .saturating_add((241_000 as Weight).saturating_mul(d as Weight))
             .saturating_add(DbWeight::get().reads(6 as Weight))
-            .saturating_add(DbWeight::get().writes(10 as Weight))
+            .saturating_add(DbWeight::get().writes(9 as Weight))
     }
-    // WARNING! Some components were not used: ["t", "d"]
-    fn create_proposal_unlock_blog_post() -> Weight {
-        (670_647_000 as Weight)
+    fn create_proposal_unlock_blog_post(t: u32, d: u32) -> Weight {
+        (742_217_000 as Weight)
+            .saturating_add((523_000 as Weight).saturating_mul(t as Weight))
+            .saturating_add((239_000 as Weight).saturating_mul(d as Weight))
             .saturating_add(DbWeight::get().reads(6 as Weight))
-            .saturating_add(DbWeight::get().writes(10 as Weight))
+            .saturating_add(DbWeight::get().writes(9 as Weight))
     }
     fn update_working_group_budget_positive_forum() -> Weight {
-        (102_611_000 as Weight)
+        (173_903_000 as Weight)
             .saturating_add(DbWeight::get().reads(2 as Weight))
             .saturating_add(DbWeight::get().writes(2 as Weight))
     }
     fn update_working_group_budget_negative_forum() -> Weight {
-        (102_707_000 as Weight)
+        (170_026_000 as Weight)
             .saturating_add(DbWeight::get().reads(2 as Weight))
             .saturating_add(DbWeight::get().writes(2 as Weight))
     }
     fn update_working_group_budget_positive_storage() -> Weight {
-        (102_791_000 as Weight)
+        (168_902_000 as Weight)
             .saturating_add(DbWeight::get().reads(2 as Weight))
             .saturating_add(DbWeight::get().writes(2 as Weight))
     }
     fn update_working_group_budget_negative_storage() -> Weight {
-        (102_502_000 as Weight)
+        (169_381_000 as Weight)
             .saturating_add(DbWeight::get().reads(2 as Weight))
             .saturating_add(DbWeight::get().writes(2 as Weight))
     }
     fn update_working_group_budget_positive_content() -> Weight {
-        (103_375_000 as Weight)
+        (169_707_000 as Weight)
             .saturating_add(DbWeight::get().reads(2 as Weight))
             .saturating_add(DbWeight::get().writes(2 as Weight))
     }
     fn update_working_group_budget_negative_content() -> Weight {
-        (102_741_000 as Weight)
+        (169_606_000 as Weight)
             .saturating_add(DbWeight::get().reads(2 as Weight))
             .saturating_add(DbWeight::get().writes(2 as Weight))
     }
     fn update_working_group_budget_positive_membership() -> Weight {
-        (103_449_000 as Weight)
+        (168_373_000 as Weight)
             .saturating_add(DbWeight::get().reads(2 as Weight))
             .saturating_add(DbWeight::get().writes(2 as Weight))
     }
     fn update_working_group_budget_negative_membership() -> Weight {
-        (102_274_000 as Weight)
+        (169_063_000 as Weight)
             .saturating_add(DbWeight::get().reads(2 as Weight))
             .saturating_add(DbWeight::get().writes(2 as Weight))
     }