Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Luxor/reduce council budget #5062

Merged
merged 24 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
0faab6d
feat: :art: add extrinsic for decreasing budgetj
Jan 26, 2024
b797a10
test: :test_tube: add tests for new extrinsic
Jan 26, 2024
86a254c
feat: :art: add proposal and tests to proposal pallet
Jan 26, 2024
b7f9bc7
feat: :art: add proposal config to runtime
Jan 26, 2024
192a773
fix: :zap: rearrange checks
Jan 26, 2024
28e6fb1
test: :zap: add proposal to integration test and update types and met…
Jan 30, 2024
ddc9a39
feat: :art: metadata 2003
Jan 30, 2024
f3a8c3e
Revert "test: :zap: add proposal to integration test and update types…
Jan 31, 2024
ccc7490
feat: :zap: fix error on integration tests code
Jan 31, 2024
ba85a32
fix: :green_heart: fix CI errors & warning
Feb 22, 2024
a88003d
feat: :art: address PR comment
Feb 22, 2024
1f823ff
style: :rotating_light: linter
Feb 23, 2024
82b039d
fix: :zap: generate types and metadata
Feb 23, 2024
c2acd1e
fix: :art: rebase and regenerate metadata
Mar 1, 2024
cb13cf6
fix: :bug: metadata 2002 should be the same as nara
Mar 12, 2024
86d862f
fix: :zap: revert query-node/chain-metadata/2002.json to the master v…
Mar 20, 2024
84a3456
Add the decrease council budget proposal mappings
thesan Mar 7, 2024
35e7175
Add CouncilBudgetDecreasedEvent mappings
thesan Mar 20, 2024
d44b700
Add DecreaseCouncilBudgetProposalDetails to the ProposalDetails union
thesan Mar 21, 2024
4195007
Merge pull request #11 from thesan/luxor/reduce-council-budget-qn
Mar 22, 2024
e0076f9
Merge branch 'luxor' into pr/ignazio-bovo/5062
Mar 22, 2024
3a4804a
Fix decrease council budget proposal amount value
thesan Mar 22, 2024
9b820c8
Merge pull request #12 from thesan/luxor/reduce-council-budget-qn
Mar 22, 2024
61f0c66
feat: :zap: add benchmark fordecrease_council_budget
Mar 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion chain-metadata.json

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion query-node/chain-metadata/2002.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions query-node/chain-metadata/2003.json

Large diffs are not rendered by default.

47 changes: 47 additions & 0 deletions runtime-modules/council/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,11 @@ decl_event! {
/// Councilor reward has been updated.
CouncilorRewardUpdated(Balance),

/// Councilor budget has been decreased
/// Params:
/// - Reduction amount
CouncilBudgetDecreased(Balance),

/// Request has been funded
RequestFunded(AccountId, Balance),

Expand Down Expand Up @@ -518,6 +523,9 @@ decl_error! {

/// Cannot withdraw: insufficient budget balance.
InsufficientBalanceForTransfer,

/// Cannot reduce the budget by the given amount.
ReductionAmountTooLarge
}
}

Expand Down Expand Up @@ -843,6 +851,38 @@ decl_module! {
Ok(())
}

/// Decrease the council total budget
///
/// # <weight>
///
/// ## weight
/// `O (1)`
/// - db:
/// - `O(1)` doesn't depend on the state or parameters
/// # </weight>
#[weight = 10_000_000] // TODO: adjust
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a weight function for this dispatch

Copy link
Collaborator Author

@ignazio-bovo ignazio-bovo Mar 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was part of a bigger issue that there are no benchmarks.
I have added that for the reduce_council_budget, thanks for pointing it out

pub fn decrease_council_budget(origin, reduction_amount: Balance<T>) -> Result<(), Error<T>> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when adding a new dispatch that is invoked by a proposal, it is best to try to add it at the end so that the method index of existing dispatches doesn't change, so we can have the option to not remove all pending proposals on runtime upgrades.

// ensure action can be started
EnsureChecks::<T>::can_decrease_council_budget(origin)?;

