Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add get_http_server_config function
Browse files Browse the repository at this point in the history
commit-id:15acdf55
nadin-Starkware committed Dec 9, 2024
1 parent 9726ac0 commit bee9a2b
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
@@ -25,6 +25,7 @@ use starknet_gateway::config::{
};
use starknet_http_server::config::HttpServerConfig;
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;

@@ -227,3 +228,17 @@ pub fn create_batcher_config(
..Default::default()
}
}

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 bee9a2b

Please sign in to comment.