mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-20 22:11:01 +00:00
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:
@@ -236,7 +236,6 @@ parameter_types! {
|
||||
pub static HistoryDepth: u32 = 80;
|
||||
pub static MaxUnlockingChunks: u32 = 32;
|
||||
pub static RewardOnUnbalanceWasCalled: bool = false;
|
||||
pub static LedgerSlashPerEra: (BalanceOf<Test>, BTreeMap<EraIndex, BalanceOf<Test>>) = (Zero::zero(), BTreeMap::new());
|
||||
pub static MaxWinners: u32 = 100;
|
||||
}
|
||||
|
||||
@@ -268,8 +267,14 @@ impl OnUnbalanced<PositiveImbalanceOf<Test>> for MockReward {
|
||||
}
|
||||
}
|
||||
|
||||
pub struct OnStakerSlashMock<T: Config>(core::marker::PhantomData<T>);
|
||||
impl<T: Config> sp_staking::OnStakerSlash<AccountId, Balance> for OnStakerSlashMock<T> {
|
||||
parameter_types! {
|
||||
pub static LedgerSlashPerEra:
|
||||
(BalanceOf<Test>, BTreeMap<EraIndex, BalanceOf<Test>>) =
|
||||
(Zero::zero(), BTreeMap::new());
|
||||
}
|
||||
|
||||
pub struct EventListenerMock;
|
||||
impl OnStakingUpdate<AccountId, Balance> for EventListenerMock {
|
||||
fn on_slash(
|
||||
_pool_account: &AccountId,
|
||||
slashed_bonded: Balance,
|
||||
@@ -284,7 +289,7 @@ impl crate::pallet::pallet::Config for Test {
|
||||
type Currency = Balances;
|
||||
type CurrencyBalance = <Self as pallet_balances::Config>::Balance;
|
||||
type UnixTime = Timestamp;
|
||||
type CurrencyToVote = frame_support::traits::SaturatingCurrencyToVote;
|
||||
type CurrencyToVote = ();
|
||||
type RewardRemainder = RewardRemainderMock;
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type Slash = ();
|
||||
@@ -305,7 +310,7 @@ impl crate::pallet::pallet::Config for Test {
|
||||
type TargetList = UseValidatorsMap<Self>;
|
||||
type MaxUnlockingChunks = MaxUnlockingChunks;
|
||||
type HistoryDepth = HistoryDepth;
|
||||
type OnStakerSlash = OnStakerSlashMock<Test>;
|
||||
type EventListeners = EventListenerMock;
|
||||
type BenchmarkingConfig = TestBenchmarkingConfig;
|
||||
type WeightInfo = ();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user