rustfmt ghost slow clap and fix typos

Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
This commit is contained in:
Uncle Stretch 2025-07-29 14:58:23 +03:00
parent 792e70c988
commit 7216f1d82b
Signed by: str3tch
GPG Key ID: 84F3190747EE79AA
2 changed files with 15 additions and 11 deletions

View File

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

@ -702,23 +702,27 @@ impl<T: Config> Pallet<T> {
); );
let random_seed = sp_io::offchain::random_seed(); let random_seed = sp_io::offchain::random_seed();
let random_number = <u32>::decode( let random_number = <u32>::decode(&mut TrailingZeroInput::new(random_seed.as_ref()))
&mut TrailingZeroInput::new(random_seed.as_ref()) .expect("input is padded with zeroes; qed");
).expect("input is padded with zeroes; qed");
let rpc_endpoint = if stored_endpoints.len() > 0 { let rpc_endpoint = if stored_endpoints.len() > 0 {
stored_endpoints stored_endpoints
.iter() .iter()
.nth((random_number as usize) .nth(
.checked_rem(stored_endpoints.len()) (random_number as usize)
.unwrap_or_default()) .checked_rem(stored_endpoints.len())
.unwrap_or_default(),
)
.expect("stored endpoint should be non empty; qed") .expect("stored endpoint should be non empty; qed")
} else { } else {
network_data.default_endpoints network_data
.default_endpoints
.iter() .iter()
.nth((random_number as usize) .nth(
.checked_rem(network_data.default_endpoints.len()) (random_number as usize)
.unwrap_or_default()) .checked_rem(network_data.default_endpoints.len())
.unwrap_or_default(),
)
.expect("default endpoint should be non empty; qed") .expect("default endpoint should be non empty; qed")
}; };