-
-
Notifications
You must be signed in to change notification settings - Fork 804
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
fix[ux]: fix validation for abi_encode()
method_id
kwarg
#4369
fix[ux]: fix validation for abi_encode()
method_id
kwarg
#4369
Conversation
code like in the test case (`abi_encode(..., method_id=b"123")`) will panic due to the assertion in `_parse_method_id()`, since the original typecheck only checked that the method_id is <=4 bytes. this adds a rule to validate that bytestring method ids are exactly 4 bytes directly in `abi_encode()`'s typecheck routine.
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.
While I was reviewing the PR, I thought of the case where method_id
should be None
and why x""
or b""
is disallowed. Opinions?
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.
Having a test for the empty case x""
is always something sane to do IMO.
lgtm, let's just please merge https://github.com/charles-cooper/vyper/pull/51/files |
…thod-id add method_id tests
abi_encode()
method_id
kwarg
code like in the test case (
abi_encode(..., method_id=b"123")
) will panic due to the assertion in_parse_method_id()
, since the original typecheck only checked that the method_id is <=4 bytes. this adds a rule to validate that bytestring method ids are exactly 4 bytes directly inabi_encode()
's typecheck routine.What I did
fix #4354
How I did it
How to verify it
Commit message
Commit message for the final, squashed PR. (Optional, but reviewers will appreciate it! Please see our commit message style guide for what we would ideally like to see in a commit message.)
Description for the changelog
Cute Animal Picture