[Staking] Noop refactor to prep pallet for currency fungible migration (#5399)
This is a no-op refactor of staking pallet to move all `T::Currency` api calls under one module. A followup PR (https://github.com/paritytech/polkadot-sdk/pull/5501) will implement the Currency <> Fungible migration for the pallet. Introduces the new `asset` module that centralizes all interaction with `T::Currency`. This is an attempt to try minimising staking logic changes to minimal parts of the codebase. ## Things of note - `T::Currency::free_balance` in current implementation includes both staked (locked) and liquid tokens (kinda sounds wrong to call it free then). This PR renames it to `stakeable_balance` (any better name suggestions?). With #5501, this will become `free balance that can be held/staked` + `already held/staked balance`.
Showing
- substrate/frame/delegated-staking/src/impls.rs 1 addition, 3 deletionssubstrate/frame/delegated-staking/src/impls.rs
- substrate/frame/delegated-staking/src/tests.rs 1 addition, 1 deletionsubstrate/frame/delegated-staking/src/tests.rs
- substrate/frame/election-provider-multi-phase/test-staking-e2e/src/lib.rs 24 additions, 17 deletions...election-provider-multi-phase/test-staking-e2e/src/lib.rs
- substrate/frame/election-provider-multi-phase/test-staking-e2e/src/mock.rs 2 additions, 3 deletions...lection-provider-multi-phase/test-staking-e2e/src/mock.rs
- substrate/frame/fast-unstake/src/tests.rs 14 additions, 6 deletionssubstrate/frame/fast-unstake/src/tests.rs
- substrate/frame/nomination-pools/benchmarking/src/inner.rs 3 additions, 1 deletionsubstrate/frame/nomination-pools/benchmarking/src/inner.rs
- substrate/frame/nomination-pools/src/adapter.rs 1 addition, 1 deletionsubstrate/frame/nomination-pools/src/adapter.rs
- substrate/frame/offences/benchmarking/src/inner.rs 37 additions, 26 deletionssubstrate/frame/offences/benchmarking/src/inner.rs
- substrate/frame/root-offences/src/tests.rs 10 additions, 9 deletionssubstrate/frame/root-offences/src/tests.rs
- substrate/frame/staking/src/asset.rs 125 additions, 0 deletionssubstrate/frame/staking/src/asset.rs
- substrate/frame/staking/src/benchmarking.rs 32 additions, 31 deletionssubstrate/frame/staking/src/benchmarking.rs
- substrate/frame/staking/src/ledger.rs 5 additions, 13 deletionssubstrate/frame/staking/src/ledger.rs
- substrate/frame/staking/src/lib.rs 1 addition, 0 deletionssubstrate/frame/staking/src/lib.rs
- substrate/frame/staking/src/pallet/impls.rs 20 additions, 25 deletionssubstrate/frame/staking/src/pallet/impls.rs
- substrate/frame/staking/src/pallet/mod.rs 23 additions, 30 deletionssubstrate/frame/staking/src/pallet/mod.rs
- substrate/frame/staking/src/slashing.rs 7 additions, 7 deletionssubstrate/frame/staking/src/slashing.rs
- substrate/frame/staking/src/testing_utils.rs 7 additions, 7 deletionssubstrate/frame/staking/src/testing_utils.rs
- substrate/frame/staking/src/tests.rs 224 additions, 211 deletionssubstrate/frame/staking/src/tests.rs
- substrate/primitives/staking/src/lib.rs 1 addition, 1 deletionsubstrate/primitives/staking/src/lib.rs
Please register or sign in to comment