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:
2025-12-22 17:12:58 +03:00
parent 3208f208c0
commit abc4c3989b
898 changed files with 8671 additions and 6432 deletions
@@ -332,8 +332,8 @@ fn concluded_onchain(onchain_state: &DisputeState) -> bool {
// Check if there are enough onchain votes for or against to conclude the dispute
let supermajority = supermajority_threshold(onchain_state.validators_for.len());
onchain_state.validators_for.count_ones() >= supermajority ||
onchain_state.validators_against.count_ones() >= supermajority
onchain_state.validators_for.count_ones() >= supermajority
|| onchain_state.validators_against.count_ones() >= supermajority
}
fn partition_recent_disputes(
@@ -347,7 +347,7 @@ fn partition_recent_disputes(
let key = (session_index, candidate_hash);
if dispute_is_inactive(&dispute_state, time_now) {
match onchain.get(&key) {
Some(onchain_state) =>
Some(onchain_state) => {
if concluded_onchain(onchain_state) {
partitioned
.inactive_concluded_onchain
@@ -356,16 +356,19 @@ fn partition_recent_disputes(
partitioned
.inactive_unconcluded_onchain
.push((session_index, candidate_hash));
},
}
},
None => partitioned.inactive_unknown_onchain.push((session_index, candidate_hash)),
}
} else {
match onchain.get(&(session_index, candidate_hash)) {
Some(d) => match concluded_onchain(d) {
true =>
partitioned.active_concluded_onchain.push((session_index, candidate_hash)),
false =>
partitioned.active_unconcluded_onchain.push((session_index, candidate_hash)),
true => {
partitioned.active_concluded_onchain.push((session_index, candidate_hash))
},
false => {
partitioned.active_unconcluded_onchain.push((session_index, candidate_hash))
},
},
None => partitioned.active_unknown_onchain.push((session_index, candidate_hash)),
}
@@ -389,8 +392,8 @@ fn is_vote_worth_to_keep(
// punished when misbehaving.
if let Some(kind) = valid_kind {
match kind {
ValidDisputeStatementKind::BackingValid(_) |
ValidDisputeStatementKind::BackingSeconded(_) => return true,
ValidDisputeStatementKind::BackingValid(_)
| ValidDisputeStatementKind::BackingSeconded(_) => return true,
_ => (),
}
}
@@ -491,10 +494,12 @@ where
.map_err(|_| GetOnchainDisputesError::Channel)
.and_then(|res| {
res.map_err(|e| match e {
RuntimeApiError::Execution { .. } =>
GetOnchainDisputesError::Execution(e, relay_parent),
RuntimeApiError::NotSupported { .. } =>
GetOnchainDisputesError::NotSupported(e, relay_parent),
RuntimeApiError::Execution { .. } => {
GetOnchainDisputesError::Execution(e, relay_parent)
},
RuntimeApiError::NotSupported { .. } => {
GetOnchainDisputesError::NotSupported(e, relay_parent)
},
})
})
.map(|v| v.into_iter().map(|e| ((e.0, e.1), e.2)).collect())
@@ -666,8 +666,8 @@ fn many_batches() {
let vote_count = result.iter().map(|d| d.statements.len()).fold(0, |acc, v| acc + v);
assert!(
MAX_DISPUTE_VOTES_FORWARDED_TO_RUNTIME - VALIDATOR_COUNT <= vote_count &&
vote_count <= MAX_DISPUTE_VOTES_FORWARDED_TO_RUNTIME,
MAX_DISPUTE_VOTES_FORWARDED_TO_RUNTIME - VALIDATOR_COUNT <= vote_count
&& vote_count <= MAX_DISPUTE_VOTES_FORWARDED_TO_RUNTIME,
"vote_count: {}",
vote_count
);
@@ -720,8 +720,8 @@ fn votes_above_limit() {
let vote_count = result.iter().map(|d| d.statements.len()).fold(0, |acc, v| acc + v);
assert!(
MAX_DISPUTE_VOTES_FORWARDED_TO_RUNTIME - VALIDATOR_COUNT <= vote_count &&
vote_count <= MAX_DISPUTE_VOTES_FORWARDED_TO_RUNTIME,
MAX_DISPUTE_VOTES_FORWARDED_TO_RUNTIME - VALIDATOR_COUNT <= vote_count
&& vote_count <= MAX_DISPUTE_VOTES_FORWARDED_TO_RUNTIME,
"vote_count: {}",
vote_count
);