Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add get_http_server_config function #2637

Open
wants to merge 1 commit into
base: spr/main/5edf2768
Choose a base branch
from

Conversation

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link

codecov bot commented Dec 11, 2024

Codecov Report

Attention: Patch coverage is 0% with 9 lines in your changes missing coverage. Please review.

Please upload report for BASE (spr/main/5edf2768@30e4861). Learn more about missing BASE report.

Files with missing lines Patch % Lines
crates/starknet_integration_tests/src/utils.rs 0.00% 9 Missing ⚠️
Additional details and impacted files
@@                 Coverage Diff                  @@
##             spr/main/5edf2768    #2637   +/-   ##
====================================================
  Coverage                     ?   34.99%           
====================================================
  Files                        ?      277           
  Lines                        ?    32236           
  Branches                     ?    32236           
====================================================
  Hits                         ?    11281           
  Misses                       ?    19948           
  Partials                     ?     1007           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @nadin-Starkware)


crates/starknet_integration_tests/src/utils.rs line 292 at r1 (raw file):

        })
        .map(|config| &config.http_server_config)
}

I fear this path is not scalable. When handling different configs there must be a better way than to search one that meets a predicate. What will happen when we'd have a 3rd config? Or 10 configs?
Could we prehaps define a mapping instead of a vector? And maybe let the key be the functionality required?

Code quote:

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)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants