mirror of
https://git.ghostchain.io/proxmio/ghost-node.git
synced 2025-12-27 11:19:57 +00:00
rustfmt ghost slow clap and fix typos
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
This commit is contained in:
@@ -702,23 +702,27 @@ impl<T: Config> Pallet<T> {
|
||||
);
|
||||
|
||||
let random_seed = sp_io::offchain::random_seed();
|
||||
let random_number = <u32>::decode(
|
||||
&mut TrailingZeroInput::new(random_seed.as_ref())
|
||||
).expect("input is padded with zeroes; qed");
|
||||
let random_number = <u32>::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")
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user