Add workspace lints

This commit is contained in:
Luke Parker
2023-12-16 20:54:24 -05:00
parent c40ce00955
commit ea3af28139
122 changed files with 329 additions and 128 deletions

View File

@@ -13,6 +13,9 @@ publish = false
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
[lints]
workspace = true
[dependencies]
hex = "0.4"

View File

@@ -40,7 +40,7 @@ pub async fn batch(
) -> u64 {
let id = SubstrateSignId { session, id: SubstrateSignableId::Batch(batch.id), attempt: 0 };
for processor in processors.iter_mut() {
for processor in &mut *processors {
processor
.send_message(messages::substrate::ProcessorMessage::Batch { batch: batch.clone() })
.await;
@@ -92,7 +92,7 @@ pub async fn batch(
let known_signer_i = Participant::new(u16::from(processor_is[known_signer])).unwrap();
assert!(!preprocesses.contains_key(&known_signer_i));
let mut participants = preprocesses.keys().cloned().collect::<HashSet<_>>();
let mut participants = preprocesses.keys().copied().collect::<HashSet<_>>();
for (p, preprocess) in preprocesses {
assert_eq!(preprocess, [u8::try_from(u16::from(p)).unwrap(); 64]);
}
@@ -219,7 +219,7 @@ pub async fn batch(
// Verify the coordinator sends SubstrateBlock to all processors
let last_block = serai.finalized_block_by_number(last_serai_block).await.unwrap().unwrap();
for processor in processors {
for processor in &mut *processors {
// Handle a potential re-attempt message in the pipeline
let mut received = processor.recv_message().await;
if matches!(

View File

@@ -166,7 +166,7 @@ pub async fn key_gen<C: Ciphersuite>(
}
}
let mut message = None;
for processor in processors.iter_mut() {
for processor in &mut *processors {
let msg = processor.recv_message().await;
if message.is_none() {
match msg {
@@ -208,7 +208,7 @@ pub async fn key_gen<C: Ciphersuite>(
KeyPair(Public(substrate_key), network_key.try_into().unwrap())
);
for processor in processors.iter_mut() {
for processor in &mut *processors {
processor.set_substrate_key(substrate_priv_key.clone()).await;
}

View File

@@ -77,7 +77,7 @@ pub async fn sign(
let known_signer_i = Participant::new(u16::from(processor_is[known_signer])).unwrap();
assert!(!preprocesses.contains_key(&known_signer_i));
let mut participants = preprocesses.keys().cloned().collect::<HashSet<_>>();
let mut participants = preprocesses.keys().copied().collect::<HashSet<_>>();
for (p, preprocess) in preprocesses {
assert_eq!(preprocess, vec![u8::try_from(u16::from(p)).unwrap(); 128]);
}

View File

@@ -13,5 +13,8 @@ publish = false
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
[lints]
workspace = true
[dependencies]
chrono = "0.4"

View File

@@ -13,6 +13,9 @@ publish = false
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
[lints]
workspace = true
[dependencies]
hex = "0.4"

View File

@@ -13,6 +13,9 @@ publish = false
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
[lints]
workspace = true
[dependencies]
hex = "0.4"

View File

@@ -13,6 +13,9 @@ publish = false
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
[lints]
workspace = true
[dependencies]
flexible-transcript = { path = "../../crypto/transcript", default-features = false, features = ["recommended", "merlin"] }

View File

@@ -13,6 +13,9 @@ publish = false
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
[lints]
workspace = true
[dependencies]
hex = "0.4"

View File

@@ -280,7 +280,7 @@ fn batch_test() {
// TODO: Double check how the processor handles this ID field
// It should be able to assert its perfectly sequential
id.attempt = attempt;
for coordinator in coordinators.iter_mut() {
for coordinator in &mut coordinators {
coordinator
.send_message(messages::coordinator::CoordinatorMessage::BatchReattempt {
id: id.clone(),

View File

@@ -246,14 +246,14 @@ fn send_test() {
// TODO: Double check how the processor handles this ID field
// It should be able to assert its perfectly sequential
id.attempt = attempt;
for coordinator in coordinators.iter_mut() {
for coordinator in &mut coordinators {
coordinator
.send_message(messages::sign::CoordinatorMessage::Reattempt { id: id.clone() })
.await;
}
(id, preprocesses) = recv_sign_preprocesses(&mut coordinators, Session(0), attempt).await;
}
let participating = preprocesses.keys().cloned().collect::<Vec<_>>();
let participating = preprocesses.keys().copied().collect::<Vec<_>>();
let tx_id = sign_tx(&mut coordinators, Session(0), id.clone(), preprocesses).await;

View File

@@ -13,6 +13,9 @@ publish = false
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
[lints]
workspace = true
[dependencies]
rand_core = "0.6"
hex = "0.4"