Skip to content

Commit

Permalink
chore: Appease Clippy-sama
Browse files Browse the repository at this point in the history
  • Loading branch information
netrome committed Jan 14, 2025
1 parent b8ba0c6 commit 2a0b97c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions crates/services/txpool_v2/src/tests/universe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ impl TestPoolUniverse {

pub fn latest_stats(&self) -> TxPoolStats {
if let Some(receiver) = &self.stats_receiver {
receiver.borrow().clone()
*receiver.borrow()
} else {
TxPoolStats::default()
}
Expand Down Expand Up @@ -320,11 +320,13 @@ impl TestPoolUniverse {
pub fn assert_pool_integrity(&self, expected_txs: &[ArcPoolTx]) {
let stats = self.latest_stats();
assert_eq!(stats.tx_count, expected_txs.len() as u64);
let mut total_gas = 0;
let mut total_size = 0;
let mut total_gas: u64 = 0;
let mut total_size: u64 = 0;
for tx in expected_txs {
total_gas += tx.max_gas();
total_size += tx.metered_bytes_size() as u64;
total_gas = total_gas.checked_add(tx.max_gas()).unwrap();
total_size = total_gas
.checked_add(tx.metered_bytes_size() as u64)
.unwrap();
}
assert_eq!(stats.total_gas, total_gas);
assert_eq!(stats.total_size, total_size);
Expand Down

0 comments on commit 2a0b97c

Please sign in to comment.