-
Notifications
You must be signed in to change notification settings - Fork 24
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
base: spr/main/5edf2768
Are you sure you want to change the base?
Conversation
0d52ab7
to
aabf6f9
Compare
ebe6b0c
to
27e2b98
Compare
aabf6f9
to
4778f2c
Compare
4778f2c
to
147879b
Compare
311c9e4
to
4896f67
Compare
Codecov ReportAttention: Patch coverage is
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. |
commit-id:927ec671
147879b
to
d863102
Compare
There was a problem hiding this 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)
}
Stack: