-
Notifications
You must be signed in to change notification settings - Fork 768
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
[Deprecation] Treasury Proposals and spend_local
call
#5930
Comments
The PR deprecating the public items should have the implementation of |
I think there's already config of
|
…#6169) Resolves #5930 `spend_local` from `treasury` pallet and associated types are deprecated. `spend_local` was being used before with native currency in the treasury. This PR provides a documentation on how to migrate to the `spend` call instead. ### 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>; .. } ``` --------- Co-authored-by: DavidK <davidk@parity.io> Co-authored-by: Muharem <ismailov.m.h@gmail.com>
Deprecate the items related to the Gov_v1 treasury spend flow and provide an implementation of the
Pay
trait within the treasury pallet to make it possible to setup thespend
call to work asspend_local
.Deprecated items:
Proposals
,ProposalCount
andApprovals
storage items;spend_local
andremove_approval
calls;MaxApprovals
);Reference issue: #138
Tasks
The text was updated successfully, but these errors were encountered: