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 10, 2024
1 parent 27e2b98 commit aabf6f9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 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::ComponentExecutionMode;
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,17 @@ 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,
ComponentExecutionMode::Remote
| ComponentExecutionMode::LocalExecutionWithRemoteEnabled
| ComponentExecutionMode::LocalExecutionWithRemoteDisabled
)
})
.map(|config| &config.http_server_config)
}

0 comments on commit aabf6f9

Please sign in to comment.