Browse Source

proposals: Add weights benchmarks and tests for missing proposals

conectado 4 years ago
parent
commit
4140cd75f9

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

@@ -18,6 +18,8 @@ use sp_std::prelude::*;
 const SEED: u32 = 0;
 const MAX_BYTES: u32 = 16384;
 
+use crate::call_wg;
+
 // Note: We use proposals_engine::Trait::Event here because crate::Trait
 // doesn't implement Event and we only use this function to assert events
 // from the proposals_engine pallet
@@ -172,6 +174,48 @@ fn create_proposal_verify<T: Trait>(
     );
 }
 
+fn set_wg_and_council_budget<T: Trait>(budget: u32, group: WorkingGroup) {
+    Council::<T>::set_budget(RawOrigin::Root.into(), BalanceOf::<T>::from(budget)).unwrap();
+
+    call_wg!(
+        group<T>,
+        set_budget,
+        RawOrigin::Root.into(),
+        BalanceOf::<T>::from(budget)
+    )
+    .unwrap();
+
+    assert_eq!(
+        Council::<T>::budget(),
+        BalanceOf::<T>::from(budget),
+        "Council budget not updated"
+    );
+
+    assert_eq!(
+        call_wg!(group<T>, budget),
+        BalanceOf::<T>::from(budget),
+        "Working Group budget not updated"
+    );
+}
+
+fn assert_new_budgets<T: Trait>(
+    new_budget_council: u32,
+    new_budget_working_group: u32,
+    group: WorkingGroup,
+) {
+    assert_eq!(
+        Council::<T>::budget(),
+        BalanceOf::<T>::from(new_budget_council),
+        "Council budget not updated"
+    );
+
+    assert_eq!(
+        call_wg!(group<T>, budget),
+        BalanceOf::<T>::from(new_budget_working_group),
+        "Working Group budget not updated"
+    );
+}
+
 benchmarks! {
     where_clause { where T: membership::Trait }
     _ {
@@ -429,6 +473,130 @@ benchmarks! {
     verify {
         create_proposal_verify::<T>(account_id, member_id, proposal_details);
     }
+
+    create_proposal_set_initial_invitation_count {
+        let t in ...;
+        let d in ...;
+
+        let (account_id, member_id, general_proposal_paramters) = create_proposal_parameters::<T>(t, d);
+
+        let proposal_details = ProposalDetails::SetInitialInvitationCount(One::one());
+    }: create_proposal(RawOrigin::Signed(account_id.clone()), general_proposal_paramters, proposal_details.clone())
+    verify {
+        create_proposal_verify::<T>(account_id, member_id, proposal_details);
+    }
+
+    create_proposal_set_membership_lead_invitation_quota {
+        let t in ...;
+        let d in ...;
+
+        let (account_id, member_id, general_proposal_paramters) = create_proposal_parameters::<T>(t, d);
+
+        let proposal_details = ProposalDetails::SetMembershipLeadInvitationQuota(One::one());
+    }: create_proposal(RawOrigin::Signed(account_id.clone()), general_proposal_paramters, proposal_details.clone())
+    verify {
+        create_proposal_verify::<T>(account_id, member_id, proposal_details);
+    }
+
+    create_proposal_set_referral_cut {
+        let t in ...;
+        let d in ...;
+
+        let (account_id, member_id, general_proposal_paramters) = create_proposal_parameters::<T>(t, d);
+
+        let proposal_details = ProposalDetails::SetReferralCut(One::one());
+    }: create_proposal(RawOrigin::Signed(account_id.clone()), general_proposal_paramters, proposal_details.clone())
+    verify {
+        create_proposal_verify::<T>(account_id, member_id, proposal_details);
+    }
+
+    update_working_group_budget_positive_forum {
+        set_wg_and_council_budget::<T>(100, WorkingGroup::Forum);
+    }: update_working_group_budget(RawOrigin::Root, WorkingGroup::Forum, One::one(), BalanceKind::Positive)
+    verify {
+        assert_new_budgets::<T>(99, 101, WorkingGroup::Forum);
+    }
+
+    update_working_group_budget_negative_forum {
+        set_wg_and_council_budget::<T>(100, WorkingGroup::Forum);
+    }: update_working_group_budget(RawOrigin::Root, WorkingGroup::Forum, One::one(), BalanceKind::Negative)
+    verify{
+        assert_new_budgets::<T>(101, 99, WorkingGroup::Forum);
+    }
+
+    update_working_group_budget_positive_storage {
+        set_wg_and_council_budget::<T>(100, WorkingGroup::Storage);
+    }: update_working_group_budget(RawOrigin::Root, WorkingGroup::Storage, One::one(), BalanceKind::Positive)
+    verify {
+        assert_new_budgets::<T>(99, 101, WorkingGroup::Storage);
+    }
+
+    update_working_group_budget_negative_storage {
+        set_wg_and_council_budget::<T>(100, WorkingGroup::Storage);
+    }: update_working_group_budget(RawOrigin::Root, WorkingGroup::Storage, One::one(), BalanceKind::Negative)
+    verify {
+        assert_new_budgets::<T>(101, 99, WorkingGroup::Storage);
+    }
+
+    update_working_group_budget_positive_content {
+        set_wg_and_council_budget::<T>(100, WorkingGroup::Content);
+    }: update_working_group_budget(RawOrigin::Root, WorkingGroup::Content, One::one(), BalanceKind::Positive)
+    verify {
+        assert_new_budgets::<T>(99, 101, WorkingGroup::Content);
+    }
+
+    update_working_group_budget_negative_content {
+        set_wg_and_council_budget::<T>(100, WorkingGroup::Content);
+    }: update_working_group_budget(RawOrigin::Root, WorkingGroup::Content, One::one(),
+    BalanceKind::Negative)
+    verify {
+        assert_new_budgets::<T>(101, 99, WorkingGroup::Content);
+    }
+
+    update_working_group_budget_positive_membership {
+        set_wg_and_council_budget::<T>(100, WorkingGroup::Membership);
+    }: update_working_group_budget(RawOrigin::Root, WorkingGroup::Membership, One::one(), BalanceKind::Positive)
+    verify {
+        assert_new_budgets::<T>(99, 101, WorkingGroup::Membership);
+    }
+
+    update_working_group_budget_negative_membership {
+        set_wg_and_council_budget::<T>(100, WorkingGroup::Membership);
+    }: update_working_group_budget(RawOrigin::Root, WorkingGroup::Membership, One::one(), BalanceKind::Negative)
+    verify {
+        assert_new_budgets::<T>(101, 99, WorkingGroup::Membership);
+    }
+
+    funding_request {
+        let council_budget = BalanceOf::<T>::from(100);
+        let transfer_balance = BalanceOf::<T>::from(60);
+        let recieving_account = account::<T::AccountId>("reciever", 0, SEED);
+        Council::<T>::set_budget(RawOrigin::Root.into(), council_budget).unwrap();
+        assert_eq!(
+            Council::<T>::budget(),
+            council_budget,
+            "Council budget not updated"
+        );
+
+        assert_eq!(
+            Balances::<T>::free_balance(&recieving_account),
+            Zero::zero(),
+            "Recieving account has funds",
+        );
+    }: _ (RawOrigin::Root, transfer_balance, recieving_account.clone())
+    verify {
+        assert_eq!(
+            Council::<T>::budget(),
+            council_budget - transfer_balance,
+            "Council didn't discount transference",
+        );
+
+        assert_eq!(
+            Balances::<T>::free_balance(recieving_account),
+            transfer_balance,
+            "Recieving account didn't recieve amount",
+        );
+    }
 }
 
 #[cfg(test)]
@@ -557,4 +725,87 @@ mod tests {
             assert_ok!(test_benchmark_create_proposal_set_initial_invitation_balance::<Test>());
         });
     }
+
+    #[test]
+    fn test_create_proposal_set_initial_invitation_count() {
+        initial_test_ext().execute_with(|| {
+            assert_ok!(test_benchmark_create_proposal_set_initial_invitation_count::<Test>());
+        });
+    }
+
+    #[test]
+    fn test_create_proposal_set_membership_lead_invitation_quota() {
+        initial_test_ext().execute_with(|| {
+            assert_ok!(
+                test_benchmark_create_proposal_set_membership_lead_invitation_quota::<Test>()
+            );
+        });
+    }
+
+    #[test]
+    fn test_create_proposal_set_referral_cut() {
+        initial_test_ext().execute_with(|| {
+            assert_ok!(test_benchmark_create_proposal_set_referral_cut::<Test>());
+        });
+    }
+
+    #[test]
+    fn test_update_working_group_budget_positive_forum() {
+        initial_test_ext().execute_with(|| {
+            assert_ok!(test_benchmark_update_working_group_budget_positive_forum::<
+                Test,
+            >());
+        });
+    }
+
+    #[test]
+    fn test_update_working_group_budget_negative_forum() {
+        initial_test_ext().execute_with(|| {
+            assert_ok!(test_benchmark_update_working_group_budget_negative_forum::<
+                Test,
+            >());
+        });
+    }
+
+    #[test]
+    fn test_update_working_group_budget_positive_storage() {
+        initial_test_ext().execute_with(|| {
+            assert_ok!(test_benchmark_update_working_group_budget_positive_storage::<Test>());
+        });
+    }
+
+    #[test]
+    fn test_update_working_group_budget_negative_storage() {
+        initial_test_ext().execute_with(|| {
+            assert_ok!(test_benchmark_update_working_group_budget_negative_storage::<Test>());
+        });
+    }
+
+    #[test]
+    fn test_update_working_group_budget_positive_content() {
+        initial_test_ext().execute_with(|| {
+            assert_ok!(test_benchmark_update_working_group_budget_positive_content::<Test>());
+        });
+    }
+
+    #[test]
+    fn test_update_working_group_budget_negative_content() {
+        initial_test_ext().execute_with(|| {
+            assert_ok!(test_benchmark_update_working_group_budget_negative_content::<Test>());
+        });
+    }
+
+    #[test]
+    fn test_update_working_group_budget_positive_membership() {
+        initial_test_ext().execute_with(|| {
+            assert_ok!(test_benchmark_update_working_group_budget_positive_membership::<Test>());
+        });
+    }
+
+    #[test]
+    fn test_update_working_group_budget_negative_membership() {
+        initial_test_ext().execute_with(|| {
+            assert_ok!(test_benchmark_update_working_group_budget_negative_membership::<Test>());
+        });
+    }
 }

+ 102 - 58
runtime-modules/proposals/codex/src/lib.rs

