remove OnStakerSlash replace with OnStakingEvents (#14527)

* remove 'OnStakerSlash', replace with 'OnStakingEvents'

* fix other features in pallets

* small fixes

* fix docs

* fix docs

* fix docs

* Update primitives/staking/src/lib.rs

Co-authored-by: Gonçalo Pestana <g6pestana@gmail.com>

---------

Co-authored-by: Gonçalo Pestana <g6pestana@gmail.com>
This commit is contained in:
Kian Paimani
2023-07-09 14:46:18 +02:00
committed by GitHub
parent 53244d64bd
commit 6dd625d568
28 changed files with 261 additions and 177 deletions
@@ -14,6 +14,7 @@ frame-support = { version = "4.0.0-dev", path = "../../../frame/support" }
frame-election-provider-support = { version = "4.0.0-dev", path = "../../../frame/election-provider-support" }
frame-system = { version = "4.0.0-dev", path = "../../../frame/system" }
pallet-staking = { version = "4.0.0-dev", path = "../../../frame/staking" }
sp-staking = { version = "4.0.0-dev", path = "../../../primitives/staking" }
# third party
chrono = { version = "0.4.19" }
@@ -18,8 +18,7 @@
//! Support code to ease the process of generating bag thresholds.
//!
//! NOTE: this assume the runtime implements [`pallet_staking::Config`], as it requires an
//! implementation of the traits [`frame_support::traits::Currency`] and
//! [`frame_support::traits::CurrencyToVote`].
//! implementation of the traits [`frame_support::traits::Currency`] and `CurrencyToVote`.
//!
//! The process of adding bags to a runtime requires only four steps.
//!
@@ -70,7 +69,7 @@ fn existential_weight<T: pallet_staking::Config>(
total_issuance: u128,
minimum_balance: u128,
) -> VoteWeight {
use frame_support::traits::CurrencyToVote;
use sp_staking::currency_to_vote::CurrencyToVote;
T::CurrencyToVote::to_vote(
minimum_balance