Skip to content

Commit

Permalink
Update how to create beacon processor channels according to the lates…
Browse files Browse the repository at this point in the history
…t update
  • Loading branch information
ackintosh committed Aug 28, 2023
1 parent 2e26f77 commit 75ac306
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions beacon_node/network/src/service/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,17 @@ mod tests {
use crate::persisted_dht::load_dht;
use crate::{NetworkConfig, NetworkService};
use beacon_chain::test_utils::BeaconChainHarness;
use beacon_processor::{
BeaconProcessorChannels, BeaconProcessorSend, MAX_SCHEDULED_WORK_QUEUE_LEN,
MAX_WORK_EVENT_QUEUE_LEN,
};
use beacon_processor::{BeaconProcessorChannels, BeaconProcessorConfig};
use futures::StreamExt;
use lighthouse_network::types::{GossipEncoding, GossipKind};
use lighthouse_network::{Enr, GossipTopic};
use slog::{o, Drain, Level, Logger};
use sloggers::{null::NullLoggerBuilder, Build};
use std::str::FromStr;
use std::sync::Arc;
use tokio::{runtime::Runtime, sync::mpsc};
use tokio::runtime::Runtime;
use types::{Epoch, EthSpec, ForkName, MinimalEthSpec, SubnetId};


fn get_logger(actual_log: bool) -> Logger {
if actual_log {
let drain = {
Expand Down Expand Up @@ -147,18 +143,15 @@ mod tests {
config.discv5_config.table_filter = |_| true; // Do not ignore local IPs
config.upnp_enabled = false;

let (beacon_processor_send, _beacon_processor_receive) =
mpsc::channel(MAX_WORK_EVENT_QUEUE_LEN);
let (beacon_processor_reprocess_tx, _beacon_processor_reprocess_rx) =
mpsc::channel(MAX_SCHEDULED_WORK_QUEUE_LEN);

let beacon_processor_channels =
BeaconProcessorChannels::new(&BeaconProcessorConfig::default());
NetworkService::build(
beacon_chain.clone(),
&config,
executor.clone(),
None,
BeaconProcessorSend(beacon_processor_send),
beacon_processor_reprocess_tx,
beacon_processor_channels.beacon_processor_tx,
beacon_processor_channels.work_reprocessing_tx,
)
.await
.unwrap()
Expand Down

0 comments on commit 75ac306

Please sign in to comment.