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