mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 05:51:02 +00:00
Update Staking Weights (#5964)
This commit is contained in:
@@ -27,7 +27,7 @@ use frame_support::{
|
||||
assert_ok, impl_outer_origin, parameter_types, impl_outer_dispatch, impl_outer_event,
|
||||
StorageValue, StorageMap, StorageDoubleMap, IterableStorageMap,
|
||||
traits::{Currency, Get, FindAuthor, OnFinalize, OnInitialize},
|
||||
weights::Weight,
|
||||
weights::{Weight, constants::RocksDbWeight},
|
||||
};
|
||||
use sp_io;
|
||||
use sp_phragmen::{
|
||||
@@ -36,7 +36,7 @@ use sp_phragmen::{
|
||||
};
|
||||
use crate::*;
|
||||
|
||||
const INIT_TIMESTAMP: u64 = 30_000;
|
||||
pub const INIT_TIMESTAMP: u64 = 30_000;
|
||||
|
||||
/// The AccountId alias in this test module.
|
||||
pub(crate) type AccountId = u64;
|
||||
@@ -211,7 +211,7 @@ impl frame_system::Trait for Test {
|
||||
type Event = MetaEvent;
|
||||
type BlockHashCount = BlockHashCount;
|
||||
type MaximumBlockWeight = MaximumBlockWeight;
|
||||
type DbWeight = ();
|
||||
type DbWeight = RocksDbWeight;
|
||||
type BlockExecutionWeight = ();
|
||||
type ExtrinsicBaseWeight = ();
|
||||
type AvailableBlockRatio = AvailableBlockRatio;
|
||||
@@ -763,6 +763,18 @@ pub(crate) fn on_offence_now(
|
||||
on_offence_in_era(offenders, slash_fraction, now)
|
||||
}
|
||||
|
||||
pub(crate) fn add_slash(who: &AccountId) {
|
||||
on_offence_now(
|
||||
&[
|
||||
OffenceDetails {
|
||||
offender: (who.clone(), Staking::eras_stakers(Staking::active_era().unwrap().index, who.clone())),
|
||||
reporters: vec![],
|
||||
},
|
||||
],
|
||||
&[Perbill::from_percent(10)],
|
||||
);
|
||||
}
|
||||
|
||||
// winners will be chosen by simply their unweighted total backing stake. Nominator stake is
|
||||
// distributed evenly.
|
||||
pub(crate) fn horrible_phragmen_with_post_processing(
|
||||
|
||||
Reference in New Issue
Block a user