-
Notifications
You must be signed in to change notification settings - Fork 26
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
refactor(config): remove separation of required and non required config pointers #2111
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
ad21cda
to
1b8edd9
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2111 +/- ##
==========================================
- Coverage 40.10% 6.24% -33.86%
==========================================
Files 26 262 +236
Lines 1895 30559 +28664
Branches 1895 30559 +28664
==========================================
+ Hits 760 1909 +1149
- Misses 1100 28567 +27467
- Partials 35 83 +48 ☔ View full report in Codecov by Sentry. |
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 4 files reviewed, 2 unresolved discussions (waiting on @yair-starkware)
crates/starknet_sequencer_node/src/config/config_test.rs
line 122 at r1 (raw file):
let expected_required_params = deserialized.as_object_mut().unwrap(); expected_required_params.retain(|_, value| { let param = serde_json::from_value::<SerializedParam>(value.clone()).unwrap();
Is the clone needed?
Code quote:
.clone()
crates/starknet_sequencer_node/src/config/config_test.rs
line 126 at r1 (raw file):
}); let expected_required_keys = expected_required_params.keys().cloned().collect::<HashSet<String>>();
IIUC this can be achieved more elegantly using https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.filter_map.
WDYT?
Code quote:
expected_required_params.retain(|_, value| {
let param = serde_json::from_value::<SerializedParam>(value.clone()).unwrap();
param.is_required()
});
let expected_required_keys =
expected_required_params.keys().cloned().collect::<HashSet<String>>();
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 4 files reviewed, 2 unresolved discussions (waiting on @Itay-Tsabary-Starkware)
crates/starknet_sequencer_node/src/config/config_test.rs
line 122 at r1 (raw file):
Previously, Itay-Tsabary-Starkware wrote…
Is the clone needed?
Yes, value is borrowed and deserialization is consuming
crates/starknet_sequencer_node/src/config/config_test.rs
line 126 at r1 (raw file):
Previously, Itay-Tsabary-Starkware wrote…
IIUC this can be achieved more elegantly using https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.filter_map.
WDYT?
Tried, didn't go well.
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 4 files reviewed, all discussions resolved (waiting on @yair-starkware)
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.
Reviewed 4 of 4 files at r1, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @yair-starkware)
No description provided.