// ensure reduction amount is not too large
ensure!(
reduction_amount <= Self::budget(),
Error::<T>::ReductionAmountTooLarge
);

//
// == MUTATION SAFE ==
//

// update state
Mutations::<T>::decrease_budget(reduction_amount);

// emit event
Self::deposit_event(RawEvent::CouncilBudgetDecreased(reduction_amount));

Ok(())
}

/// Transfers funds from council budget to account
///
Expand Down Expand Up @@ -1788,6 +1828,13 @@ impl<T: Config> EnsureChecks<T> {

Ok(())
}

// Ensures there is no problem in decreasing the council budget
fn can_decrease_council_budget(origin: T::RuntimeOrigin) -> Result<(), Error<T>> {
ensure_root(origin)?;

Ok(())
}
}

impl<T: Config + common::membership::MembershipTypes>
Expand Down
82 changes: 81 additions & 1 deletion runtime-modules/council/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use common::council::CouncilOriginValidator;
use frame_support::dispatch::DispatchError;
use frame_support::traits::Currency;
use frame_support::WeakBoundedVec;
use frame_support::{assert_err, assert_ok, StorageValue};
use frame_support::{assert_err, assert_noop, assert_ok, StorageValue};
use frame_system::RawOrigin;
use staking_handler::StakingHandler;

Expand Down Expand Up @@ -2097,3 +2097,83 @@ fn candidate_remark_unsuccessful_with_invalid_origin() {
);
});
}

#[test]
fn decrease_council_budget_fails_with_non_root_origin() {
let config = default_genesis_config();
let initial_budget = 1_000u64;
let reduction_amount = 100u64;
let account_id = 0;
let root_origin = OriginType::Root;

build_test_externalities(config).execute_with(|| {
Mocks::set_budget(root_origin, initial_budget, Ok(()));

assert_noop!(
Council::decrease_council_budget(
RawOrigin::Signed(account_id).into(),
reduction_amount
),
Error::<Runtime>::BadOrigin,
);
});
}

#[test]
fn decrease_council_budget_fails_with_reduction_amount_too_large() {
let config = default_genesis_config();
let initial_budget = 100u64;
let reduction_amount = initial_budget.saturating_mul(10);

build_test_externalities(config).execute_with(|| {
Mocks::set_budget(OriginType::Root, initial_budget, Ok(()));

assert_noop!(
Council::decrease_council_budget(RawOrigin::Root.into(), reduction_amount),
Error::<Runtime>::ReductionAmountTooLarge,
);
});
}

#[test]
fn decrease_council_budget_ok_with_reduction_accounted() {
let config = default_genesis_config();
let initial_budget = 100u64;
let reduction_amount = 10u64;
let root_origin = OriginType::Root;

build_test_externalities(config).execute_with(|| {
Mocks::set_budget(root_origin, initial_budget, Ok(()));

assert_ok!(Council::decrease_council_budget(
RawOrigin::Root.into(),
reduction_amount
));

assert_eq!(
Budget::<Runtime>::get(),
initial_budget.saturating_sub(reduction_amount)
);
});
}

#[test]
fn decrease_council_budget_ok_with_event_deposited() {
let config = default_genesis_config();
let initial_budget = 100u64;
let reduction_amount = 10u64;
let root_origin = OriginType::Root;

build_test_externalities(config).execute_with(|| {
Mocks::set_budget(root_origin, initial_budget, Ok(()));

assert_ok!(Council::decrease_council_budget(
RawOrigin::Root.into(),
reduction_amount
));

EventFixture::assert_last_crate_event(crate::RawEvent::CouncilBudgetDecreased(
reduction_amount,
));
});
}
67 changes: 35 additions & 32 deletions runtime-modules/proposals/codex/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,46 @@ edition = '2018'

[dependencies]
serde = { version = "1.0.101", optional = true, features = ["derive"] }
codec = { package = 'parity-scale-codec', version = '3.1.2', default-features = false, features = ['derive'] }
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
sp-std = { package = 'sp-std', default-features = false, git = 'https://github.com/joystream/substrate.git', rev = '1d0eefca86ef31b9e7727df01a6ed23ad65491e9'}
sp-core = { package = 'sp-core', default-features = false, git = 'https://github.com/joystream/substrate.git', rev = '1d0eefca86ef31b9e7727df01a6ed23ad65491e9'}
frame-support = { package = 'frame-support', default-features = false, git = 'https://github.com/joystream/substrate.git', rev = '1d0eefca86ef31b9e7727df01a6ed23ad65491e9'}
sp-arithmetic = { package = 'sp-arithmetic', default-features = false, git = 'https://github.com/joystream/substrate.git', rev = '1d0eefca86ef31b9e7727df01a6ed23ad65491e9'}
sp-runtime = { package = 'sp-runtime', default-features = false, git = 'https://github.com/joystream/substrate.git', rev = '1d0eefca86ef31b9e7727df01a6ed23ad65491e9'}
frame-system = { package = 'frame-system', default-features = false, git = 'https://github.com/joystream/substrate.git', rev = '1d0eefca86ef31b9e7727df01a6ed23ad65491e9'}
staking = { package = 'pallet-staking', default-features = false, git = 'https://github.com/joystream/substrate.git', rev = '1d0eefca86ef31b9e7727df01a6ed23ad65491e9'}
pallet-timestamp = { package = 'pallet-timestamp', default-features = false, git = 'https://github.com/joystream/substrate.git', rev = '1d0eefca86ef31b9e7727df01a6ed23ad65491e9'}
working-group = { package = 'pallet-working-group', default-features = false, path = '../../working-group'}
common = { package = 'pallet-common', default-features = false, path = '../../common'}
proposals-engine = { package = 'pallet-proposals-engine', default-features = false, path = '../engine'}
proposals-discussion = { package = 'pallet-proposals-discussion', default-features = false, path = '../discussion'}
constitution = { package = 'pallet-constitution', default-features = false, path = '../../constitution'}
membership = { package = 'pallet-membership', default-features = false, path = '../../membership'}
content = { package = 'pallet-content', default-features = false, path = '../../content'}
balances = { package = 'pallet-balances', default-features = false, git = 'https://github.com/joystream/substrate.git', rev = '1d0eefca86ef31b9e7727df01a6ed23ad65491e9', optional = true}
codec = { package = 'parity-scale-codec', version = '3.1.2', default-features = false, features = [
'derive',
] }
scale-info = { version = "2.1.1", default-features = false, features = [
"derive",
] }
sp-std = { package = 'sp-std', default-features = false, git = 'https://github.com/joystream/substrate.git', rev = '1d0eefca86ef31b9e7727df01a6ed23ad65491e9' }
sp-core = { package = 'sp-core', default-features = false, git = 'https://github.com/joystream/substrate.git', rev = '1d0eefca86ef31b9e7727df01a6ed23ad65491e9' }
frame-support = { package = 'frame-support', default-features = false, git = 'https://github.com/joystream/substrate.git', rev = '1d0eefca86ef31b9e7727df01a6ed23ad65491e9' }
sp-arithmetic = { package = 'sp-arithmetic', default-features = false, git = 'https://github.com/joystream/substrate.git', rev = '1d0eefca86ef31b9e7727df01a6ed23ad65491e9' }
sp-runtime = { package = 'sp-runtime', default-features = false, git = 'https://github.com/joystream/substrate.git', rev = '1d0eefca86ef31b9e7727df01a6ed23ad65491e9' }
frame-system = { package = 'frame-system', default-features = false, git = 'https://github.com/joystream/substrate.git', rev = '1d0eefca86ef31b9e7727df01a6ed23ad65491e9' }
staking = { package = 'pallet-staking', default-features = false, git = 'https://github.com/joystream/substrate.git', rev = '1d0eefca86ef31b9e7727df01a6ed23ad65491e9' }
pallet-timestamp = { package = 'pallet-timestamp', default-features = false, git = 'https://github.com/joystream/substrate.git', rev = '1d0eefca86ef31b9e7727df01a6ed23ad65491e9' }
working-group = { package = 'pallet-working-group', default-features = false, path = '../../working-group' }
common = { package = 'pallet-common', default-features = false, path = '../../common' }
proposals-engine = { package = 'pallet-proposals-engine', default-features = false, path = '../engine' }
proposals-discussion = { package = 'pallet-proposals-discussion', default-features = false, path = '../discussion' }
constitution = { package = 'pallet-constitution', default-features = false, path = '../../constitution' }
membership = { package = 'pallet-membership', default-features = false, path = '../../membership' }
content = { package = 'pallet-content', default-features = false, path = '../../content' }
balances = { package = 'pallet-balances', default-features = false, git = 'https://github.com/joystream/substrate.git', rev = '1d0eefca86ef31b9e7727df01a6ed23ad65491e9', optional = true }
council = { package = 'pallet-council', default-features = false, path = '../../council' }
token = { package = 'pallet-project-token', default-features = false, path = '../../project-token' }

