Skip to content

Missing ValidationError when calling bytes argument with string value #1412

@palango

Description

@palango
  • Version: 5.0.0
  • Python: 3.7
  • OS: linux/travis
  • pip freeze output

See 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:

        with pytest.raises(ValidationError):
           secret_registry_contract.functions.registerSecret("")
           Failed: DID NOT RAISE <class 'web3.exceptions.ValidationError'>

How can it be fixed?

This should either raise a ValidationError or it should be documented that strings can now be passed to bytes parameters.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions