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

refactor(config): remove separation of required and non required config pointers #2111

Merged
merged 1 commit into from
Nov 18, 2024

Conversation

yair-starkware
Copy link
Contributor

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Contributor Author

yair-starkware commented Nov 17, 2024

@yair-starkware yair-starkware self-assigned this Nov 17, 2024
@yair-starkware yair-starkware marked this pull request as ready for review November 17, 2024 13:07
@yair-starkware yair-starkware force-pushed the yair/cosolidate_config_pointers branch from ad21cda to 1b8edd9 Compare November 17, 2024 14:07
Copy link

codecov bot commented Nov 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 6.24%. Comparing base (e3165c4) to head (1b8edd9).
Report is 452 commits behind head on main.

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.
📢 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 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>>();

Copy link
Contributor Author

@yair-starkware yair-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 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.

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.

:lgtm:

Reviewable status: 0 of 4 files reviewed, all discussions resolved (waiting on @yair-starkware)

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.

Reviewed 4 of 4 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @yair-starkware)

Copy link
Contributor Author

yair-starkware commented Nov 18, 2024

Merge activity

  • Nov 18, 4:13 AM EST: A user started a stack merge that includes this pull request via Graphite.
  • Nov 18, 4:13 AM EST: A user merged this pull request with Graphite.

@yair-starkware yair-starkware merged commit 0e8a8eb into main Nov 18, 2024
17 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Nov 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants