FRAME: Simplify and extend pallets config definition by using the stabilized feature: associated type bounds #3743
Labels
D2-substantial
Can be fixed by an experienced coder with a working knowledge of the codebase.
T1-FRAME
This PR/Issue is related to core FRAME, the framework.
Associated type bounds is stabilized: rust-lang/rust#122055
So we can do code like this:
Instead of doing this:
1: simplify
Config
definitionSo for pallets other than
frame_system
we no longer need the associated types:RuntimeEvent
,RuntimeOrigin
,RuntimeCall
, etc...Instead we should be able to modify the pallet
Config
trait definition like this:2: extend
Config
definitionWe should be able to add constraint on pallet dependencies way more easily without having to write
where ...
for each implementation block.To illustrate we could have a pallet which depends on
pallet_balances
but requires at least u128 as currency typeThe text was updated successfully, but these errors were encountered: