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

Poplar1: Move prefix order check to is_valid() #513

Merged
merged 2 commits into from
Oct 18, 2024

Conversation

divergentdave
Copy link
Collaborator

Closes #494.

Comment on lines 223 to 227
# Test `is_valid` rejects unsorted prefixes.
agg_params = [
(0, (int_to_bit_string(0b1, 1), int_to_bit_string(0b0, 1))),
]
self.assertFalse(cls.is_valid(agg_params[0], list(agg_params)))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Somewhat random thought here: A quirk in Python's implementation of >= on tuples might mean these are not actually in lexicographic order. It might be worth expanding this to longer vectors, in particular checking that ordering starts with the front of the tuple rather than the end.

Copy link
Collaborator

@cjpatton cjpatton left a comment

Choose a reason for hiding this comment

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

Whoops, meant to approve, not comment.

@divergentdave divergentdave merged commit 0b30b0c into main Oct 18, 2024
6 checks passed
@divergentdave divergentdave deleted the david/poplar1-prefix-checks-is-valid branch October 18, 2024 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Poplar1: Move enforcement of prefix uniqueness and order to is_valid()
2 participants