brownie
brownie copied to clipboard
Errors with Vyper tests
Environment information
-
brownie
Version: 1.19.2 -
ganache-cli
Version: 0.8.1 - Python Version: 3.10.6
- OS: Kubuntu 22.04.1 LTS
What was wrong?
I execute
brownie bake vyper-token
and then
brownie test
and several tests fail. The error messages are
============================== short test summary info =====================================
FAILED tests/test_approve.py::test_returns_true - TypeError: int() can't convert non-string with explicit base
FAILED tests/test_transfer.py::test_returns_true - TypeError: int() can't convert non-string with explicit base
FAILED tests/test_transfer.py::test_insufficient_balance - TypeError: int() can't convert non-string with exp...
FAILED tests/test_transferFrom.py::test_returns_true - TypeError: int() can't convert non-string with explici...
FAILED tests/test_transferFrom.py::test_insufficient_balance - TypeError: int() can't convert non-string with...
FAILED tests/test_transferFrom.py::test_insufficient_approval - TypeError: int() can't convert non-string wit...
FAILED tests/test_transferFrom.py::test_no_approval - TypeError: int() can't convert non-string with explicit...
FAILED tests/test_transferFrom.py::test_revoked_approval - TypeError: int() can't convert non-string with exp...
FAILED tests/test_transferFrom.py::test_transfer_to_self_no_approval - TypeError: int() can't convert non-str...
How can it be fixed?
I finally could fix the issue editing the file
.local/pipx/venvs/eth-brownie/lib/python3.10/site-packages/brownie/network/transaction.py
replacing the line
step["pc"] = int(step["pc"], 16)
with
step["pc"] = int(str(step["pc"]), 16)
.