I'd suggest using pipenv.
mkdir pyeth
cd pyeth
pipenv --three
Then install pyethereum modules and pytest.
pipenv install git+https://github.com/ethereum/py_pairing.git@5f609da9222bbd8b0d6ba061b45406808a9fc51b#egg=py_ecc
pipenv install git+https://github.com/ethereum/pyethereum.git@a6875c8ddc4b11c5a3707534a63bdab22e7b2a59#egg=ethereum
pipenv install pycryptodome
pipenv install pytest
Now clone pyethereum and fetch the tests submodule (i.e. pyethereum/fixtures
).
git clone https://github.com/ethereum/pyethereum.git
cd pyethereum
git checkout a6875c8ddc4b11c5a3707534a63bdab22e7b2a59
git submodule update --init
Open ethereum/specials.py and edit:
from py_ecc.secp256k1 import privtopub, ecdsa_raw_recover, N as secp256k1n
->
from py_ecc.secp256k1 import privtopub, ecdsa_raw_recover
Open pyethereum/ethereum/tests/test_state.py and add one line (configure_logging(':trace')
):
checker = new_statetest_utils.verify_state_test
place_to_check = 'GeneralStateTests'
->
checker = new_statetest_utils.verify_state_test
place_to_check = 'GeneralStateTests'
configure_logging(':trace')
Go to the pyethereum/fixtures
directory and make a copy of GeneralStateTests.
cd fixtures
cp -a GeneralStateTests GeneralStateTestsCopy
In the GeneralStateTests directory, put only the test case that you want to run.
cd GeneralStateTests
rm -rf st*
cp ../GeneralStateTestsCopy/stTransactionTest/SuicidesAndInternlCallSuicidesSuccess.json ./
Now run the state test in pipenv shell.
pipenv shell
pytest -s ethereum/tests/test_state.py