use of tech.pegasys.teku.network.p2p.peer.SimplePeerSelectionStrategy in project teku by ConsenSys.
the class DiscoveryNetworkTest method shouldNotEnableDiscoveryWhenDiscoveryIsDisabled.
@Test
public void shouldNotEnableDiscoveryWhenDiscoveryIsDisabled() {
final DiscoveryConfig discoveryConfig = DiscoveryConfig.builder().isDiscoveryEnabled(false).build();
final NetworkConfig networkConfig = NetworkConfig.builder().build();
final PeerSelectionStrategy peerSelectionStrategy = new SimplePeerSelectionStrategy(new TargetPeerRange(20, 30, 0));
final DiscoveryNetwork<?> network = DiscoveryNetworkBuilder.create().metricsSystem(new NoOpMetricsSystem()).asyncRunner(DelayedExecutorAsyncRunner.create()).kvStore(new MemKeyValueStore<>()).p2pNetwork(p2pNetwork).peerSelectionStrategy(peerSelectionStrategy).discoveryConfig(discoveryConfig).p2pConfig(networkConfig).spec(spec).currentSchemaDefinitionsSupplier(spec::getGenesisSchemaDefinitions).build();
assertThat(network.getEnr()).isEmpty();
}
Aggregations