You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many of the tests start with basically the same code with minor variations:
let local_validator = state.local.clone().unwrap();let local_group_index = local_validator.group_index.unwrap();let other_group = next_group_index(local_group_index, validator_count, group_size);let other_para = ParaId::from(other_group.0);let test_leaf = state.make_dummy_leaf(relay_parent);let(candidate, pvd) = make_candidate(
relay_parent,1,
other_para,
test_leaf.para_data(other_para).head_data.clone(),vec![4,5,6].into(),Hash::repeat_byte(42).into(),);let candidate_hash = candidate.hash();let other_group_validators = state.group_validators(local_group_index,true);let target_group_validators = state.group_validators(other_group,true);let v_a = other_group_validators[0];let v_b = other_group_validators[1];let v_c = target_group_validators[0];let v_d = target_group_validators[1];// peer A is in group, has relay parent in view.// peer B is in group, has no relay parent in view.// peer C is not in group, has relay parent in view.// peer D is not in group, has relay parent in view.{connect_peer(&mut overseer,
peer_a.clone(),Some(vec![state.discovery_id(v_a)].into_iter().collect()),).await;connect_peer(&mut overseer,
peer_b.clone(),Some(vec![state.discovery_id(v_b)].into_iter().collect()),).await;connect_peer(&mut overseer,
peer_c.clone(),Some(vec![state.discovery_id(v_c)].into_iter().collect()),).await;connect_peer(&mut overseer,
peer_d.clone(),Some(vec![state.discovery_id(v_d)].into_iter().collect()),).await;send_peer_view_change(&mut overseer, peer_a.clone(),view![relay_parent]).await;send_peer_view_change(&mut overseer, peer_c.clone(),view![relay_parent]).await;send_peer_view_change(&mut overseer, peer_d.clone(),view![relay_parent]).await;}activate_leaf(&mut overseer,&test_leaf,&state,true).await;answer_expected_hypothetical_depth_request(&mut overseer,vec![],Some(relay_parent),false,).await;// Send gossip topology.send_new_topology(&mut overseer, state.make_dummy_topology()).await;
It would cut down a lot of verbosity to reduce this to something like:
let peers_in_view = [peer_a, peer_c, peer_d];setup_and_connect_peers(group_size,&peers_in_view, ...);
The text was updated successfully, but these errors were encountered:
Many of the tests start with basically the same code with minor variations:
It would cut down a lot of verbosity to reduce this to something like:
The text was updated successfully, but these errors were encountered: