This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Pallets: Treasury deprecate propose_spend
dispatchable
#14538
Merged
paritytech-processbot
merged 7 commits into
master
from
muharem-treasury-deprecate-dispatchables
Aug 10, 2023
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
f18509b
treasury deprecate dispatchables
muharem 4edf3a3
allow deprecated
muharem 8a2dab8
allow deprecated for benchmarks
muharem 80647f7
allow deprecated in tests
muharem 2d45c1b
allow deprecated for bounties tests
muharem 25cc143
Merge remote-tracking branch 'origin/master' into muharem-treasury-de…
muharem 703213d
deprecation month
muharem File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -336,6 +336,10 @@ pub mod pallet { | |
/// - O(1) | ||
#[pallet::call_index(0)] | ||
#[pallet::weight(T::WeightInfo::propose_spend())] | ||
#[allow(deprecated)] | ||
#[deprecated( | ||
note = "`propose_spend` will be removed in February 2024. Use `spend` instead." | ||
)] | ||
pub fn propose_spend( | ||
origin: OriginFor<T>, | ||
#[pallet::compact] value: BalanceOf<T, I>, | ||
|
@@ -364,6 +368,10 @@ pub mod pallet { | |
/// - O(1) | ||
#[pallet::call_index(1)] | ||
#[pallet::weight((T::WeightInfo::reject_proposal(), DispatchClass::Operational))] | ||
#[allow(deprecated)] | ||
#[deprecated( | ||
note = "`reject_proposal` will be removed in February 2024. Use `spend` instead." | ||
)] | ||
pub fn reject_proposal( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could rename them to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it can be a solution actually, but I would first agree on it and have it as a standard to not create multiple ways of deprecating |
||
origin: OriginFor<T>, | ||
#[pallet::compact] proposal_id: ProposalIndex, | ||
|
@@ -392,6 +400,10 @@ pub mod pallet { | |
/// - O(1). | ||
#[pallet::call_index(2)] | ||
#[pallet::weight((T::WeightInfo::approve_proposal(T::MaxApprovals::get()), DispatchClass::Operational))] | ||
#[allow(deprecated)] | ||
#[deprecated( | ||
note = "`approve_proposal` will be removed in February 2024. Use `spend` instead." | ||
)] | ||
pub fn approve_proposal( | ||
origin: OriginFor<T>, | ||
#[pallet::compact] proposal_id: ProposalIndex, | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wonder if developers will notice these deprecations, may be there is a better way to deprecate dispatchables?
this at least will be included in release notes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean the pr will be included? Otherwise no one really will see this from the upper layers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The metadata does not carry deprecation info, or?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bkchr yes, which is a good part.
the combination of
#[allow(deprecated)]
and#[deprecated(...)]
for one item looks hacky.may be whitelisting those warnings could be a solution.
@ggwpez just checked, it does not. you can see it in rococo contracts, the contracts pallet has deprecated calls.
but it does include docs, so we could include it into docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/paritytech/substrate/issues/13976#issuecomment-1570081315
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created a deprecation issue for it - https://github.com/paritytech/substrate/issues/14732
Can you please review the PR
I did not add anything to metadata since there is no agreement on it yet.