style: Migrate to stable-only rustfmt configuration
- Remove nightly-only features from .rustfmt.toml and vendor/ss58-registry/rustfmt.toml - Removed features: imports_granularity, wrap_comments, comment_width, reorder_impl_items, spaces_around_ranges, binop_separator, match_arm_blocks, trailing_semicolon, trailing_comma - Format all 898 affected files with stable rustfmt - Ensures long-term reliability without nightly toolchain dependency
This commit is contained in:
@@ -532,8 +532,8 @@ impl<T: Config> Pezpallet<T> {
|
||||
fn is_online_aux(authority_index: AuthIndex, authority: &ValidatorId<T>) -> bool {
|
||||
let current_session = T::ValidatorSet::session_index();
|
||||
|
||||
ReceivedHeartbeats::<T>::contains_key(current_session, authority_index) ||
|
||||
AuthoredBlocks::<T>::get(current_session, authority) != 0
|
||||
ReceivedHeartbeats::<T>::contains_key(current_session, authority_index)
|
||||
|| AuthoredBlocks::<T>::get(current_session, authority) != 0
|
||||
}
|
||||
|
||||
/// Returns `true` if a heartbeat has been received for the authority at `authority_index` in
|
||||
@@ -583,8 +583,8 @@ impl<T: Config> Pezpallet<T> {
|
||||
// haven't sent an heartbeat yet we'll send one unconditionally. the idea is to prevent
|
||||
// all nodes from sending the heartbeats at the same block and causing a temporary (but
|
||||
// deterministic) spike in transactions.
|
||||
progress >= START_HEARTBEAT_FINAL_PERIOD ||
|
||||
progress >= START_HEARTBEAT_RANDOM_PERIOD && random_choice(progress)
|
||||
progress >= START_HEARTBEAT_FINAL_PERIOD
|
||||
|| progress >= START_HEARTBEAT_RANDOM_PERIOD && random_choice(progress)
|
||||
} else {
|
||||
// otherwise we fallback to using the block number calculated at the beginning
|
||||
// of the session that should roughly correspond to the middle of the session
|
||||
@@ -695,8 +695,9 @@ impl<T: Config> Pezpallet<T> {
|
||||
// we will re-send it.
|
||||
match status {
|
||||
// we are still waiting for inclusion.
|
||||
Ok(Some(status)) if status.is_recent(session_index, now) =>
|
||||
Err(OffchainErr::WaitingForInclusion(status.sent_at)),
|
||||
Ok(Some(status)) if status.is_recent(session_index, now) => {
|
||||
Err(OffchainErr::WaitingForInclusion(status.sent_at))
|
||||
},
|
||||
// attempt to set new status
|
||||
_ => Ok(HeartbeatStatus { session_index, sent_at: now }),
|
||||
}
|
||||
|
||||
@@ -125,8 +125,9 @@ fn heartbeat(
|
||||
signature: signature.clone(),
|
||||
})
|
||||
.map_err(|e| match e {
|
||||
TransactionValidityError::Invalid(InvalidTransaction::Custom(INVALID_VALIDATORS_LEN)) =>
|
||||
"invalid validators len",
|
||||
TransactionValidityError::Invalid(InvalidTransaction::Custom(INVALID_VALIDATORS_LEN)) => {
|
||||
"invalid validators len"
|
||||
},
|
||||
e @ _ => <&'static str>::from(e),
|
||||
})?;
|
||||
ImOnline::heartbeat(RuntimeOrigin::none(), heartbeat, signature)
|
||||
@@ -226,8 +227,9 @@ fn should_generate_heartbeats() {
|
||||
// check stuff about the transaction.
|
||||
let ex: Extrinsic = Decode::decode(&mut &*transaction).unwrap();
|
||||
let heartbeat = match ex.function {
|
||||
crate::mock::RuntimeCall::ImOnline(crate::Call::heartbeat { heartbeat, .. }) =>
|
||||
heartbeat,
|
||||
crate::mock::RuntimeCall::ImOnline(crate::Call::heartbeat { heartbeat, .. }) => {
|
||||
heartbeat
|
||||
},
|
||||
e => panic!("Unexpected call: {:?}", e),
|
||||
};
|
||||
|
||||
@@ -340,8 +342,9 @@ fn should_not_send_a_report_if_already_online() {
|
||||
// check stuff about the transaction.
|
||||
let ex: Extrinsic = Decode::decode(&mut &*transaction).unwrap();
|
||||
let heartbeat = match ex.function {
|
||||
crate::mock::RuntimeCall::ImOnline(crate::Call::heartbeat { heartbeat, .. }) =>
|
||||
heartbeat,
|
||||
crate::mock::RuntimeCall::ImOnline(crate::Call::heartbeat { heartbeat, .. }) => {
|
||||
heartbeat
|
||||
},
|
||||
e => panic!("Unexpected call: {:?}", e),
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user