uses std::net::IpAddr type for Packet.Meta.addr

This commit is contained in:
behzad nouri
2022-01-02 11:13:57 -05:00
parent aa9f7ed7e8
commit 73a7741c49
4 changed files with 27 additions and 42 deletions

View File

@ -37,7 +37,7 @@ fn bench_packet_discard(bencher: &mut Bencher) {
.map(|_| {
let mut addr = [0u16; 8];
thread_rng().fill(&mut addr);
addr
std::net::IpAddr::from(addr)
})
.collect();

View File

@ -286,7 +286,7 @@ mod tests {
solana_logger::setup();
let mut batch = PacketBatch::default();
batch.packets.resize(10, Packet::default());
batch.packets[3].meta.addr = [1u16; 8];
batch.packets[3].meta.addr = std::net::IpAddr::from([1u16; 8]);
let mut batches = vec![batch];
let max = 3;
SigVerifyStage::discard_excess_packets(&mut batches, max);