Skip to content

Commit 0e20cbc

Browse files
committed
cargo fmt
1 parent 070425c commit 0e20cbc

3 files changed

Lines changed: 14 additions & 30 deletions

File tree

crates/batcher/src/lib.rs

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -558,9 +558,7 @@ impl Batcher {
558558
// Process each event
559559
for event in events {
560560
let user_address = event.user;
561-
debug!(
562-
"Processing BalanceUnlocked event for user: {user_address:?}"
563-
);
561+
debug!("Processing BalanceUnlocked event for user: {user_address:?}");
564562

565563
// Check if user has proofs in queue
566564
//
@@ -1781,9 +1779,7 @@ impl Batcher {
17811779
let last_uploaded_batch_block_lock = self.last_uploaded_batch_block.lock().await;
17821780

17831781
if current_batch_len < 1 {
1784-
info!(
1785-
"Current batch has {current_batch_len} proofs. Waiting for more proofs..."
1786-
);
1782+
info!("Current batch has {current_batch_len} proofs. Waiting for more proofs...");
17871783
return None;
17881784
}
17891785

@@ -1833,9 +1829,7 @@ impl Batcher {
18331829
.ok()?;
18341830

18351831
let extracted = finalized_batch.len();
1836-
info!(
1837-
"Extracted {extracted} proofs from queue for batch processing"
1838-
);
1832+
info!("Extracted {extracted} proofs from queue for batch processing");
18391833

18401834
// Update queue metrics after successful batch extraction
18411835
let queue_len = batch_state_lock.batch_queue.len();
@@ -1845,9 +1839,7 @@ impl Batcher {
18451839
.update_queue_metrics(queue_len as i64, queue_size_bytes as i64);
18461840
}
18471841
Err(e) => {
1848-
error!(
1849-
"Failed to calculate batch size for queue metrics update: {e:?}"
1850-
);
1842+
error!("Failed to calculate batch size for queue metrics update: {e:?}");
18511843
// Still update queue length metric, set size to 0 due to calculation error
18521844
self.metrics.update_queue_metrics(queue_len as i64, 0);
18531845
}
@@ -2025,9 +2017,7 @@ impl Batcher {
20252017
.update_user_states_from_queue_state(users_with_restored_proofs)
20262018
.await
20272019
{
2028-
error!(
2029-
"Failed to update user states after proof restoration: {e:?}"
2030-
);
2020+
error!("Failed to update user states after proof restoration: {e:?}");
20312021
}
20322022
}
20332023

@@ -2159,9 +2149,7 @@ impl Batcher {
21592149
.update_user_states_from_queue_state(users_in_batch)
21602150
.await
21612151
{
2162-
error!(
2163-
"Failed to update user states after batch confirmation: {e:?}"
2164-
);
2152+
error!("Failed to update user states after batch confirmation: {e:?}");
21652153
// Continue with the rest of the process since batch was already submitted successfully
21662154
}
21672155

@@ -2669,8 +2657,7 @@ impl Batcher {
26692657
.await
26702658
.is_ok()
26712659
{
2672-
let secondary_url =
2673-
format!("{download_endpoint_secondary}/{file_name}");
2660+
let secondary_url = format!("{download_endpoint_secondary}/{file_name}");
26742661
successful_urls.push(secondary_url.clone());
26752662
info!("Successfully uploaded batch to secondary S3: {secondary_url}");
26762663
} else {

crates/sdk/src/common/errors.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,10 @@ impl fmt::Display for SubmitError {
186186
SubmitError::InvalidNonce => write!(f, "Invalid nonce"),
187187
SubmitError::InvalidMaxFee => write!(f, "Invalid max fee"),
188188
SubmitError::BatchSubmissionFailed(merkle_root) => {
189-
write!(f, "Could not create task with batch merkle root {merkle_root}")
189+
write!(
190+
f,
191+
"Could not create task with batch merkle root {merkle_root}"
192+
)
190193
}
191194
SubmitError::GenericError(e) => write!(f, "Generic error: {e}"),
192195
SubmitError::InvalidSignature => write!(f, "Invalid Signature"),

crates/sdk/src/communication/messaging.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,7 @@ pub async fn receive(
135135
) {
136136
Ok(data) => data,
137137
Err(e) => {
138-
warn!(
139-
"Error while matching batcher response with sent data: {e:?}"
140-
);
138+
warn!("Error while matching batcher response with sent data: {e:?}");
141139
aligned_submitted_data.push(Err(e));
142140
break;
143141
}
@@ -227,9 +225,7 @@ async fn handle_batcher_response(msg: Message) -> Result<BatchInclusionData, Sub
227225
))
228226
}
229227
Ok(SubmitProofResponseMessage::InvalidProof(reason)) => {
230-
error!(
231-
"Batcher responded with invalid proof: {reason}. Funds have not been spent."
232-
);
228+
error!("Batcher responded with invalid proof: {reason}. Funds have not been spent.");
233229
Err(SubmitError::InvalidProof(reason))
234230
}
235231
Ok(SubmitProofResponseMessage::CreateNewTaskError(merkle_root, error)) => {
@@ -255,9 +251,7 @@ async fn handle_batcher_response(msg: Message) -> Result<BatchInclusionData, Sub
255251
Err(SubmitError::ProofQueueFlushed)
256252
}
257253
Ok(SubmitProofResponseMessage::Error(e)) => {
258-
error!(
259-
"Batcher responded with error: {e}. Funds have not been spent."
260-
);
254+
error!("Batcher responded with error: {e}. Funds have not been spent.");
261255
Err(SubmitError::GenericError(e))
262256
}
263257
Ok(SubmitProofResponseMessage::UnderpricedProof) => {

0 commit comments

Comments
 (0)