mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Add workspace lints
This commit is contained in:
@@ -127,14 +127,12 @@ impl ReattemptDb {
|
||||
.min(3);
|
||||
let upon_block = current_block_number + reattempt_delay;
|
||||
|
||||
#[allow(clippy::unwrap_or_default)]
|
||||
let mut reattempts = Self::get(txn, genesis, upon_block).unwrap_or(vec![]);
|
||||
reattempts.push(topic);
|
||||
Self::set(txn, genesis, upon_block, &reattempts);
|
||||
}
|
||||
|
||||
pub fn take(txn: &mut impl DbTxn, genesis: [u8; 32], block_number: u32) -> Vec<Topic> {
|
||||
#[allow(clippy::unwrap_or_default)]
|
||||
let res = Self::get(txn, genesis, block_number).unwrap_or(vec![]);
|
||||
if !res.is_empty() {
|
||||
Self::del(txn, genesis, block_number);
|
||||
|
||||
@@ -314,7 +314,7 @@ impl<
|
||||
.await;
|
||||
return;
|
||||
};
|
||||
let Ok(_) = self.check_sign_data_len(&removed, signed.signer, commitments.len()).await
|
||||
let Ok(()) = self.check_sign_data_len(&removed, signed.signer, commitments.len()).await
|
||||
else {
|
||||
return;
|
||||
};
|
||||
@@ -348,7 +348,7 @@ impl<
|
||||
.await;
|
||||
return;
|
||||
};
|
||||
let Ok(_) = self.check_sign_data_len(&removed, signed.signer, shares.len()).await else {
|
||||
let Ok(()) = self.check_sign_data_len(&removed, signed.signer, shares.len()).await else {
|
||||
return;
|
||||
};
|
||||
|
||||
@@ -626,7 +626,7 @@ impl<
|
||||
despite us not providing that transaction",
|
||||
);
|
||||
|
||||
for id in plan_ids.into_iter() {
|
||||
for id in plan_ids {
|
||||
AttemptDb::recognize_topic(self.txn, genesis, Topic::Sign(id));
|
||||
self
|
||||
.recognized_id
|
||||
@@ -650,7 +650,7 @@ impl<
|
||||
return;
|
||||
};
|
||||
let signer = data.signed.signer;
|
||||
let Ok(_) = self.check_sign_data_len(&removed, signer, data.data.len()).await else {
|
||||
let Ok(()) = self.check_sign_data_len(&removed, signer, data.data.len()).await else {
|
||||
return;
|
||||
};
|
||||
let expected_len = match data.label {
|
||||
@@ -711,7 +711,7 @@ impl<
|
||||
.await;
|
||||
return;
|
||||
};
|
||||
let Ok(_) = self.check_sign_data_len(&removed, data.signed.signer, data.data.len()).await
|
||||
let Ok(()) = self.check_sign_data_len(&removed, data.signed.signer, data.data.len()).await
|
||||
else {
|
||||
return;
|
||||
};
|
||||
|
||||
@@ -39,7 +39,6 @@ pub fn removed_as_of_dkg_attempt(
|
||||
}
|
||||
|
||||
pub fn latest_removed(getter: &impl Get, genesis: [u8; 32]) -> Vec<<Ristretto as Ciphersuite>::G> {
|
||||
#[allow(clippy::unwrap_or_default)]
|
||||
FatalSlashes::get(getter, genesis)
|
||||
.unwrap_or(vec![])
|
||||
.iter()
|
||||
|
||||
@@ -136,7 +136,7 @@ mod impl_pst_for_serai {
|
||||
signature: Signature,
|
||||
) {
|
||||
let tx = SeraiValidatorSets::set_keys(set.network, removed, key_pair, signature);
|
||||
async fn check(serai: SeraiValidatorSets<'_>, set: ValidatorSet, _: ()) -> bool {
|
||||
async fn check(serai: SeraiValidatorSets<'_>, set: ValidatorSet, (): ()) -> bool {
|
||||
if matches!(serai.keys(set).await, Ok(Some(_))) {
|
||||
log::info!("another coordinator set key pair for {:?}", set);
|
||||
return true;
|
||||
@@ -293,7 +293,6 @@ impl<
|
||||
*/
|
||||
match topic {
|
||||
Topic::Dkg => {
|
||||
#[allow(clippy::unwrap_or_default)]
|
||||
FatalSlashesAsOfDkgAttempt::set(
|
||||
self.txn,
|
||||
genesis,
|
||||
|
||||
@@ -158,7 +158,7 @@ impl<T: DbTxn, C: Encode> SigningProtocol<'_, T, C> {
|
||||
) -> Result<(AlgorithmSignatureMachine<Ristretto, Schnorrkel>, [u8; 32]), Participant> {
|
||||
let machine = self.preprocess_internal(participants).0;
|
||||
|
||||
let mut participants = serialized_preprocesses.keys().cloned().collect::<Vec<_>>();
|
||||
let mut participants = serialized_preprocesses.keys().copied().collect::<Vec<_>>();
|
||||
participants.sort();
|
||||
let mut preprocesses = HashMap::new();
|
||||
for participant in participants {
|
||||
@@ -231,7 +231,7 @@ fn threshold_i_map_to_keys_and_musig_i_map(
|
||||
};
|
||||
|
||||
let mut sorted = vec![];
|
||||
let mut threshold_is = map.keys().cloned().collect::<Vec<_>>();
|
||||
let mut threshold_is = map.keys().copied().collect::<Vec<_>>();
|
||||
threshold_is.sort();
|
||||
for threshold_i in threshold_is {
|
||||
sorted.push((key_from_threshold_i(threshold_i), map.remove(&threshold_i).unwrap()));
|
||||
|
||||
Reference in New Issue
Block a user