rustfmt slow-clap pallet

Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
This commit is contained in:
Uncle Stretch 2025-11-27 19:06:18 +03:00
parent 911db3b974
commit c9b4325c04
Signed by: str3tch
GPG Key ID: 84F3190747EE79AA
3 changed files with 9 additions and 5 deletions

View File

@ -1,6 +1,6 @@
[package] [package]
name = "ghost-slow-clap" name = "ghost-slow-clap"
version = "0.4.2" version = "0.4.3"
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

View File

@ -609,8 +609,12 @@ impl<T: Config> Pallet<T> {
let applause_threshold = Perbill::from_parts(T::ApplauseThreshold::get()); let applause_threshold = Perbill::from_parts(T::ApplauseThreshold::get());
let threshold_amount = applause_threshold.mul_floor(TotalExposure::<T>::get()); let threshold_amount = applause_threshold.mul_floor(TotalExposure::<T>::get());
let maybe_account_id = T::ExposureListener::get_account_by_index(clap.authority_index as usize); let maybe_account_id =
ensure!(maybe_account_id.is_some(), Error::<T>::NonExistentAuthorityIndex); T::ExposureListener::get_account_by_index(clap.authority_index as usize);
ensure!(
maybe_account_id.is_some(),
Error::<T>::NonExistentAuthorityIndex
);
let account_id = maybe_account_id.unwrap(); let account_id = maybe_account_id.unwrap();
let new_clapped_amount = T::ExposureListener::get_validator_exposure(&account_id); let new_clapped_amount = T::ExposureListener::get_validator_exposure(&account_id);

View File

@ -531,8 +531,8 @@ fn should_applause_and_take_next_claps() {
assert_eq!(Balances::total_balance(&receiver), 0); assert_eq!(Balances::total_balance(&receiver), 0);
for i in 0..=3 { for i in 0..=3 {
assert_ok!(do_clap_from(session_index, network_id, i, false)); assert_ok!(do_clap_from(session_index, network_id, i, false));
let account_id = TestExposureListener::get_account_by_index(i as usize) let account_id =
.unwrap_or_default(); TestExposureListener::get_account_by_index(i as usize).unwrap_or_default();
clapped_amount = TestExposureListener::get_validator_exposure(&account_id) clapped_amount = TestExposureListener::get_validator_exposure(&account_id)
.saturating_add(clapped_amount); .saturating_add(clapped_amount);
assert_clapped_amount(&session_index, &unique_hash, clapped_amount); assert_clapped_amount(&session_index, &unique_hash, clapped_amount);