# Benchmarking dependencies
frame-benchmarking = { package = 'frame-benchmarking', default-features = false, git = 'https://github.com/joystream/substrate.git', rev = '1d0eefca86ef31b9e7727df01a6ed23ad65491e9', optional = true}
council = { package = 'pallet-council', default-features = false, path = '../../council', optional = true}
frame-benchmarking = { package = 'frame-benchmarking', default-features = false, git = 'https://github.com/joystream/substrate.git', rev = '1d0eefca86ef31b9e7727df01a6ed23ad65491e9', optional = true }

[dev-dependencies]
sp-io = { package = 'sp-io', default-features = false, git = 'https://github.com/joystream/substrate.git', rev = '1d0eefca86ef31b9e7727df01a6ed23ad65491e9'}
sp-core = { package = 'sp-core', default-features = false, git = 'https://github.com/joystream/substrate.git', rev = '1d0eefca86ef31b9e7727df01a6ed23ad65491e9'}
sp-staking = { package = 'sp-staking', default-features = false, git = 'https://github.com/joystream/substrate.git', rev = '1d0eefca86ef31b9e7727df01a6ed23ad65491e9'}
pallet-staking-reward-curve = { package = 'pallet-staking-reward-curve', default-features = false, git = 'https://github.com/joystream/substrate.git', rev = '1d0eefca86ef31b9e7727df01a6ed23ad65491e9'}
strum = {version = "0.19", default-features = false}
staking-handler = { package = 'pallet-staking-handler', default-features = false, path = '../../staking-handler'}
referendum = { package = 'pallet-referendum', default-features = false, path = '../../referendum'}
council = { package = 'pallet-council', default-features = false, path = '../../council'}
balances = { package = 'pallet-balances', default-features = false, git = 'https://github.com/joystream/substrate.git', rev = '1d0eefca86ef31b9e7727df01a6ed23ad65491e9'}
frame-election-provider-support = { package = 'frame-election-provider-support', git = 'https://github.com/joystream/substrate.git', rev = '1d0eefca86ef31b9e7727df01a6ed23ad65491e9'}
pallet-bags-list = { package = 'pallet-bags-list', git = 'https://github.com/joystream/substrate.git', rev = '1d0eefca86ef31b9e7727df01a6ed23ad65491e9'}
sp-npos-elections = { package = 'sp-npos-elections', git = 'https://github.com/joystream/substrate.git', rev = '1d0eefca86ef31b9e7727df01a6ed23ad65491e9'}
sp-io = { package = 'sp-io', default-features = false, git = 'https://github.com/joystream/substrate.git', rev = '1d0eefca86ef31b9e7727df01a6ed23ad65491e9' }
sp-core = { package = 'sp-core', default-features = false, git = 'https://github.com/joystream/substrate.git', rev = '1d0eefca86ef31b9e7727df01a6ed23ad65491e9' }
sp-staking = { package = 'sp-staking', default-features = false, git = 'https://github.com/joystream/substrate.git', rev = '1d0eefca86ef31b9e7727df01a6ed23ad65491e9' }
pallet-staking-reward-curve = { package = 'pallet-staking-reward-curve', default-features = false, git = 'https://github.com/joystream/substrate.git', rev = '1d0eefca86ef31b9e7727df01a6ed23ad65491e9' }
strum = { version = "0.19", default-features = false }
staking-handler = { package = 'pallet-staking-handler', default-features = false, path = '../../staking-handler' }
referendum = { package = 'pallet-referendum', default-features = false, path = '../../referendum' }
balances = { package = 'pallet-balances', default-features = false, git = 'https://github.com/joystream/substrate.git', rev = '1d0eefca86ef31b9e7727df01a6ed23ad65491e9' }
frame-election-provider-support = { package = 'frame-election-provider-support', git = 'https://github.com/joystream/substrate.git', rev = '1d0eefca86ef31b9e7727df01a6ed23ad65491e9' }
pallet-bags-list = { package = 'pallet-bags-list', git = 'https://github.com/joystream/substrate.git', rev = '1d0eefca86ef31b9e7727df01a6ed23ad65491e9' }
sp-npos-elections = { package = 'sp-npos-elections', git = 'https://github.com/joystream/substrate.git', rev = '1d0eefca86ef31b9e7727df01a6ed23ad65491e9' }

