mirror of
https://git.ghostchain.io/proxmio/ghost-node.git
synced 2025-12-27 11:19:57 +00:00
rustfmt common runtime and fix typos
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
This commit is contained in:
@@ -4,7 +4,7 @@ use frame_support::{
|
||||
};
|
||||
use pallet_fast_unstake::{Pallet as FastUnstake, *};
|
||||
use pallet_staking::*;
|
||||
use sp_std::{collections::btree_set::BTreeSet, prelude:*};
|
||||
use sp_std::{collections::btree_set::BTreeSet, prelude::*};
|
||||
|
||||
/// Register all inactive nominators for fast unstake, and progress until they
|
||||
/// have all benn processed.
|
||||
@@ -16,7 +16,9 @@ where
|
||||
let mut unstaked_err = 0;
|
||||
let mut unstaked_slashed = 0;
|
||||
|
||||
let all_stakers = Ledger::<T>::iter().map(|(ctrl, l)| (ctrl, l.stash)).collect::<BTreeSet<_>>();
|
||||
let all_stakers = Ledger::<T>::iter()
|
||||
.map(|(ctrl, l)| (ctrl, l.stash))
|
||||
.collect::<BTreeSet<_>>();
|
||||
let mut all_exposed = BTreeSet::new();
|
||||
ErasStakers::<T>::iter().for_each(|(_, val, expo)| {
|
||||
all_exposed.insert(val);
|
||||
@@ -55,7 +57,7 @@ where
|
||||
let weight = <T as frame_system::Config>::BlockWeights::get().max_block;
|
||||
let consumed = FastUnstake::<T>::on_idle(now, weight);
|
||||
log::debug!(
|
||||
target: "runtime::test",
|
||||
target: "runtime::test",
|
||||
"consumed {:?} ({})",
|
||||
consumed,
|
||||
consumed.ref_time() as f32 / weight.ref_time() as f32,
|
||||
@@ -70,15 +72,16 @@ where
|
||||
maybe_fast_unstake_event
|
||||
})
|
||||
.for_each(|e: pallet_fast_unstake::Event<T>| match e {
|
||||
pallet_fast_unstake::Event<T>::Unstaked { result, .. } =>
|
||||
pallet_fast_unstake::Event::<T>::Unstaked { result, .. } => {
|
||||
if result.is_ok() {
|
||||
unstaked_ok += 1;
|
||||
} else {
|
||||
unstaked_err += 1;
|
||||
},
|
||||
}
|
||||
}
|
||||
pallet_fast_unstake::Event::<T>::Slashed { .. } => unstaked_slashed += 1,
|
||||
pallet_fast_unstake::Event::<T>::InternalError { .. } => unreachable!(),
|
||||
_ => {},
|
||||
_ => {}
|
||||
});
|
||||
|
||||
if now % 100u32.into() == sp_runtime::traits::Zero::zero() {
|
||||
|
||||
Reference in New Issue
Block a user