Skip to content

Commit

Permalink
chore: add disabled function to ComponentConfig
Browse files Browse the repository at this point in the history
commit-id:9673c1ca
  • Loading branch information
nadin-Starkware committed Dec 23, 2024
1 parent 1670f15 commit 76a13c9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
18 changes: 6 additions & 12 deletions crates/starknet_integration_tests/src/end_to_end_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,17 +114,11 @@ pub async fn end_to_end_integration(mut tx_generator: MultiAccountTransactionGen
}

pub async fn get_http_only_component_config(gateway_socket: SocketAddr) -> ComponentConfig {
ComponentConfig {
http_server: ActiveComponentExecutionConfig::default(),
gateway: ReactiveComponentExecutionConfig::remote(gateway_socket),
monitoring_endpoint: Default::default(),
batcher: ReactiveComponentExecutionConfig::disabled(),
consensus_manager: ActiveComponentExecutionConfig::disabled(),
mempool: ReactiveComponentExecutionConfig::disabled(),
mempool_p2p: ReactiveComponentExecutionConfig::disabled(),
state_sync: ReactiveComponentExecutionConfig::disabled(),
l1_provider: ReactiveComponentExecutionConfig::disabled(),
}
let mut config = ComponentConfig::disabled();
config.http_server = ActiveComponentExecutionConfig::default();
config.gateway = ReactiveComponentExecutionConfig::remote(gateway_socket);
config.monitoring_endpoint = ActiveComponentExecutionConfig::default();
config
}

async fn get_non_http_component_config(gateway_socket: SocketAddr) -> ComponentConfig {
Expand All @@ -136,7 +130,7 @@ async fn get_non_http_component_config(gateway_socket: SocketAddr) -> ComponentC
}
}

pub async fn get_remote_flow_test_config() -> Vec<ComponentConfig> {
pub async fn get_remote_test_config() -> Vec<ComponentConfig> {
let gateway_socket = get_available_socket().await;
vec![
get_http_only_component_config(gateway_socket).await,
Expand Down
16 changes: 16 additions & 0 deletions crates/starknet_sequencer_node/src/config/component_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,19 @@ impl SerializeConfig for ComponentConfig {
sub_configs.into_iter().flatten().collect()
}
}

impl ComponentConfig {
pub fn disabled() -> ComponentConfig {
ComponentConfig {
batcher: ReactiveComponentExecutionConfig::disabled(),
gateway: ReactiveComponentExecutionConfig::disabled(),
mempool: ReactiveComponentExecutionConfig::disabled(),
mempool_p2p: ReactiveComponentExecutionConfig::disabled(),
state_sync: ReactiveComponentExecutionConfig::disabled(),
l1_provider: ReactiveComponentExecutionConfig::disabled(),
consensus_manager: ActiveComponentExecutionConfig::disabled(),
http_server: ActiveComponentExecutionConfig::disabled(),
monitoring_endpoint: ActiveComponentExecutionConfig::disabled(),
}
}
}

0 comments on commit 76a13c9

Please sign in to comment.