Closed elishadrion closed 11 months ago
Can you paste the output of pip freeze
?
attrdict==2.0.0
bitcoin==1.1.42
certifi==2018.4.16
cffi==1.11.5
chardet==3.0.4
click==6.7
cytoolz==0.9.0.1
eth-abi==1.1.1
eth-account==0.2.3
eth-hash==0.1.4
eth-keyfile==0.5.1
eth-keys==0.2.0b3
eth-rlp==0.1.2
eth-testrpc==1.3.5
eth-utils==1.0.3
ethereum==1.6.1
hexbytes==0.1.0
idna==2.7
json-rpc==1.11.0
lru-dict==1.1.6
parsimonious==0.8.0
pbkdf2==1.3
py-solc==3.1.0
pycparser==2.18
pycryptodome==3.6.4
pyethash==0.1.27
pysha3==1.0.2
PyYAML==3.13
repoze.lru==0.7
requests==2.19.1
rlp==0.6.0
scrypt==0.8.6
secp256k1==0.13.2
semantic-version==2.6.0
six==1.11.0
toolz==0.9.0
urllib3==1.23
web3==4.4.1
websockets==5.0.1
Werkzeug==0.14.1
I installed the following packages via pip : web3py
, py-solc
and eth-testrpc
There appears to be a bug with the provider. Try testing with EthereumTesterProvider
which uses py-evm for its backend by default, which is better maintained than pyethereum.
I was able to recreate your issue using eth-testrpc, where the address field in the logs is malformed:
*** ValueError: Could not format value [{'type': 'mined', 'logIndex': '0x0', 'transactionIndex': '0x0', 'transactionHash': '0x39c738b0986d5048b08e04474df4f0c5b44e0d5eb780889d0b993dc46a84a392', 'blockHash': '0xd6bb105376ff213ff0baec6b7afb8ce63c11d691a53c23adc1a8f7320a7d71df', 'blockNumber': '0x1', 'address': '0x000000000000000000000000c305c901078781c232a2a521c2af7980f8385ee9', 'data': '0x0000000000000000000000000000000000000000000000000de0b6b3a7640000', 'topics': ['0x93a0151bd9ab4670fc26048645e2eb2e4255bdf34858297165d80d4404731af1']}] as field 'logs'
Using the py-evm backed EthereumTesterProvider does not have the same issue.
Did you simply replace w3 = Web3(TestRPCProvider())
by w3 = Web3(EthereumTesterProvider())
and successfully ran the script?
I systematically have the following error now, caused by web3.eth.waitForTransactionReceipt(tx_hash)
:
File "/Users/ed/Desktop/abcd/venv3.6/lib/python3.6/site-packages/eth_tester/main.py", line 314, in get_transaction_receipt
raise ValidationError('Invalid status value: only 0 or 1 are valid')
eth_tester.exceptions.ValidationError: Invalid status value: only 0 or 1 are valid
The same error is produced using the code here.
stale
What was wrong?
This is the code.
The issue is that when an event is caught, the following error systematically appears :
c305c901078781c232a2a521c2af7980f8385ee9
being the address of the contract on the testnet.