Skip to content

fix(skeleton): add missing NodeIndex::new ctor calls #165

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

Merged
merged 1 commit into from
May 30, 2024

Conversation

TzahiTaub
Copy link
Contributor

@TzahiTaub TzahiTaub commented May 29, 2024

This change is Reviewable

@TzahiTaub TzahiTaub self-assigned this May 29, 2024
@codecov-commenter
Copy link

codecov-commenter commented May 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.29%. Comparing base (524f1af) to head (af43d6e).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #165   +/-   ##
=======================================
  Coverage   60.29%   60.29%           
=======================================
  Files          34       34           
  Lines        1511     1511           
  Branches     1511     1511           
=======================================
  Hits          911      911           
  Misses        559      559           
  Partials       41       41           

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

@TzahiTaub TzahiTaub force-pushed the tzahi/skeleton/add_missing_NodeIndex_new_ctor_calls branch from 58e596f to 93d4d41 Compare May 29, 2024 19:49
Copy link
Collaborator

@dorimedini-starkware dorimedini-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 1 of 2 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @TzahiTaub)


crates/committer/src/patricia_merkle_tree/types.rs line 113 at r2 (raw file):

        let post_common_prefix_len = NodeIndex::new(xor).bit_length();
        let lca = adapted_self.0 >> post_common_prefix_len;
        NodeIndex::new(lca)

please make the U256 in NodeIndex a private field so the compiler catches these constructions without new.
if you need access to the inner U256 add a getter

Code quote:

NodeIndex::new(lca)

@TzahiTaub TzahiTaub force-pushed the tzahi/skeleton/add_missing_NodeIndex_new_ctor_calls branch from 93d4d41 to af43d6e Compare May 30, 2024 09:50
Copy link
Contributor Author

@TzahiTaub TzahiTaub 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: all files reviewed, 1 unresolved discussion (waiting on @dorimedini-starkware)


crates/committer/src/patricia_merkle_tree/types.rs line 113 at r2 (raw file):

Previously, dorimedini-starkware wrote…

please make the U256 in NodeIndex a private field so the compiler catches these constructions without new.
if you need access to the inner U256 add a getter

Done.

Copy link
Collaborator

@dorimedini-starkware dorimedini-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:

Reviewed 2 of 2 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @TzahiTaub)

@TzahiTaub TzahiTaub added this pull request to the merge queue May 30, 2024
Merged via the queue into main with commit 137f9ee May 30, 2024
11 checks passed
@TzahiTaub TzahiTaub deleted the tzahi/skeleton/add_missing_NodeIndex_new_ctor_calls branch May 30, 2024 11:07
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