[features]
default = ['std']
Expand Down
29 changes: 29 additions & 0 deletions runtime-modules/proposals/codex/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ pub trait Config:
+ working_group::Config<OperationsWorkingGroupInstanceBeta>
+ working_group::Config<OperationsWorkingGroupInstanceGamma>
+ working_group::Config<DistributionWorkingGroupInstance>
+ council::Config
{
/// Proposal Codex module event type.
type RuntimeEvent: From<Event<Self>> + Into<<Self as frame_system::Config>::RuntimeEvent>;
Expand Down Expand Up @@ -279,6 +280,11 @@ pub trait Config:
type SetPalletFozenStatusProposalParameters: Get<
ProposalParameters<Self::BlockNumber, BalanceOf<Self>>,
>;

/// `Decrease Council Budget` proposal parameters
type DecreaseCouncilBudgetProposalParameters: Get<
ProposalParameters<Self::BlockNumber, BalanceOf<Self>>,
>;
}

/// Specialized alias of GeneralProposalParams
Expand Down Expand Up @@ -385,6 +391,9 @@ decl_error! {

/// Arithmeic Error
ArithmeticError,

/// Reduction Amount Zero
ReductionAmountZero,
}
}

Expand Down Expand Up @@ -503,6 +512,11 @@ decl_module! {
const SetMaxValidatorCountProposalMaxValidators: u32 =
T::SetMaxValidatorCountProposalMaxValidators::get();

/// Decrease Council budget parameters
const DecreaseCouncilBudgetProposalParameters:
ProposalParameters<T::BlockNumber, BalanceOf<T>> = T::DecreaseCouncilBudgetProposalParameters::get();

/// Set Pallet Frozen status
const SetPalletFozenStatusProposalParameters:
ProposalParameters<T::BlockNumber, BalanceOf<T>> = T::SetPalletFozenStatusProposalParameters::get();

Expand Down Expand Up @@ -877,6 +891,12 @@ impl<T: Config> Module<T> {
ProposalDetails::SetPalletFozenStatus(..) => {
// Note: No checks for this proposal for now
}
ProposalDetails::DecreaseCouncilBudget(reduction_amount) => {
ensure!(
!(*reduction_amount).is_zero(),
Error::<T>::ReductionAmountZero
);
}
}

Ok(())
Expand Down Expand Up @@ -947,6 +967,9 @@ impl<T: Config> Module<T> {
ProposalDetails::SetPalletFozenStatus(..) => {
T::SetPalletFozenStatusProposalParameters::get()
}
ProposalDetails::DecreaseCouncilBudget(..) => {
T::DecreaseCouncilBudgetProposalParameters::get()
}
}
}

