-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[Deprecation] deprecate treasury spend_local call and related items
#6169
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
Merged
Merged
Changes from 24 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
061d27f
Deprecate Gov_v1 flow components inside treasury pallet
74ed8e3
Formatting fixes
6acbeb4
prdoc fixes
05f5006
More fixes for deprecation messages
4151276
Allow deprecated dependency in bounties
8814ba2
Allow more deprecations in bounties tests
28888a5
Add deprecated to more pallets
52024b0
Correct version bumps in prdoc
804e796
Update substrate/frame/treasury/src/lib.rs
davidk-pt d7d8273
Update substrate/frame/treasury/src/lib.rs
davidk-pt cd7a9e5
Update substrate/frame/treasury/src/lib.rs
davidk-pt b24ef4d
Update prdoc/pr_6169.prdoc
davidk-pt dfe6a4a
Merge branch 'master' into davidk/treasury-deprecate-proposals
davidk-pt b912a47
Update substrate/frame/treasury/src/lib.rs
davidk-pt 1a78b8f
Change kitchensink runtime to use native and assets for treasury
c22c7df
Improve prdoc with example
021fda5
Better markdown headings
4a35d37
Remove deprecated from items where warning cannot be hidden
37f3071
Fix allow deprecations for tests and benchmarks
82aae6b
Merge branch 'master' into davidk/treasury-deprecate-proposals
davidk-pt af300f7
Fix prdoc
fef1701
Add benchmarks arguments to kitchensink runtime
b9f2ee0
Add deprecation in documentation of the items
f11fa40
Merge branch 'master' into davidk/treasury-deprecate-proposals
davidk-pt 7904975
Merge branch 'master' into davidk/treasury-deprecate-proposals
davidk-pt 6304678
Merge branch 'master' into davidk/treasury-deprecate-proposals
davidk-pt 96a5648
Formatting fixes
0a31dcc
Allow deprecated in tests
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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| title: "[Deprecation] deprecate treasury `spend_local` call and related items" | ||
|
|
||
| doc: | ||
| - audience: Runtime Dev | ||
| description: | | ||
| Deprecates `spend_local` from the treasury pallet and items associated with it. | ||
|
|
||
| ### Migration | ||
|
|
||
| #### For users who were using only `spend_local` before | ||
|
|
||
| To replace `spend_local` functionality configure `Paymaster` pallet configuration to be `PayFromAccount` and configure `AssetKind` to be `()` and use `spend` call instead. | ||
| This way `spend` call will function as deprecated `spend_local`. | ||
|
|
||
| Example: | ||
| ``` | ||
| impl pallet_treasury::Config for Runtime { | ||
| .. | ||
| type AssetKind = (); | ||
| type Paymaster = PayFromAccount<Self::Currency, TreasuryAccount>; | ||
| // convert balance 1:1 ratio with native currency | ||
| type BalanceConverter = UnityAssetBalanceConversion; | ||
| .. | ||
| } | ||
| ``` | ||
|
|
||
| #### For users who were already using `spend` with all other assets, except the native asset | ||
|
|
||
| Use `NativeOrWithId` type for `AssetKind` and have a `UnionOf` for native and non-native assets, then use that with `PayAssetFromAccount`. | ||
|
|
||
| Example from `kitchensink-runtime`: | ||
| ``` | ||
| // Union of native currency and assets | ||
| pub type NativeAndAssets = | ||
| UnionOf<Balances, Assets, NativeFromLeft, NativeOrWithId<u32>, AccountId>; | ||
|
|
||
| impl pallet_treasury::Config for Runtime { | ||
| .. | ||
| type AssetKind = NativeOrWithId<u32>; | ||
| type Paymaster = PayAssetFromAccount<NativeAndAssets, TreasuryAccount>; | ||
| type BalanceConverter = AssetRate; | ||
| .. | ||
| } | ||
|
|
||
| // AssetRate pallet configuration | ||
| impl pallet_asset_rate::Config for Runtime { | ||
| .. | ||
| type Currency = Balances; | ||
| type AssetKind = NativeOrWithId<u32>; | ||
| .. | ||
| } | ||
| ``` | ||
|
|
||
|
|
||
| crates: | ||
| - name: pallet-treasury | ||
| bump: patch | ||
| - name: pallet-bounties | ||
| bump: patch | ||
| - name: pallet-child-bounties | ||
| bump: patch | ||
| - name: pallet-tips | ||
| bump: patch | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.