@@ -94,23 +94,35 @@ const MAX_VALIDATOR_COUNT: u32 = 100;
 /// Note: This was auto generated through the benchmark CLI using the `--weight-trait` flag
 pub trait WeightInfo {
     fn execute_signal_proposal(i: u32) -> Weight;
-    fn create_proposal_signal(i: u32) -> Weight; // Extra parameters not used
-    fn create_proposal_runtime_upgrade(i: u32, t: u32, d: u32) -> Weight;
-    fn create_proposal_funding_request() -> Weight; // Extra parameters not used
-    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(d: u32) -> Weight; // Extra parameters not used
-    fn create_proposal_decrease_working_group_lead_stake() -> Weight; // Extra parameters not used
-    fn create_proposal_slash_working_group_lead(d: u32) -> Weight; // Extra parameters not used
-    fn create_proposal_set_working_group_lead_reward(d: u32) -> Weight; // Extra parameters not used
-    fn create_proposal_terminate_working_group_lead(t: u32, d: u32) -> Weight;
-    fn create_proposal_amend_constitution(i: u32, t: u32, d: u32) -> Weight;
-    fn create_proposal_cancel_working_group_lead_opening(t: u32) -> Weight; // Extra parameters not used
-    fn create_proposal_set_membership_price(t: u32, d: u32) -> Weight;
-    fn create_proposal_set_council_budget_increment(d: u32) -> Weight; // Extra parameters not used
-    fn create_proposal_set_councilor_reward(t: u32) -> Weight; // Extra parameters not used
-    fn create_proposal_set_initial_invitation_balance(t: u32, d: u32) -> Weight;
+    fn create_proposal_signal(i: u32, t: u32) -> Weight;
+    fn create_proposal_runtime_upgrade(i: u32) -> Weight;
+    fn create_proposal_funding_request(t: u32, d: u32) -> Weight;
+    fn create_proposal_set_max_validator_count() -> Weight;
+    fn create_proposal_create_working_group_lead_opening(i: u32, d: u32) -> Weight;
+    fn create_proposal_fill_working_group_lead_opening(t: u32) -> Weight;
+    fn create_proposal_update_working_group_budget(d: u32) -> Weight;
+    fn create_proposal_decrease_working_group_lead_stake(t: u32, d: u32) -> Weight;
+    fn create_proposal_slash_working_group_lead() -> Weight;
+    fn create_proposal_set_working_group_lead_reward(t: u32) -> Weight;
+    fn create_proposal_terminate_working_group_lead(t: u32) -> Weight;
+    fn create_proposal_amend_constitution(i: u32, t: u32) -> Weight;
+    fn create_proposal_cancel_working_group_lead_opening() -> Weight;
+    fn create_proposal_set_membership_price(d: u32) -> Weight;
+    fn create_proposal_set_council_budget_increment(t: u32, d: u32) -> Weight;
+    fn create_proposal_set_councilor_reward(d: u32) -> Weight;
+    fn create_proposal_set_initial_invitation_balance(t: u32) -> Weight;
+    fn create_proposal_set_initial_invitation_count() -> Weight;
+    fn create_proposal_set_membership_lead_invitation_quota() -> Weight;
+    fn create_proposal_set_referral_cut(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;
+    fn update_working_group_budget_negative_storage() -> Weight;
+    fn update_working_group_budget_positive_content() -> Weight;
+    fn update_working_group_budget_negative_content() -> Weight;
+    fn update_working_group_budget_positive_membership() -> Weight;
+    fn update_working_group_budget_negative_membership() -> Weight;
+    fn funding_request() -> Weight;
 }
 
 type WeightInfoCodex<T> = <T as Trait>::WeightInfo;
@@ -316,13 +328,14 @@ decl_storage! {
 
 // Calls the function $function in the instance corresponding to $working_group with
 // arguments in $x
+#[macro_export]
 macro_rules! call_wg {
     ($working_group:ident<$T:ty>, $function:ident $(,$x:expr)*) => {{
         match $working_group {
-            WorkingGroup::Content => $working_group::Module::<$T, ContentDirectoryWorkingGroupInstance>::$function($($x,)*),
-            WorkingGroup::Storage => $working_group::Module::<$T, StorageWorkingGroupInstance>::$function($($x,)*),
-            WorkingGroup::Forum => $working_group::Module::<$T, ForumWorkingGroupInstance>::$function($($x,)*),
-            WorkingGroup::Membership => $working_group::Module::<$T, MembershipWorkingGroupInstance>::$function($($x,)*),
+            WorkingGroup::Content => working_group::Module::<$T, ContentDirectoryWorkingGroupInstance>::$function($($x,)*),
+            WorkingGroup::Storage => working_group::Module::<$T, StorageWorkingGroupInstance>::$function($($x,)*),
+            WorkingGroup::Forum => working_group::Module::<$T, ForumWorkingGroupInstance>::$function($($x,)*),
+            WorkingGroup::Membership => working_group::Module::<$T, MembershipWorkingGroupInstance>::$function($($x,)*),
         }
     }};
 }
@@ -519,7 +532,7 @@ decl_module! {
         }
 
         /// Update working group budget
-        #[weight = 10_000_000] // TODO: adjust weight
+        #[weight = Module::<T>::get_update_working_group_budget_weight(&working_group, &balance_kind)]
         pub fn update_working_group_budget(
             origin,
             working_group: WorkingGroup,
@@ -549,7 +562,7 @@ decl_module! {
         }
 
         /// Funding request proposal
-        #[weight = 10_000_000] // TODO: adjust weight
+        #[weight = WeightInfoCodex::<T>::funding_request()] // TODO: adjust weight
         pub fn funding_request(
             origin,
             amount: BalanceOf<T>,
@@ -579,7 +592,7 @@ type StorageWorkingGroupInstance = working_group::Instance2;
 type ContentDirectoryWorkingGroupInstance = working_group::Instance3;
 
 // The membership working group instance alias.
-pub type MembershipWorkingGroupInstance = working_group::Instance4;
+type MembershipWorkingGroupInstance = working_group::Instance4;
 
 impl<T: Trait> Module<T> {
     // Ensure that the proposal details respects all the checks
@@ -658,13 +671,13 @@ impl<T: Trait> Module<T> {
                 // Note: No checks for this proposal for now
             }
             ProposalDetails::SetInitialInvitationCount(..) => {
-                // TODO add checks
+                // Note: No checks for this proposal for now
             }
             ProposalDetails::SetMembershipLeadInvitationQuota(..) => {
-                // TODO add checks
+                // Note: No checks for this proposal for now
             }
             ProposalDetails::SetReferralCut(..) => {
-                // TODO add checks
+                // Note: No checks for this proposal for now
             }
         }
 
@@ -729,7 +742,44 @@ impl<T: Trait> Module<T> {
         }
     }
 
-    // Returns weight for the proposal creatin according to parameters
+    // Returns the weigt for update_working_group_budget extrinsic according to parameters
+    fn get_update_working_group_budget_weight(
+        group: &WorkingGroup,
+        balance_kind: &BalanceKind,
+    ) -> Weight {
+        match balance_kind {
+            BalanceKind::Positive => match group {
+                WorkingGroup::Forum => {
+                    WeightInfoCodex::<T>::update_working_group_budget_positive_forum()
+                }
+                WorkingGroup::Storage => {
+                    WeightInfoCodex::<T>::update_working_group_budget_positive_storage()
+                }
+                WorkingGroup::Content => {
+                    WeightInfoCodex::<T>::update_working_group_budget_positive_content()
+                }
+                WorkingGroup::Membership => {
+                    WeightInfoCodex::<T>::update_working_group_budget_positive_membership()
+                }
+            },
+            BalanceKind::Negative => match group {
+                WorkingGroup::Forum => {
+                    WeightInfoCodex::<T>::update_working_group_budget_negative_forum()
+                }
+                WorkingGroup::Storage => {
+                    WeightInfoCodex::<T>::update_working_group_budget_negative_storage()
+                }
+                WorkingGroup::Membership => {
+                    WeightInfoCodex::<T>::update_working_group_budget_negative_membership()
+                }
+                WorkingGroup::Content => {
+                    WeightInfoCodex::<T>::update_working_group_budget_negative_content()
+                }
+            },
+        }
+    }
+
+    // Returns weight for the proposal creation according to parameters
     fn get_create_proposal_weight(
         general: &GeneralProposalParameters<T>,
         details: &ProposalDetailsOf<T>,
@@ -737,36 +787,31 @@ impl<T: Trait> Module<T> {
         let title_length = general.title.len();
         let description_length = general.description.len();
         match details {
-            ProposalDetails::Signal(signal) => {
-                WeightInfoCodex::<T>::create_proposal_signal(signal.len().saturated_into())
-            }
+            ProposalDetails::Signal(signal) => WeightInfoCodex::<T>::create_proposal_signal(
+                signal.len().saturated_into(),
+                title_length.saturated_into(),
+            ),
             ProposalDetails::RuntimeUpgrade(blob) => {
-                WeightInfoCodex::<T>::create_proposal_runtime_upgrade(
-                    blob.len().saturated_into(),
-                    title_length.saturated_into(),
-                    description_length.saturated_into(),
-                )
+                WeightInfoCodex::<T>::create_proposal_runtime_upgrade(blob.len().saturated_into())
             }
             ProposalDetails::FundingRequest(..) => {
-                WeightInfoCodex::<T>::create_proposal_funding_request()
-            }
-            ProposalDetails::SetMaxValidatorCount(..) => {
-                WeightInfoCodex::<T>::create_proposal_set_max_validator_count(
+                WeightInfoCodex::<T>::create_proposal_funding_request(
                     title_length.saturated_into(),
                     description_length.saturated_into(),
                 )
             }
+            ProposalDetails::SetMaxValidatorCount(..) => {
+                WeightInfoCodex::<T>::create_proposal_set_max_validator_count()
+            }
             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(
                     title_length.saturated_into(),
-                    description_length.saturated_into(),
                 )
             }
             ProposalDetails::UpdateWorkingGroupBudget(..) => {
@@ -775,66 +820,65 @@ impl<T: Trait> Module<T> {
                 )
             }
             ProposalDetails::DecreaseWorkingGroupLeadStake(..) => {
-                WeightInfoCodex::<T>::create_proposal_decrease_working_group_lead_stake()
-            }
-            ProposalDetails::SlashWorkingGroupLead(..) => {
-                WeightInfoCodex::<T>::create_proposal_slash_working_group_lead(
+                WeightInfoCodex::<T>::create_proposal_decrease_working_group_lead_stake(
+                    title_length.saturated_into(),
                     description_length.saturated_into(),
                 )
             }
+            ProposalDetails::SlashWorkingGroupLead(..) => {
+                WeightInfoCodex::<T>::create_proposal_slash_working_group_lead()
+            }
             ProposalDetails::SetWorkingGroupLeadReward(..) => {
                 WeightInfoCodex::<T>::create_proposal_set_working_group_lead_reward(
-                    description_length.saturated_into(),
+                    title_length.saturated_into(),
                 )
             }
             ProposalDetails::TerminateWorkingGroupLead(..) => {
                 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(
-                    title_length.saturated_into(),
                     description_length.saturated_into(),
                 )
             }
             ProposalDetails::CancelWorkingGroupLeadOpening(..) => {
-                WeightInfoCodex::<T>::create_proposal_cancel_working_group_lead_opening(
-                    title_length.saturated_into(),
-                )
+                WeightInfoCodex::<T>::create_proposal_cancel_working_group_lead_opening()
             }
             ProposalDetails::SetCouncilBudgetIncrement(..) => {
                 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(..) => {
                 WeightInfoCodex::<T>::create_proposal_set_initial_invitation_balance(
                     title_length.saturated_into(),
-                    description_length.saturated_into(),
                 )
             }
             ProposalDetails::SetInitialInvitationCount(..) => {
-                1_000_000 // TODO benchmark
+                WeightInfoCodex::<T>::create_proposal_set_initial_invitation_count()
             }
             ProposalDetails::SetMembershipLeadInvitationQuota(..) => {
-                1_000_000 // TODO benchmark
+                WeightInfoCodex::<T>::create_proposal_set_membership_lead_invitation_quota()
             }
             ProposalDetails::SetReferralCut(..) => {
-                1_000_000 // TODO benchmark
+                WeightInfoCodex::<T>::create_proposal_set_referral_cut(
+                    title_length.saturated_into(),
+                    description_length.saturated_into(),
+                )
             }
         }
     }

+ 50 - 14
runtime-modules/proposals/codex/src/tests/mock.rs

@@ -669,55 +669,91 @@ impl crate::WeightInfo for () {
     fn execute_signal_proposal(_: u32) -> Weight {
         0
     }
-    fn create_proposal_signal(_: u32) -> Weight {
+    fn create_proposal_signal(_: u32, _: u32) -> Weight {
         0
     }
-    fn create_proposal_runtime_upgrade(_: u32, _: u32, _: u32) -> Weight {
+    fn create_proposal_runtime_upgrade(_: u32) -> Weight {
         0
     }
-    fn create_proposal_funding_request() -> Weight {
+    fn create_proposal_funding_request(_: u32, _: u32) -> Weight {
         0
     }
-    fn create_proposal_set_max_validator_count(_: u32, _: u32) -> Weight {
+    fn create_proposal_set_max_validator_count() -> Weight {
         0
     }
-    fn create_proposal_create_working_group_lead_opening(_: u32, _: u32, _: u32) -> Weight {
+    fn create_proposal_create_working_group_lead_opening(_: u32, _: u32) -> Weight {
         0
     }
-    fn create_proposal_fill_working_group_lead_opening(_: u32, _: u32) -> Weight {
+    fn create_proposal_fill_working_group_lead_opening(_: u32) -> Weight {
         0
     }
     fn create_proposal_update_working_group_budget(_: u32) -> Weight {
         0
     }
-    fn create_proposal_decrease_working_group_lead_stake() -> Weight {
+    fn create_proposal_decrease_working_group_lead_stake(_: u32, _: u32) -> Weight {
         0
     }
-    fn create_proposal_slash_working_group_lead(_: u32) -> Weight {
+    fn create_proposal_slash_working_group_lead() -> Weight {
         0
     }
     fn create_proposal_set_working_group_lead_reward(_: u32) -> Weight {
         0
     }
-    fn create_proposal_terminate_working_group_lead(_: u32, _: u32) -> Weight {
+    fn create_proposal_terminate_working_group_lead(_: 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) -> Weight {
+    fn create_proposal_cancel_working_group_lead_opening() -> Weight {
         0
     }
-    fn create_proposal_set_membership_price(_: u32, _: u32) -> Weight {
+    fn create_proposal_set_membership_price(_: u32) -> Weight {
         0
     }
-    fn create_proposal_set_council_budget_increment(_: u32) -> Weight {
+    fn create_proposal_set_council_budget_increment(_: u32, _: u32) -> Weight {
         0
     }
     fn create_proposal_set_councilor_reward(_: u32) -> Weight {
         0
     }
-    fn create_proposal_set_initial_invitation_balance(_: u32, _: u32) -> Weight {
+    fn create_proposal_set_initial_invitation_balance(_: u32) -> Weight {
+        0
+    }
+    fn create_proposal_set_initial_invitation_count() -> Weight {
+        0
+    }
+    fn create_proposal_set_membership_lead_invitation_quota() -> Weight {
+        0
+    }
+    fn create_proposal_set_referral_cut(_: u32, _: u32) -> Weight {
+        0
+    }
+    fn update_working_group_budget_positive_forum() -> Weight {
+        0
+    }
+    fn update_working_group_budget_negative_forum() -> Weight {
+        0
+    }
+    fn update_working_group_budget_positive_storage() -> Weight {
+        0
+    }
+    fn update_working_group_budget_negative_storage() -> Weight {
+        0
+    }
+    fn update_working_group_budget_positive_content() -> Weight {
+        0
+    }
+    fn update_working_group_budget_negative_content() -> Weight {
+        0
+    }
+    fn update_working_group_budget_positive_membership() -> Weight {
+        0
+    }
+    fn update_working_group_budget_negative_membership() -> Weight {
+        0
+    }
+    fn funding_request() -> Weight {
         0
     }
 }

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

@@ -561,12 +561,11 @@ fn run_create_fill_working_group_leader_opening_proposal_common_checks_succeed(
 fn create_set_working_group_mint_capacity_proposal_common_checks_succeed() {
     // This uses strum crate for enum iteration
     for group in WorkingGroup::iter() {
-        run_create_set_working_group_mint_capacity_proposal_common_checks_succeed(group);
+        run_create_update_working_group_budget_proposal_common_checks_succeed(group);
     }
 }
 
-// TODO: review here
-fn run_create_set_working_group_mint_capacity_proposal_common_checks_succeed(
+fn run_create_update_working_group_budget_proposal_common_checks_succeed(
     working_group: WorkingGroup,
 ) {
     initial_test_ext().execute_with(|| {
@@ -1096,6 +1095,59 @@ fn create_amend_constitution_proposal_common_checks_succeed() {
     });
 }
 
+#[test]
+fn create_set_council_budget_increment_common_checks_succeed() {
+    initial_test_ext().execute_with(|| {
+        increase_total_balance_issuance_using_account_id(1, 1_500_000);
+
+        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_with_staking = 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 set_council_budget_increment_details = ProposalDetails::SetCouncilBudgetIncrement(100);
+
+        let proposal_fixture = ProposalTestFixture {
+            insufficient_rights_call: || {
+                ProposalCodex::create_proposal(
+                    RawOrigin::None.into(),
+                    general_proposal_parameters_no_staking.clone(),
+                    set_council_budget_increment_details.clone(),
+                )
+            },
+            empty_stake_call: || {
+                ProposalCodex::create_proposal(
+                    RawOrigin::Signed(1).into(),
+                    general_proposal_parameters_no_staking.clone(),
+                    set_council_budget_increment_details.clone(),
+                )
+            },
+            successful_call: || {
+                ProposalCodex::create_proposal(
+                    RawOrigin::Signed(1).into(),
+                    general_proposal_parameters_with_staking.clone(),
+                    set_council_budget_increment_details.clone(),
+                )
+            },
+            proposal_parameters:
+                <Test as crate::Trait>::SetCouncilBudgetIncrementProposalParameters::get(),
+            proposal_details: set_council_budget_increment_details.clone(),
+        };
+        proposal_fixture.check_all();
+    });
+}
+
 #[test]
 fn create_cancel_working_group_leader_opening_proposal_common_checks_succeed() {
     // This uses strum crate for enum iteration
@@ -1157,3 +1209,270 @@ fn run_create_cancel_working_group_leader_opening_proposal_common_checks_succeed
         proposal_fixture.check_all();
     });
 }
+
+#[test]
+fn create_set_councilor_reward_proposal_common_checks_succeed() {
+    initial_test_ext().execute_with(|| {
+        let total_balance_issuance = 500000;
+        increase_total_balance_issuance(total_balance_issuance);
+
+        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_with_staking = 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 set_councilor_reward_details = ProposalDetails::SetCouncilorReward(100);
+
+        let proposal_fixture = ProposalTestFixture {
+            insufficient_rights_call: || {
+                ProposalCodex::create_proposal(
+                    RawOrigin::None.into(),
+                    general_proposal_parameters_no_staking.clone(),
+                    set_councilor_reward_details.clone(),
+                )
+            },
+            empty_stake_call: || {
+                ProposalCodex::create_proposal(
+                    RawOrigin::Signed(1).into(),
+                    general_proposal_parameters_no_staking.clone(),
+                    set_councilor_reward_details.clone(),
+                )
+            },
+            successful_call: || {
+                ProposalCodex::create_proposal(
+                    RawOrigin::Signed(1).into(),
+                    general_proposal_parameters_with_staking.clone(),
+                    set_councilor_reward_details.clone(),
+                )
+            },
+            proposal_parameters: <Test as crate::Trait>::SetCouncilorRewardProposalParameters::get(
+            ),
+            proposal_details: set_councilor_reward_details.clone(),
+        };
+        proposal_fixture.check_all();
+    });
+}
+
+#[test]
+fn create_set_initial_invitation_balance_proposal_common_checks_succeed() {
+    initial_test_ext().execute_with(|| {
+        increase_total_balance_issuance_using_account_id(1, 1_500_000);
+
+        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_with_staking = 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 set_initial_invitation_balance_details =
+            ProposalDetails::SetInitialInvitationBalance(100);
+
+        let proposal_fixture = ProposalTestFixture {
+            insufficient_rights_call: || {
+                ProposalCodex::create_proposal(
+                    RawOrigin::None.into(),
+                    general_proposal_parameters_no_staking.clone(),
+                    set_initial_invitation_balance_details.clone(),
+                )
+            },
+            empty_stake_call: || {
+                ProposalCodex::create_proposal(
+                    RawOrigin::Signed(1).into(),
+                    general_proposal_parameters_no_staking.clone(),
+                    set_initial_invitation_balance_details.clone(),
+                )
+            },
+            successful_call: || {
+                ProposalCodex::create_proposal(
+                    RawOrigin::Signed(1).into(),
+                    general_proposal_parameters_with_staking.clone(),
+                    set_initial_invitation_balance_details.clone(),
+                )
+            },
+            proposal_parameters:
+                <Test as crate::Trait>::SetInitialInvitationBalanceProposalParameters::get(),
+            proposal_details: set_initial_invitation_balance_details.clone(),
+        };
+        proposal_fixture.check_all();
+    });
+}
+
+#[test]
+fn create_set_initial_invitation_count_proposal_common_checks_succeed() {
+    initial_test_ext().execute_with(|| {
+        increase_total_balance_issuance_using_account_id(1, 1_500_000);
+
+        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_with_staking = 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 set_initial_invitation_count_details = ProposalDetails::SetInitialInvitationCount(100);
+
+        let proposal_fixture = ProposalTestFixture {
+            insufficient_rights_call: || {
+                ProposalCodex::create_proposal(
+                    RawOrigin::None.into(),
+                    general_proposal_parameters_no_staking.clone(),
+                    set_initial_invitation_count_details.clone(),
+                )
+            },
+            empty_stake_call: || {
+                ProposalCodex::create_proposal(
+                    RawOrigin::Signed(1).into(),
+                    general_proposal_parameters_no_staking.clone(),
+                    set_initial_invitation_count_details.clone(),
+                )
+            },
+            successful_call: || {
+                ProposalCodex::create_proposal(
+                    RawOrigin::Signed(1).into(),
+                    general_proposal_parameters_with_staking.clone(),
+                    set_initial_invitation_count_details.clone(),
+                )
+            },
+            proposal_parameters: <Test as crate::Trait>::SetInvitationCountProposalParameters::get(
+            ),
+            proposal_details: set_initial_invitation_count_details.clone(),
+        };
+        proposal_fixture.check_all();
+    });
+}
+
+#[test]
+fn create_set_membership_lead_invitation_quota_common_checks_succeed() {
+    initial_test_ext().execute_with(|| {
+        increase_total_balance_issuance_using_account_id(1, 1_500_000);
+
+        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_with_staking = 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 set_membership_lead_invitation_quota =
+            ProposalDetails::SetMembershipLeadInvitationQuota(100);
+
+        let proposal_fixture = ProposalTestFixture {
+            insufficient_rights_call: || {
+                ProposalCodex::create_proposal(
+                    RawOrigin::None.into(),
+                    general_proposal_parameters_no_staking.clone(),
+                    set_membership_lead_invitation_quota.clone(),
+                )
+            },
+            empty_stake_call: || {
+                ProposalCodex::create_proposal(
+                    RawOrigin::Signed(1).into(),
+                    general_proposal_parameters_no_staking.clone(),
+                    set_membership_lead_invitation_quota.clone(),
+                )
+            },
+            successful_call: || {
+                ProposalCodex::create_proposal(
+                    RawOrigin::Signed(1).into(),
+                    general_proposal_parameters_with_staking.clone(),
+                    set_membership_lead_invitation_quota.clone(),
+                )
+            },
+            proposal_parameters:
+                <Test as crate::Trait>::SetMembershipLeadInvitationQuotaProposalParameters::get(),
+            proposal_details: set_membership_lead_invitation_quota.clone(),
+        };
+        proposal_fixture.check_all();
+    });
+}
+
+#[test]
+fn create_set_referral_cut_common_checks_succeed() {
+    initial_test_ext().execute_with(|| {
+        increase_total_balance_issuance_using_account_id(1, 1_500_000);
+
+        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_with_staking = 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 set_referral_cut_proposal_details = ProposalDetails::SetReferralCut(100);
+
+        let proposal_fixture = ProposalTestFixture {
+            insufficient_rights_call: || {
+                ProposalCodex::create_proposal(
+                    RawOrigin::None.into(),
+                    general_proposal_parameters_no_staking.clone(),
+                    set_referral_cut_proposal_details.clone(),
+                )
+            },
+            empty_stake_call: || {
+                ProposalCodex::create_proposal(
+                    RawOrigin::Signed(1).into(),
+                    general_proposal_parameters_no_staking.clone(),
+                    set_referral_cut_proposal_details.clone(),
+                )
+            },
+            successful_call: || {
+                ProposalCodex::create_proposal(
+                    RawOrigin::Signed(1).into(),
+                    general_proposal_parameters_with_staking.clone(),
+                    set_referral_cut_proposal_details.clone(),
+                )
+            },
+            proposal_parameters: <Test as crate::Trait>::SetReferralCutProposalParameters::get(),
+            proposal_details: set_referral_cut_proposal_details.clone(),
+        };
+        proposal_fixture.check_all();
+    });
+}

+ 129 - 66
runtime/src/weights/proposals_codex.rs

@@ -8,126 +8,189 @@ 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 {
-        (16_059_000 as Weight).saturating_add((41_000 as Weight).saturating_mul(i as Weight))
+        (14_621_000 as Weight).saturating_add((44_000 as Weight).saturating_mul(i as Weight))
     }
-    // WARNING! Some components were not used: ["t", "d"]
-    fn create_proposal_signal(i: u32) -> Weight {
-        (663_482_000 as Weight)
-            .saturating_add((246_000 as Weight).saturating_mul(i as Weight))
+    // WARNING! Some components were not used: ["d"]
+    fn create_proposal_signal(i: u32, t: u32) -> Weight {
+        (670_987_000 as Weight)
+            .saturating_add((273_000 as Weight).saturating_mul(i as Weight))
+            .saturating_add((565_000 as Weight).saturating_mul(t as Weight))
             .saturating_add(DbWeight::get().reads(6 as Weight))
             .saturating_add(DbWeight::get().writes(10 as Weight))
     }
-    fn create_proposal_runtime_upgrade(i: u32, t: u32, d: u32) -> Weight {
-        (0 as Weight)
-            .saturating_add((298_000 as Weight).saturating_mul(i as Weight))
-            .saturating_add((13_792_000 as Weight).saturating_mul(t as Weight))
-            .saturating_add((140_000 as Weight).saturating_mul(d as Weight))
+    // WARNING! Some components were not used: ["t", "d"]
+    fn create_proposal_runtime_upgrade(i: u32) -> Weight {
+        (707_989_000 as Weight)
+            .saturating_add((280_000 as Weight).saturating_mul(i as Weight))
             .saturating_add(DbWeight::get().reads(6 as Weight))
             .saturating_add(DbWeight::get().writes(10 as Weight))
     }
-    // WARNING! Some components were not used: ["t", "d"]
-    fn create_proposal_funding_request() -> Weight {
-        (1_011_708_000 as Weight)
-            .saturating_add(DbWeight::get().reads(8 as Weight))
+    fn create_proposal_funding_request(t: u32, d: u32) -> Weight {
+        (585_920_000 as Weight)
+            .saturating_add((1_192_000 as Weight).saturating_mul(t as Weight))
+            .saturating_add((14_000 as Weight).saturating_mul(d as Weight))
+            .saturating_add(DbWeight::get().reads(7 as Weight))
             .saturating_add(DbWeight::get().writes(10 as Weight))
     }
-    fn create_proposal_set_max_validator_count(t: u32, d: u32) -> Weight {
-        (737_501_000 as Weight)
-            .saturating_add((3_119_000 as Weight).saturating_mul(t as Weight))
-            .saturating_add((20_000 as Weight).saturating_mul(d as Weight))
+    // WARNING! Some components were not used: ["t", "d"]
+    fn create_proposal_set_max_validator_count() -> Weight {
+        (676_799_000 as Weight)
             .saturating_add(DbWeight::get().reads(7 as Weight))
             .saturating_add(DbWeight::get().writes(10 as Weight))
     }
-    fn create_proposal_create_working_group_lead_opening(i: u32, t: u32, d: u32) -> Weight {
-        (393_931_000 as Weight)
-            .saturating_add((383_000 as Weight).saturating_mul(i as Weight))
-            .saturating_add((6_783_000 as Weight).saturating_mul(t as Weight))
-            .saturating_add((164_000 as Weight).saturating_mul(d as Weight))
+    // WARNING! Some components were not used: ["t"]
+    fn create_proposal_create_working_group_lead_opening(i: u32, d: u32) -> Weight {
+        (634_447_000 as Weight)
+            .saturating_add((401_000 as Weight).saturating_mul(i as Weight))
+            .saturating_add((30_000 as Weight).saturating_mul(d as Weight))
             .saturating_add(DbWeight::get().reads(6 as Weight))
             .saturating_add(DbWeight::get().writes(10 as Weight))
     }
-    fn create_proposal_fill_working_group_lead_opening(t: u32, d: u32) -> Weight {
-        (566_718_000 as Weight)
-            .saturating_add((3_073_000 as Weight).saturating_mul(t as Weight))
-            .saturating_add((20_000 as Weight).saturating_mul(d as Weight))
+    // WARNING! Some components were not used: ["d"]
+    fn create_proposal_fill_working_group_lead_opening(t: u32) -> Weight {
+        (664_380_000 as Weight)
+            .saturating_add((57_000 as Weight).saturating_mul(t as Weight))
             .saturating_add(DbWeight::get().reads(6 as Weight))
             .saturating_add(DbWeight::get().writes(10 as Weight))
     }
     // WARNING! Some components were not used: ["t"]
     fn create_proposal_update_working_group_budget(d: u32) -> Weight {
-        (697_884_000 as Weight)
-            .saturating_add((4_000 as Weight).saturating_mul(d as Weight))
+        (655_799_000 as Weight)
+            .saturating_add((2_000 as Weight).saturating_mul(d as Weight))
             .saturating_add(DbWeight::get().reads(6 as Weight))
             .saturating_add(DbWeight::get().writes(10 as Weight))
     }
-    // WARNING! Some components were not used: ["t", "d"]
-    fn create_proposal_decrease_working_group_lead_stake() -> Weight {
-        (660_344_000 as Weight)
+    fn create_proposal_decrease_working_group_lead_stake(t: u32, d: u32) -> Weight {
+        (626_011_000 as Weight)
+            .saturating_add((757_000 as Weight).saturating_mul(t as Weight))
+            .saturating_add((6_000 as Weight).saturating_mul(d as Weight))
             .saturating_add(DbWeight::get().reads(6 as Weight))
             .saturating_add(DbWeight::get().writes(10 as Weight))
     }
-    // WARNING! Some components were not used: ["t"]
-    fn create_proposal_slash_working_group_lead(d: u32) -> Weight {
-        (650_009_000 as Weight)
-            .saturating_add((4_000 as Weight).saturating_mul(d as Weight))
+    // WARNING! Some components were not used: ["t", "d"]
+    fn create_proposal_slash_working_group_lead() -> Weight {
+        (685_880_000 as Weight)
             .saturating_add(DbWeight::get().reads(6 as Weight))
             .saturating_add(DbWeight::get().writes(10 as Weight))
     }
-    // WARNING! Some components were not used: ["t"]
-    fn create_proposal_set_working_group_lead_reward(d: u32) -> Weight {
-        (641_391_000 as Weight)
-            .saturating_add((1_000 as Weight).saturating_mul(d as Weight))
+    // WARNING! Some components were not used: ["d"]
+    fn create_proposal_set_working_group_lead_reward(t: u32) -> Weight {
+        (644_706_000 as Weight)
+            .saturating_add((98_000 as Weight).saturating_mul(t as Weight))
             .saturating_add(DbWeight::get().reads(6 as Weight))
             .saturating_add(DbWeight::get().writes(10 as Weight))
     }
-    fn create_proposal_terminate_working_group_lead(t: u32, d: u32) -> Weight {
-        (640_488_000 as Weight)
-            .saturating_add((55_000 as Weight).saturating_mul(t as Weight))
-            .saturating_add((1_000 as Weight).saturating_mul(d as Weight))
+    // WARNING! Some components were not used: ["d"]
+    fn create_proposal_terminate_working_group_lead(t: u32) -> Weight {
+        (666_916_000 as Weight)
+            .saturating_add((131_000 as Weight).saturating_mul(t as Weight))
             .saturating_add(DbWeight::get().reads(6 as Weight))
             .saturating_add(DbWeight::get().writes(10 as Weight))
     }
-    fn create_proposal_amend_constitution(i: u32, t: u32, d: u32) -> Weight {
-        (527_420_000 as Weight)
-            .saturating_add((278_000 as Weight).saturating_mul(i as Weight))
-            .saturating_add((1_785_000 as Weight).saturating_mul(t as Weight))
-            .saturating_add((21_000 as Weight).saturating_mul(d as Weight))
+    // WARNING! Some components were not used: ["d"]
+    fn create_proposal_amend_constitution(i: u32, t: u32) -> Weight {
+        (723_614_000 as Weight)
+            .saturating_add((292_000 as Weight).saturating_mul(i as Weight))
+            .saturating_add((478_000 as Weight).saturating_mul(t as Weight))
             .saturating_add(DbWeight::get().reads(6 as Weight))
             .saturating_add(DbWeight::get().writes(10 as Weight))
     }
-    // WARNING! Some components were not used: ["d"]
-    fn create_proposal_cancel_working_group_lead_opening(t: u32) -> Weight {
-        (644_736_000 as Weight)
-            .saturating_add((50_000 as Weight).saturating_mul(t as Weight))
+    // WARNING! Some components were not used: ["t", "d"]
+    fn create_proposal_cancel_working_group_lead_opening() -> Weight {
+        (651_882_000 as Weight)
             .saturating_add(DbWeight::get().reads(6 as Weight))
             .saturating_add(DbWeight::get().writes(10 as Weight))
     }
-    fn create_proposal_set_membership_price(t: u32, d: u32) -> Weight {
-        (638_989_000 as Weight)
-            .saturating_add((53_000 as Weight).saturating_mul(t as Weight))
+    // WARNING! Some components were not used: ["t"]
+    fn create_proposal_set_membership_price(d: u32) -> Weight {
+        (646_017_000 as Weight)
             .saturating_add((1_000 as Weight).saturating_mul(d as Weight))
             .saturating_add(DbWeight::get().reads(6 as Weight))
             .saturating_add(DbWeight::get().writes(10 as Weight))
     }
+    fn create_proposal_set_council_budget_increment(t: u32, d: u32) -> Weight {
+        (637_702_000 as Weight)
+            .saturating_add((283_000 as Weight).saturating_mul(t as Weight))
+            .saturating_add((2_000 as Weight).saturating_mul(d as Weight))
+            .saturating_add(DbWeight::get().reads(6 as Weight))
+            .saturating_add(DbWeight::get().writes(10 as Weight))
+    }
     // WARNING! Some components were not used: ["t"]
-    fn create_proposal_set_council_budget_increment(d: u32) -> Weight {
-        (635_709_000 as Weight)
-            .saturating_add((16_000 as Weight).saturating_mul(d as Weight))
+    fn create_proposal_set_councilor_reward(d: u32) -> Weight {
+        (650_165_000 as Weight)
+            .saturating_add((1_000 as Weight).saturating_mul(d as Weight))
             .saturating_add(DbWeight::get().reads(6 as Weight))
             .saturating_add(DbWeight::get().writes(10 as Weight))
     }
     // WARNING! Some components were not used: ["d"]
-    fn create_proposal_set_councilor_reward(t: u32) -> Weight {
-        (648_346_000 as Weight)
-            .saturating_add((110_000 as Weight).saturating_mul(t as Weight))
+    fn create_proposal_set_initial_invitation_balance(t: u32) -> Weight {
+        (647_828_000 as Weight)
+            .saturating_add((29_000 as Weight).saturating_mul(t as Weight))
             .saturating_add(DbWeight::get().reads(6 as Weight))
             .saturating_add(DbWeight::get().writes(10 as Weight))
     }
-    fn create_proposal_set_initial_invitation_balance(t: u32, d: u32) -> Weight {
-        (632_164_000 as Weight)
-            .saturating_add((271_000 as Weight).saturating_mul(t as Weight))
-            .saturating_add((1_000 as Weight).saturating_mul(d as Weight))
+    // WARNING! Some components were not used: ["t", "d"]
+    fn create_proposal_set_initial_invitation_count() -> Weight {
+        (652_119_000 as Weight)
             .saturating_add(DbWeight::get().reads(6 as Weight))
             .saturating_add(DbWeight::get().writes(10 as Weight))
     }
+    // WARNING! Some components were not used: ["t", "d"]
+    fn create_proposal_set_membership_lead_invitation_quota() -> Weight {
+        (1_534_657_000 as Weight)
+            .saturating_add(DbWeight::get().reads(6 as Weight))
+            .saturating_add(DbWeight::get().writes(10 as Weight))
+    }
+    fn create_proposal_set_referral_cut(t: u32, d: u32) -> Weight {
+        (538_230_000 as Weight)
+            .saturating_add((2_331_000 as Weight).saturating_mul(t as Weight))
+            .saturating_add((26_000 as Weight).saturating_mul(d as Weight))
+            .saturating_add(DbWeight::get().reads(6 as Weight))
+            .saturating_add(DbWeight::get().writes(10 as Weight))
+    }
+    fn update_working_group_budget_positive_forum() -> Weight {
+        (186_049_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 {
+        (186_498_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 {
+        (185_745_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 {
+        (185_138_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 {
+        (186_835_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 {
+        (186_768_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 {
+        (186_077_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 {
+        (186_014_000 as Weight)
+            .saturating_add(DbWeight::get().reads(2 as Weight))
+            .saturating_add(DbWeight::get().writes(2 as Weight))
+    }
+    fn funding_request() -> Weight {
+        (296_081_000 as Weight)
+            .saturating_add(DbWeight::get().reads(2 as Weight))
+            .saturating_add(DbWeight::get().writes(2 as Weight))
+    }
 }

+ 1 - 0
scripts/generate-weights.sh

@@ -47,6 +47,7 @@ benchmark pallet_session
 # Joystrem benchmarks
 benchmark proposals_discussion
 benchmark proposals_engine
+benchmark proposals_codex
 benchmark pallet_constitution
 benchmark working_group
 benchmark council