Expand Down Expand Up @@ -1114,6 +1137,12 @@ impl<T: Config> Module<T> {
to_kb(description_length.saturated_into()),
)
}
ProposalDetails::DecreaseCouncilBudget(..) => {
WeightInfoCodex::<T>::create_proposal_decrease_council_budget(
to_kb(title_length.saturated_into()),
to_kb(description_length.saturated_into()),
)
}
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion runtime-modules/proposals/codex/src/tests/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ frame_support::construct_runtime!(
Membership: membership::{Pallet, Call, Storage, Event<T>},
ProposalsCodex: proposals_codex::{Pallet, Call, Storage, Event<T>},
ProposalsEngine: proposals_engine::{Pallet, Call, Storage, Event<T>},
Council: council::{Pallet, Call, Storage, Event<T>},
Referendum: referendum::<Instance1>::{Pallet, Call, Storage, Event<T>},
ProposalsDiscussion: proposals_discussion::{Pallet, Call, Storage, Event<T>},
ForumWorkingGroup: working_group::<Instance1>::{Pallet, Call, Storage, Event<T>},
Expand All @@ -105,6 +104,7 @@ frame_support::construct_runtime!(
OperationsWorkingGroupBeta: working_group::<Instance7>::{Pallet, Call, Storage, Event<T>},
OperationsWorkingGroupGamma: working_group::<Instance8>::{Pallet, Call, Storage, Event<T>},
DistributionWorkingGroup: working_group::<Instance9>::{Pallet, Call, Storage, Event<T>},
Council: council::{Pallet, Call, Storage, Event<T>},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you find it necessary to move the Council pallet down here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error[E0277]: the trait bound `RuntimeEvent: From<pallet_council::RawEvent<u64, u64, u64, u64>>` is not satisfied
   --> runtime-modules/proposals/codex/src/tests/mock.rs:696:25
    |
696 |     type RuntimeEvent = RuntimeEvent;
    |                         ^^^^^^^^^^^^ the trait `From<pallet_council::RawEvent<u64, u64, u64, u64>>` is not implemented for `RuntimeEvent`

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

without that

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is is something about the way this particular mock is implemented with respect to types. We do not seem to need to do the same for the main runtime/lib.rs

}
);

Expand Down Expand Up @@ -670,6 +670,7 @@ impl crate::Config for Test {
type FundingRequestProposalMaxAccounts = FundingRequestProposalMaxAccounts;
type SetMaxValidatorCountProposalMaxValidators = SetMaxValidatorCountProposalMaxValidators;
type SetPalletFozenStatusProposalParameters = DefaultProposalParameters;
type DecreaseCouncilBudgetProposalParameters = DefaultProposalParameters;
}

parameter_types! {
Expand Down
23 changes: 23 additions & 0 deletions runtime-modules/proposals/codex/src/tests/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
mod mock;

use content::NftLimitPeriod;
use frame_support::assert_noop;
use frame_support::dispatch::{DispatchError, DispatchResult};
use frame_support::storage::StorageMap;
use frame_support::traits::Currency;
Expand Down Expand Up @@ -1696,6 +1697,28 @@ fn create_terminate_working_group_leader_role_proposal_common_checks_succeed() {
}
}

#[test]
fn create_decrease_working_group_budget_fails_with_zero_reduction_amount() {
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,
};
initial_test_ext().execute_with(|| {
increase_total_balance_issuance_using_account_id(1, 500000);
assert_noop!(
ProposalsCodex::create_proposal(
RawOrigin::Signed(1).into(),
general_proposal_parameters,
ProposalDetails::DecreaseCouncilBudget(0u64)
),
Error::<Test>::ReductionAmountZero
);
})
}

fn run_create_terminate_working_group_leader_role_proposal_common_checks_succeed(
group: WorkingGroup,
) {
Expand Down
3 changes: 3 additions & 0 deletions runtime-modules/proposals/codex/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ pub enum ProposalDetails<

/// `SetPalletFozenStatus` proposal
SetPalletFozenStatus(bool, FreezablePallet),

/// `DecreaseCouncilBudget` proposal
DecreaseCouncilBudget(Balance),
}

impl<
Expand Down
Loading
Loading