Vyper: Vypercoin testing fails

Created on 1 Jun 2018  路  7Comments  路  Source: vyperlang/vyper

What's your issue about?

Hi. I'm testing the vypercoin contract code, but it fails with the following message:

`evm.exceptions.ValidationError: Invalid transaction nonce

env/lib/python3.6/site-packages/py_evm-0.2.0a22-py3.6.egg/evm/vm/forks/frontier/validation.py:21: ValidationError`

I think it's due to the new testing framework #815.

Cute Animal Picture

tuna-funny-dog-tunameltsmyheart-4

bug

Most helpful comment

Hmmm I think this could have to do with py-evm==0.2.0a26, @mattermat if you try pip install py-evm==0.2.0a16.

Does it go away?

All 7 comments

that's weird. @pipermerriam?

That indicates that the nonce being sent with the transaction isn't the correct nonce for the account. Need more info on the actual failing test and code that causes the failure to help further.

@mattermat is this behavior consistent?

If it is inconsistent, it could point to some async behaviors... athough web3.py and eth-tester should not have any async behavior by design, but perhaps our conftest does?

Please comment on reproducability.

The behavior is consistent. After a fresh vyper installation, i've installed pytest and eth_tester. The pip freeze output is the following:
aiohttp==2.3.10 asn1crypto==0.24.0 async-lru==0.1.0 async-timeout==3.0.0 atomicwrites==1.1.5 attrdict==2.0.0 attrs==18.1.0 backcall==0.1.0 certifi==2018.4.16 cffi==1.11.5 chardet==3.0.4 coincurve==7.1.0 cryptography==2.2.2 cytoolz==0.9.0.1 decorator==4.3.0 eth-abi==1.1.1 eth-account==0.2.3 eth-bloom==1.0.0 eth-hash==0.1.4 eth-keyfile==0.5.1 eth-keys==0.2.0b3 eth-rlp==0.1.2 eth-tester==0.1.0b26 eth-utils==1.0.3 hexbytes==0.1.0 idna==2.6 idna-ssl==1.0.1 ipython==6.4.0 ipython-genutils==0.2.0 jedi==0.12.0 lru-dict==1.1.6 lxml==4.2.1 more-itertools==4.2.0 multidict==4.3.1 netdisco==1.4.1 netifaces==0.10.7 parsimonious==0.8.0 parso==0.2.1 pexpect==4.6.0 pickleshare==0.7.4 pluggy==0.6.0 plyvel==1.0.4 prompt-toolkit==1.0.15 ptyprocess==0.5.2 py==1.5.3 py-ecc==1.4.2 py-evm==0.2.0a26 pycparser==2.18 pycryptodome==3.6.1 pyethash==0.1.27 Pygments==2.2.0 pysha3==1.0.2 pytest==3.6.0 python-dateutil==2.7.3 requests==2.18.4 rlp==1.0.1 semantic-version==2.6.0 simplegeneric==0.8.1 six==1.11.0 toolz==0.9.0 traitlets==4.3.2 trie==1.3.7 uPnPClient==0.0.8 urllib3==1.22 vyper==0.0.4 wcwidth==0.1.7 web3==4.2.1 websockets==5.0.1 yarl==1.2.4 zeroconf==0.20.0

Than, I've test the vypercoin code and the related test, obtaining the result in this gist.
The behavior is consistent (both on linux and on osx)
I'm doing something wrong?

I don't really see anything that jumps out at me as wrong. Might be an eth-tester issue.

Hmmm I think this could have to do with py-evm==0.2.0a26, @mattermat if you try pip install py-evm==0.2.0a16.

Does it go away?

Hmmmm probably it's due to an eth-tester problem, because after installing py-evm==0.2.0a16 I get this output:

Traceback (most recent call last):
  File "/home/mattia/Progetti/drvtv/env/lib/python3.6/site-packages/_pytest/config.py", line 339, in _getconftestmodules
    return self._path2confmods[path]                                                                                      
KeyError: local('/home/mattia/Progetti/drvtv/tests')

During handling of the above exception, another exception occurred:                                                       
Traceback (most recent call last):
  File "/home/mattia/Progetti/drvtv/env/lib/python3.6/site-packages/_pytest/config.py", line 370, in _importconftest
    return self._conftestpath2mod[conftestpath]                                                                           
KeyError: local('/home/mattia/Progetti/drvtv/tests/conftest.py')

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/mattia/Progetti/drvtv/env/lib/python3.6/site-packages/_pytest/config.py", line 376, in _importconftest
    mod = conftestpath.pyimport()
  File "/home/mattia/Progetti/drvtv/env/lib/python3.6/site-packages/py/_path/local.py", line 668, in pyimport
    __import__(modname)
  File "/home/mattia/Progetti/drvtv/env/lib/python3.6/site-packages/_pytest/assertion/rewrite.py", line 215, in load_module
    py.builtin.exec_(co, mod.__dict__)
  File "/home/mattia/Progetti/drvtv/tests/conftest.py", line 1, in <module>
    import eth_tester
  File "/home/mattia/Progetti/drvtv/env/lib/python3.6/site-packages/eth_tester/__init__.py", line 4, in <module>
    from .main import (  # noqa: F401
  File "/home/mattia/Progetti/drvtv/env/lib/python3.6/site-packages/eth_tester/main.py", line 29, in <module>
    from eth_tester.backends import (
  File "/home/mattia/Progetti/drvtv/env/lib/python3.6/site-packages/eth_tester/backends/__init__.py", line 22, in <module>
    from .pyevm import (  # noqa: F401
  File "/home/mattia/Progetti/drvtv/env/lib/python3.6/site-packages/eth_tester/backends/pyevm/__init__.py", line 6, in <module>
    from .main import (  # noqa: F401
  File "/home/mattia/Progetti/drvtv/env/lib/python3.6/site-packages/eth_tester/backends/pyevm/main.py", line 50, in <module>
    from evm.exceptions import (
ImportError: cannot import name 'HeaderNotFound'
ERROR: could not load /home/mattia/Progetti/drvtv/tests/conftest.py

Then, trying with eth-tester=0.1.0b24 (instead of eth-tester=0.1.0b26) it works!

Thanks to all! :smile_cat:

Was this page helpful?
0 / 5 - 0 ratings