Skip to content

Commit 72cfeb2

Browse files
committed
cargo fmt
1 parent 50b225b commit 72cfeb2

2 files changed

Lines changed: 24 additions & 14 deletions

File tree

batcher/aligned-batcher/src/lib.rs

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,32 +1052,40 @@ impl Batcher {
10521052

10531053
let batch_queue_len = batch_state_lock.batch_queue.len();
10541054

1055-
let new_entry = BatchQueueEntry::new(
1055+
let new_entry = BatchQueueEntry::new(
10561056
verification_data,
10571057
verification_data_comm,
10581058
ws_conn_sink,
10591059
proof_submitter_sig,
10601060
proof_submitter_addr,
1061-
);
1062-
let new_entry_priority = BatchQueueEntryPriority::new(max_fee, nonce) ;
1061+
);
1062+
let new_entry_priority = BatchQueueEntryPriority::new(max_fee, nonce);
10631063

1064-
if batch_queue_len + 1 > self.max_batch_proof_qty {
1065-
let (lowest_priority_entry, lowest_priority_entry_priority) =
1064+
if batch_queue_len + 1 > self.max_batch_proof_qty {
1065+
let (lowest_priority_entry, lowest_priority_entry_priority) =
10661066
get_lowest_priority_entry(&batch_state_lock.batch_queue).unwrap();
1067-
1068-
if lowest_priority_entry_priority < new_entry_priority {
1069-
if batch_state_lock.batch_queue.remove(&lowest_priority_entry).is_none(){
1067+
1068+
if lowest_priority_entry_priority < new_entry_priority {
1069+
if batch_state_lock
1070+
.batch_queue
1071+
.remove(&lowest_priority_entry)
1072+
.is_none()
1073+
{
10701074
//err
10711075
}
1072-
1076+
10731077
// todo send msg to the removed entry ws
10741078

1075-
batch_state_lock.batch_queue.push(new_entry, new_entry_priority);
1079+
batch_state_lock
1080+
.batch_queue
1081+
.push(new_entry, new_entry_priority);
10761082
} else {
10771083
// can't accept the new proof
10781084
}
10791085
} else {
1080-
batch_state_lock.batch_queue.push(new_entry, new_entry_priority );
1086+
batch_state_lock
1087+
.batch_queue
1088+
.push(new_entry, new_entry_priority);
10811089
}
10821090

10831091
// Update metrics

batcher/aligned-batcher/src/types/batch_queue.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,9 @@ fn calculate_fee_per_proof(batch_len: usize, gas_price: U256, constant_gas_cost:
212212
U256::from(gas_per_proof) * gas_price
213213
}
214214

215-
pub(crate) fn get_lowest_priority_entry(batch_queue: &BatchQueue) -> Option<(BatchQueueEntry, BatchQueueEntryPriority)> {
215+
pub(crate) fn get_lowest_priority_entry(
216+
batch_queue: &BatchQueue,
217+
) -> Option<(BatchQueueEntry, BatchQueueEntryPriority)> {
216218
let mut lowest_fee_entry: Option<(BatchQueueEntry, BatchQueueEntryPriority)> = None;
217219

218220
for (entry, priority) in batch_queue {
@@ -224,10 +226,10 @@ pub(crate) fn get_lowest_priority_entry(batch_queue: &BatchQueue) -> Option<(Bat
224226
}
225227
None => {
226228
lowest_fee_entry = Some((entry.clone(), priority.clone()));
227-
}
229+
}
228230
}
229231
}
230-
232+
231233
lowest_fee_entry
232234
}
233235

0 commit comments

Comments
 (0)