take disabled from the next session and rustfmt pallet code
Signed-off-by: Uncle Stinky <uncle.stinky@ghostchain.io>
This commit is contained in:
parent
7a710ec9cb
commit
a3ed395689
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "ghost-slow-clap"
|
||||
version = "0.3.49"
|
||||
version = "0.3.50"
|
||||
description = "Applause protocol for the EVM bridge"
|
||||
license.workspace = true
|
||||
authors.workspace = true
|
||||
|
||||
@ -9,8 +9,8 @@ use frame_support::{
|
||||
pallet_prelude::*,
|
||||
traits::{
|
||||
tokens::fungible::{Inspect, Mutate},
|
||||
EstimateNextSessionRotation, Get, OneSessionHandler, ValidatorSet,
|
||||
ValidatorSetWithIdentification, DisabledValidators,
|
||||
DisabledValidators, EstimateNextSessionRotation, Get, OneSessionHandler, ValidatorSet,
|
||||
ValidatorSetWithIdentification,
|
||||
},
|
||||
WeakBoundedVec,
|
||||
};
|
||||
@ -404,7 +404,7 @@ pub mod pallet {
|
||||
.map(|info| info.disabled)
|
||||
.unwrap_or_default()
|
||||
{
|
||||
return InvalidTransaction::BadSigner.into();
|
||||
return InvalidTransaction::BadSigner.into();
|
||||
}
|
||||
|
||||
let signature_valid =
|
||||
@ -645,7 +645,7 @@ impl<T: Config> Pallet<T> {
|
||||
.cloned()
|
||||
.collect::<BTreeSet<T::AuthorityId>>();
|
||||
|
||||
let disabled_authorities = ClapsInSession::<T>::get(&prev_session_index)
|
||||
let disabled_authorities = ClapsInSession::<T>::get(&curr_session_index)
|
||||
.values()
|
||||
.filter(|info| info.disabled)
|
||||
.count();
|
||||
@ -1116,10 +1116,13 @@ impl<T: Config> Pallet<T> {
|
||||
|
||||
let mut disabled_validators: BTreeMap<AuthIndex, SessionAuthorityInfo> = Default::default();
|
||||
for disabled_index in T::DisabledValidators::disabled_validators().iter() {
|
||||
let _ = disabled_validators.insert(*disabled_index, SessionAuthorityInfo {
|
||||
claps: 0u32,
|
||||
disabled: true,
|
||||
});
|
||||
let _ = disabled_validators.insert(
|
||||
*disabled_index,
|
||||
SessionAuthorityInfo {
|
||||
claps: 0u32,
|
||||
disabled: true,
|
||||
},
|
||||
);
|
||||
}
|
||||
ClapsInSession::<T>::set(&session_index, disabled_validators);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user