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:
@@ -391,9 +391,9 @@ pub mod ring_vrf {
|
||||
const OVERHEAD_SIZE: usize = 16;
|
||||
const G2_POINTS_NUM: usize = 2;
|
||||
let g1_points_num = ark_vrf::ring::pcs_domain_size::<BandersnatchSuite>(ring_size);
|
||||
OVERHEAD_SIZE +
|
||||
g1_points_num * G1_POINT_UNCOMPRESSED_SIZE +
|
||||
G2_POINTS_NUM * G2_POINT_UNCOMPRESSED_SIZE
|
||||
OVERHEAD_SIZE
|
||||
+ g1_points_num * G1_POINT_UNCOMPRESSED_SIZE
|
||||
+ G2_POINTS_NUM * G2_POINT_UNCOMPRESSED_SIZE
|
||||
}
|
||||
|
||||
/// [`RingVerifierKey`] serialized size.
|
||||
|
||||
@@ -121,8 +121,8 @@ pub const SIGNATURE_SERIALIZED_SIZE: usize =
|
||||
<DoubleSignature<TinyBLS381> as SerializableToBytes>::SERIALIZED_BYTES_SIZE;
|
||||
|
||||
/// Signature serialized size (for back cert) + Nugget BLS PoP size
|
||||
pub const PROOF_OF_POSSESSION_SERIALIZED_SIZE: usize = SIGNATURE_SERIALIZED_SIZE +
|
||||
<NuggetBLSnCPPoP<TinyBLS381> as SerializableToBytes>::SERIALIZED_BYTES_SIZE;
|
||||
pub const PROOF_OF_POSSESSION_SERIALIZED_SIZE: usize = SIGNATURE_SERIALIZED_SIZE
|
||||
+ <NuggetBLSnCPPoP<TinyBLS381> as SerializableToBytes>::SERIALIZED_BYTES_SIZE;
|
||||
|
||||
/// A secret seed.
|
||||
///
|
||||
|
||||
@@ -1299,14 +1299,16 @@ mod tests {
|
||||
password,
|
||||
path: path.into_iter().chain(path_iter).collect(),
|
||||
},
|
||||
TestPair::GeneratedFromPhrase { phrase, password } =>
|
||||
TestPair::Standard { phrase, password, path: path_iter.collect() },
|
||||
x =>
|
||||
TestPair::GeneratedFromPhrase { phrase, password } => {
|
||||
TestPair::Standard { phrase, password, path: path_iter.collect() }
|
||||
},
|
||||
x => {
|
||||
if path_iter.count() == 0 {
|
||||
x
|
||||
} else {
|
||||
return Err(DeriveError::SoftKeyInPath);
|
||||
},
|
||||
}
|
||||
},
|
||||
},
|
||||
None,
|
||||
))
|
||||
|
||||
@@ -75,13 +75,14 @@ impl OffchainStorage for InMemOffchainStorage {
|
||||
let key = prefix.iter().chain(key).cloned().collect();
|
||||
|
||||
match self.storage.entry(key) {
|
||||
Entry::Vacant(entry) =>
|
||||
Entry::Vacant(entry) => {
|
||||
if old_value.is_none() {
|
||||
entry.insert(new_value.to_vec());
|
||||
true
|
||||
} else {
|
||||
false
|
||||
},
|
||||
}
|
||||
},
|
||||
Entry::Occupied(ref mut entry) if Some(entry.get().as_slice()) == old_value => {
|
||||
entry.insert(new_value.to_vec());
|
||||
true
|
||||
@@ -161,8 +162,9 @@ impl<Storage: OffchainStorage> DbExternalities for OffchainDb<Storage> {
|
||||
"CAS",
|
||||
);
|
||||
match kind {
|
||||
StorageKind::PERSISTENT =>
|
||||
self.persistent.compare_and_set(STORAGE_PREFIX, key, old_value, new_value),
|
||||
StorageKind::PERSISTENT => {
|
||||
self.persistent.compare_and_set(STORAGE_PREFIX, key, old_value, new_value)
|
||||
},
|
||||
StorageKind::LOCAL => unavailable_yet(LOCAL_DB),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,8 +80,9 @@ impl TestPersistentOffchainDB {
|
||||
let mut me = self.persistent.write();
|
||||
for ((_prefix, key), value_operation) in changes {
|
||||
match value_operation {
|
||||
OffchainOverlayedChange::SetValue(val) =>
|
||||
me.set(Self::PREFIX, key.as_slice(), val.as_slice()),
|
||||
OffchainOverlayedChange::SetValue(val) => {
|
||||
me.set(Self::PREFIX, key.as_slice(), val.as_slice())
|
||||
},
|
||||
OffchainOverlayedChange::Remove => me.remove(Self::PREFIX, key.as_slice()),
|
||||
}
|
||||
}
|
||||
@@ -381,10 +382,12 @@ impl offchain::DbExternalities for TestOffchainExt {
|
||||
) -> bool {
|
||||
let mut state = self.0.write();
|
||||
match kind {
|
||||
StorageKind::LOCAL =>
|
||||
state.local_storage.compare_and_set(b"", key, old_value, new_value),
|
||||
StorageKind::PERSISTENT =>
|
||||
state.persistent_storage.compare_and_set(b"", key, old_value, new_value),
|
||||
StorageKind::LOCAL => {
|
||||
state.local_storage.compare_and_set(b"", key, old_value, new_value)
|
||||
},
|
||||
StorageKind::PERSISTENT => {
|
||||
state.persistent_storage.compare_and_set(b"", key, old_value, new_value)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -520,25 +520,34 @@ pub mod vrf {
|
||||
NotMarkedSchnorrkel => "Signature error: `NotMarkedSchnorrkel`".into(),
|
||||
BytesLengthError { .. } => "Signature error: `BytesLengthError`".into(),
|
||||
InvalidKey => "Signature error: `InvalidKey`".into(),
|
||||
MuSigAbsent { musig_stage: Commitment } =>
|
||||
"Signature error: `MuSigAbsent` at stage `Commitment`".into(),
|
||||
MuSigAbsent { musig_stage: Reveal } =>
|
||||
"Signature error: `MuSigAbsent` at stage `Reveal`".into(),
|
||||
MuSigAbsent { musig_stage: Cosignature } =>
|
||||
"Signature error: `MuSigAbsent` at stage `Commitment`".into(),
|
||||
MuSigInconsistent { musig_stage: Commitment, duplicate: true } =>
|
||||
"Signature error: `MuSigInconsistent` at stage `Commitment` on duplicate".into(),
|
||||
MuSigInconsistent { musig_stage: Commitment, duplicate: false } =>
|
||||
"Signature error: `MuSigInconsistent` at stage `Commitment` on not duplicate".into(),
|
||||
MuSigInconsistent { musig_stage: Reveal, duplicate: true } =>
|
||||
"Signature error: `MuSigInconsistent` at stage `Reveal` on duplicate".into(),
|
||||
MuSigInconsistent { musig_stage: Reveal, duplicate: false } =>
|
||||
"Signature error: `MuSigInconsistent` at stage `Reveal` on not duplicate".into(),
|
||||
MuSigInconsistent { musig_stage: Cosignature, duplicate: true } =>
|
||||
"Signature error: `MuSigInconsistent` at stage `Cosignature` on duplicate".into(),
|
||||
MuSigInconsistent { musig_stage: Cosignature, duplicate: false } =>
|
||||
MuSigAbsent { musig_stage: Commitment } => {
|
||||
"Signature error: `MuSigAbsent` at stage `Commitment`".into()
|
||||
},
|
||||
MuSigAbsent { musig_stage: Reveal } => {
|
||||
"Signature error: `MuSigAbsent` at stage `Reveal`".into()
|
||||
},
|
||||
MuSigAbsent { musig_stage: Cosignature } => {
|
||||
"Signature error: `MuSigAbsent` at stage `Commitment`".into()
|
||||
},
|
||||
MuSigInconsistent { musig_stage: Commitment, duplicate: true } => {
|
||||
"Signature error: `MuSigInconsistent` at stage `Commitment` on duplicate".into()
|
||||
},
|
||||
MuSigInconsistent { musig_stage: Commitment, duplicate: false } => {
|
||||
"Signature error: `MuSigInconsistent` at stage `Commitment` on not duplicate".into()
|
||||
},
|
||||
MuSigInconsistent { musig_stage: Reveal, duplicate: true } => {
|
||||
"Signature error: `MuSigInconsistent` at stage `Reveal` on duplicate".into()
|
||||
},
|
||||
MuSigInconsistent { musig_stage: Reveal, duplicate: false } => {
|
||||
"Signature error: `MuSigInconsistent` at stage `Reveal` on not duplicate".into()
|
||||
},
|
||||
MuSigInconsistent { musig_stage: Cosignature, duplicate: true } => {
|
||||
"Signature error: `MuSigInconsistent` at stage `Cosignature` on duplicate".into()
|
||||
},
|
||||
MuSigInconsistent { musig_stage: Cosignature, duplicate: false } => {
|
||||
"Signature error: `MuSigInconsistent` at stage `Cosignature` on not duplicate"
|
||||
.into(),
|
||||
.into()
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user