Polymesh
Polymesh copied to clipboard
Mesh 2149/staking-pallet-update-part-1
This PR updates our staking pallet to use the new macros. This also makes our code easier to compare to the substrate code.
Most relevant changes:
- Adds two new associated types (
MaxUnlockingChunks
andMaxNominations
); - All Polymesh custom types were moved to
pallets/staking/src/types.rs
; - All pallet definitions were moved to
pallets/staking/src/pallet/mod.rs
, this includes Config, Storage, Event, Error, Hooks and Call; - All functions that are not extrinsics were moved to
pallets/staking/src/pallet/impls.rs
; - The
StakingLedger
struct is now generic overT: Config
; - The
Nominations
struct is now generic overT: Config
, andNominations::targets
is now aBoundedVec
not aVec
; - The inner function
slashable_balance_of_fn
was renamedweight_of_fn
; - The inner function
collect_exposure
was renamedcollect_exposures
; - Adds two error variants:
BoundNotMet
,TooManyNominators
;
- Note:
on_runtime_upgrade
was removed;
changelog
new features
modified external API
- Adds two error variants:
BoundNotMet
,TooManyNominators
to the staking pallet Error;