Skip to content

Commit

Permalink
update review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
nkysg committed Oct 21, 2024
1 parent a2f946d commit 1638722
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions crates/net/discv4/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2324,9 +2324,9 @@ mod tests {
let original = EnrForkIdEntry {
fork_id: ForkId { hash: ForkHash([0xdc, 0xe9, 0x6c, 0x2d]), next: 0 },
};
let mut encoded = Vec::with_capacity(8);
original.encode(&mut encoded);
let expected: [u8; 8] = [0xc7, 0xc6, 0x84, 0xdc, 0xe9, 0x6c, 0x2d, 0x80];
let mut encoded = Vec::with_capacity(expected.len());
original.encode(&mut encoded);
assert_eq!(&expected[..], encoded.as_slice());
}

Expand Down
5 changes: 3 additions & 2 deletions crates/rpc/rpc/src/eth/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,9 @@ mod tests {
last_header = Some(header.clone());
parent_hash = hash;

let mut transactions = Vec::with_capacity(100);
for _ in 0..100 {
let transactions_len: usize = 100;
let mut transactions = Vec::with_capacity(transactions_len);
for _ in 0..transactions_len {
let random_fee: u128 = rng.gen();

if let Some(base_fee_per_gas) = header.base_fee_per_gas {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1370,7 +1370,7 @@ impl TransactionsProviderExt for StaticFileProvider {
.clone()
.step_by(chunk_size)
.map(|start| start..std::cmp::min(start + chunk_size as u64, tx_range.end));
let mut channels = Vec::with_capacity(chunks.clone().count());
let mut channels = Vec::with_capacity(tx_range_size.div_ceil(chunk_size));

for chunk_range in chunks {
let (channel_tx, channel_rx) = mpsc::channel();
Expand Down

0 comments on commit 1638722

Please sign in to comment.