-
Notifications
You must be signed in to change notification settings - Fork 167
feat(framework): disallow assign of fixedbytes of size X to bytes of size Y when X != Y #1010
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
Conversation
07aee0a
to
301dd8b
Compare
Wanted to see why tox was failing and it turns out we have this pattern in some of the tests where we convert an execution-spec-tests/tests/shanghai/eip4895_withdrawals/test_withdrawals.py Lines 208 to 213 in fff098b
We need to decide how to proceed with this pattern because I find it useful to convert between the two types in a test. One possibility is to simply disallow going from bigger sizes to lower sizes, and disallow a size of zero in the bytes. Another option is to have a special case coded in |
0014c5e
to
63b2744
Compare
Pushed a solution, why not to be explicit about what you want to achieve:
|
d922054
to
993d311
Compare
…tes constructor parameter
Refactor `left_pad_zeros_up_to_size` to a parameter in the `FixedSizeBytes` constructor
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.
LGTM, thanks!
…size Y when X != Y (ethereum#1010) * unit tests * fix after rebase * fix(types): Transaction `to` validation fix * refactor(base_types): replace left_pad_zeros_up_to_size with fixed bytes constructor parameter --------- Co-authored-by: Mario Vega <[email protected]>
🗒️ Description
fields of type fixedbytesizeN should not be assignable to bytes of size other than N
uvx --with=tox-uv tox
🔗 Related Issues
#1008
✅ Checklist
mkdocs serve
locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.