Skip to content

Commit

Permalink
chore: add get_http_server_config function
Browse files Browse the repository at this point in the history
commit-id:927ec671
  • Loading branch information
nadin-Starkware committed Dec 11, 2024
1 parent 30e4861 commit d863102
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions crates/starknet_integration_tests/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ use starknet_http_server::config::HttpServerConfig;
use starknet_mempool_p2p::config::MempoolP2pConfig;
use starknet_monitoring_endpoint::config::MonitoringEndpointConfig;
use starknet_sequencer_infra::test_utils::get_available_socket;
use starknet_sequencer_node::config::component_execution_config::ActiveComponentExecutionMode;
use starknet_sequencer_node::config::node_config::SequencerNodeConfig;
use starknet_sequencer_node::config::test_utils::RequiredParams;
use starknet_types_core::felt::Felt;
Expand Down Expand Up @@ -277,3 +278,15 @@ fn create_monitoring_endpoint_config(sequencer_index: usize) -> MonitoringEndpoi
config.port += u16::try_from(sequencer_index).unwrap();
config
}

pub fn get_http_server_config(configs: &[SequencerNodeConfig]) -> Option<&HttpServerConfig> {
configs
.iter()
.find(|config| {
matches!(
config.components.http_server.execution_mode,
ActiveComponentExecutionMode::Enabled
)
})
.map(|config| &config.http_server_config)
}

0 comments on commit d863102

Please sign in to comment.