From 7216f1d82b9042db2b3b4f8943f1df2ea73e6bc1 Mon Sep 17 00:00:00 2001 From: Uncle Stretch Date: Tue, 29 Jul 2025 14:58:23 +0300 Subject: [PATCH] rustfmt ghost slow clap and fix typos Signed-off-by: Uncle Stretch --- pallets/slow-clap/Cargo.toml | 2 +- pallets/slow-clap/src/lib.rs | 24 ++++++++++++++---------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/pallets/slow-clap/Cargo.toml b/pallets/slow-clap/Cargo.toml index ec35be7..9f7ec79 100644 --- a/pallets/slow-clap/Cargo.toml +++ b/pallets/slow-clap/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ghost-slow-clap" -version = "0.3.34" +version = "0.3.35" description = "Applause protocol for the EVM bridge" license.workspace = true authors.workspace = true diff --git a/pallets/slow-clap/src/lib.rs b/pallets/slow-clap/src/lib.rs index 4f7b034..67be0a2 100644 --- a/pallets/slow-clap/src/lib.rs +++ b/pallets/slow-clap/src/lib.rs @@ -702,23 +702,27 @@ impl Pallet { ); let random_seed = sp_io::offchain::random_seed(); - let random_number = ::decode( - &mut TrailingZeroInput::new(random_seed.as_ref()) - ).expect("input is padded with zeroes; qed"); + let random_number = ::decode(&mut TrailingZeroInput::new(random_seed.as_ref())) + .expect("input is padded with zeroes; qed"); let rpc_endpoint = if stored_endpoints.len() > 0 { stored_endpoints .iter() - .nth((random_number as usize) - .checked_rem(stored_endpoints.len()) - .unwrap_or_default()) + .nth( + (random_number as usize) + .checked_rem(stored_endpoints.len()) + .unwrap_or_default(), + ) .expect("stored endpoint should be non empty; qed") } else { - network_data.default_endpoints + network_data + .default_endpoints .iter() - .nth((random_number as usize) - .checked_rem(network_data.default_endpoints.len()) - .unwrap_or_default()) + .nth( + (random_number as usize) + .checked_rem(network_data.default_endpoints.len()) + .unwrap_or_default(), + ) .expect("default endpoint should be non empty; qed") };