Polymesh icon indicating copy to clipboard operation
Polymesh copied to clipboard

Mesh 2149/staking-pallet-update-part-1

Open HenriqueNogara opened this issue 11 months ago • 0 comments

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 (MaxUnlockingChunksand MaxNominations);
  • 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 over T: Config;
  • The Nominations struct is now generic over T: Config, and Nominations::targets is now a BoundedVec not a Vec;
  • The inner function slashable_balance_of_fn was renamed weight_of_fn;
  • The inner function collect_exposure was renamed collect_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;

HenriqueNogara avatar Mar 14 '24 13:03 HenriqueNogara