mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-14 18:32:42 +00:00
Fix Rust beta compiler errors (1.77) (#5180)
* Lint fixes * More fixes for beta compiler. * Format fixes * Move `#[allow(dead_code)]` to field level. * Remove old comment. * Update beacon_node/execution_layer/src/test_utils/mod.rs Co-authored-by: João Oliveira <hello@jxs.pt> * remove duplicate line
This commit is contained in:
@@ -174,7 +174,7 @@ fn inject_nodes1() -> InjectNodes<IdentityTransform, AllowAllSubscriptionFilter>
|
||||
|
||||
fn add_peer<D, F>(
|
||||
gs: &mut Behaviour<D, F>,
|
||||
topic_hashes: &Vec<TopicHash>,
|
||||
topic_hashes: &[TopicHash],
|
||||
outbound: bool,
|
||||
explicit: bool,
|
||||
) -> (PeerId, RpcReceiver)
|
||||
@@ -187,7 +187,7 @@ where
|
||||
|
||||
fn add_peer_with_addr<D, F>(
|
||||
gs: &mut Behaviour<D, F>,
|
||||
topic_hashes: &Vec<TopicHash>,
|
||||
topic_hashes: &[TopicHash],
|
||||
outbound: bool,
|
||||
explicit: bool,
|
||||
address: Multiaddr,
|
||||
@@ -208,7 +208,7 @@ where
|
||||
|
||||
fn add_peer_with_addr_and_kind<D, F>(
|
||||
gs: &mut Behaviour<D, F>,
|
||||
topic_hashes: &Vec<TopicHash>,
|
||||
topic_hashes: &[TopicHash],
|
||||
outbound: bool,
|
||||
explicit: bool,
|
||||
address: Multiaddr,
|
||||
@@ -3218,7 +3218,7 @@ fn test_scoring_p1() {
|
||||
);
|
||||
}
|
||||
|
||||
fn random_message(seq: &mut u64, topics: &Vec<TopicHash>) -> RawMessage {
|
||||
fn random_message(seq: &mut u64, topics: &[TopicHash]) -> RawMessage {
|
||||
let mut rng = rand::thread_rng();
|
||||
*seq += 1;
|
||||
RawMessage {
|
||||
@@ -4080,20 +4080,20 @@ fn test_scoring_p6() {
|
||||
//create 5 peers with the same ip
|
||||
let addr = Multiaddr::from(Ipv4Addr::new(10, 1, 2, 3));
|
||||
let peers = vec![
|
||||
add_peer_with_addr(&mut gs, &vec![], false, false, addr.clone()).0,
|
||||
add_peer_with_addr(&mut gs, &vec![], false, false, addr.clone()).0,
|
||||
add_peer_with_addr(&mut gs, &vec![], true, false, addr.clone()).0,
|
||||
add_peer_with_addr(&mut gs, &vec![], true, false, addr.clone()).0,
|
||||
add_peer_with_addr(&mut gs, &vec![], true, true, addr.clone()).0,
|
||||
add_peer_with_addr(&mut gs, &[], false, false, addr.clone()).0,
|
||||
add_peer_with_addr(&mut gs, &[], false, false, addr.clone()).0,
|
||||
add_peer_with_addr(&mut gs, &[], true, false, addr.clone()).0,
|
||||
add_peer_with_addr(&mut gs, &[], true, false, addr.clone()).0,
|
||||
add_peer_with_addr(&mut gs, &[], true, true, addr.clone()).0,
|
||||
];
|
||||
|
||||
//create 4 other peers with other ip
|
||||
let addr2 = Multiaddr::from(Ipv4Addr::new(10, 1, 2, 4));
|
||||
let others = vec![
|
||||
add_peer_with_addr(&mut gs, &vec![], false, false, addr2.clone()).0,
|
||||
add_peer_with_addr(&mut gs, &vec![], false, false, addr2.clone()).0,
|
||||
add_peer_with_addr(&mut gs, &vec![], true, false, addr2.clone()).0,
|
||||
add_peer_with_addr(&mut gs, &vec![], true, false, addr2.clone()).0,
|
||||
add_peer_with_addr(&mut gs, &[], false, false, addr2.clone()).0,
|
||||
add_peer_with_addr(&mut gs, &[], false, false, addr2.clone()).0,
|
||||
add_peer_with_addr(&mut gs, &[], true, false, addr2.clone()).0,
|
||||
add_peer_with_addr(&mut gs, &[], true, false, addr2.clone()).0,
|
||||
];
|
||||
|
||||
//no penalties yet
|
||||
|
||||
Reference in New Issue
Block a user