-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Missing ValidationError when calling bytes argument with string value #1412
Comments
It looks like the offending code is here: Lines 149 to 157 in b899050
If the value is text and can be decoded as hex it gets accepted. My initial thought is that we should only accept `"0x" prefixed hex values. This is complicated since we can't exactly make that change since it would be backwards incompatible. We might be able to be more strict about just the empty string and require that |
Nope, this is a straight-up bug. Only a 64-character hex-string should be accepted, since the ABI specifies (the strikethrough text still applies for unbound |
Thanks @carver! @pipermerriam and I also talked about having a flag (similar to the |
Yeah, that seems fine to me. But even without the flag, the |
pip freeze
outputSee https://travis-ci.org/palango/raiden-contracts/builds/568742398#L398
What was wrong?
I updated the web3.py, eth-tester and further dependencies in a PR of the raiden contracts: raiden-network/raiden-contracts#1153
So far everything looks good, but I get on test failure that looks like a regression to me: https://travis-ci.org/palango/raiden-contracts/builds/568742398#L494
In that test we check that the web3 contract instance throws a
ValidationError
when the contract is called with an invalid value.The function in question is here:
https://github.com/raiden-network/raiden-contracts/blob/master/raiden_contracts/data/source/raiden/SecretRegistry.sol#L17
The test code is:
How can it be fixed?
This should either raise a
ValidationError
or it should be documented thatstrings
can now be passed tobytes
parameters.The text was updated successfully, but these errors were encountered: