[FRAME] Named account references #3647
Labels
D2-substantial
Can be fixed by an experienced coder with a working knowledge of the codebase.
I5-enhancement
An additional feature request.
We currently use the
dec_ / inc_
functions forprovider
,consumer
andsufficient
across pallets.These references are anonymous and a pallet has no way to check whether an account has a specific reference or not.
This has caused issues in the past, at last with the Currency Migration (paritytech/substrate#12951).
I would propose to have named types for all references, similar to Holds and Freezes. This would mean the introduction of:
RuntimeAccountProviderReason
RuntimeAccountConsumerReason
RuntimeAccountSufficientReason
with each being the aggregate across all pallets'
Account..Reason
enums. We should already have macro infrastructure in place to implement this without much overhead.Migration
We then need to do some migration over to the named references. Possibly lazy, by first trying to access anonymous refs and then placing named references. Or through a MBM.
The text was updated successfully, but these errors were encountered: