processReceipt() returns "Tried to read 96 bytes. Only got 68 bytes"
- Dominant language
- Python
- Stars
- 5.5k
- Forks
- 1.7k
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 2
Description
* Version: x.x.x
* Python: 2.7/3.4/3.5
* OS: osx/linux/win
* `pip freeze` output
```
alabaster==0.7.12
anaconda-client==1.7.2
anaconda-navigator==1.9.7
anaconda-project==0.8.2
appnope==0.1.0
appscript==1.0.1
argh==0.26.2
asn1crypto==0.24.0
astroid==2.2.5
astropy==3.1.2
atomicwrites==1.3.0
attrdict==2.0.1
attrs==19.1.0
Babel==2.6.0
backcall==0.1.0
backports.os==0.1.1
backports.shutil-get-terminal-size==1.0.0
beautifulsoup4==4.7.1
bitarray==0.8.3
bitcoin==1.1.42
bkcharts==0.2
bleach==3.1.0
bokeh==1.0.4
boto==2.49.0
Bottleneck==1.2.1
certifi==2019.3.9
cffi==1.12.2
chardet==3.0.4
Click==7.0
cloudpickle==0.8.0
clyent==1.2.2
colorama==0.4.1
conda==4.6.11
conda-build==3.17.8
conda-verify==3.1.1
contextlib2==0.5.5
cryptography==2.6.1
cycler==0.10.0
Cython==0.29.6
cytoolz==0.9.0.1
dask==1.1.4
dataclasses-json==0.2.14
decorator==4.4.0
defusedxml==0.5.0
distributed==1.26.0
docutils==0.14
entrypoints==0.3
et-xmlfile==1.0.1
eth-abi==1.3.0
eth-account==0.3.0
eth-hash==0.2.0
eth-keyfile==0.5.1
eth-keys==0.2.4
eth-rlp==0.1.2
eth-tester==0.1.0b39
eth-testrpc==1.3.0
eth-typing==2.1.0
eth-utils==1.6.4
ethereum==1.6.1
fastcache==1.0.2
filelock==3.0.10
Flask==1.0.2
future==0.17.1
gevent==1.4.0
glob2==0.6
gmpy2==2.0.8
gql==0.1.0
gql-next==0.1.1
graphql-core==2.1
GraphQL-core-next==1.0.5
greenlet==0.4.15
h5py==2.9.0
heapdict==1.0.0
hexbytes==0.2.0
html5lib==1.0.1
idna==2.6
imageio==2.5.0
imagesize==1.1.0
importlib-metadata==0.0.0
inflection==0.3.1
ipykernel==5.1.0
ipython==7.4.0
ipython-genutils==0.2.0
ipywidgets==7.4.2
isort==4.3.16
itsdangerous==1.1.0
jdcal==1.4
jedi==0.13.3
Jinja2==2.10
json-rpc==1.12.1
jsonschema==3.0.1
jupyter==1.0.0
jupyter-client==5.2.4
jupyter-console==6.0.0
jupyter-core==4.4.0
jupyterlab==0.35.4
jupyterlab-server==0.2.0
keyring==18.0.0
kiwisolver==1.0.1
kucoin-python==2.0.5
lazy-object-proxy==1.3.1
libarchive-c==2.8
lief==0.9.0
llvmlite==0.28.0
locket==0.2.0
lru-dict==1.1.6
lxml==4.3.2
MarkupSafe==1.1.1
marshmallow==3.0.0rc6
marshmallow-enum==1.4.1
matplotlib==3.0.3
mccabe==0.6.1
mistune==0.8.4
mkl-fft==1.0.10
mkl-random==1.0.2
more-itertools==6.0.0
mpmath==1.1.0
msgpack==0.6.1
multipledispatch==0.6.0
mypy-extensions==0.4.1
navigator-updater==0.2.1
nbconvert==5.4.1
nbformat==4.4.0
networkx==2.2
nltk==3.4
nose==1.3.7
notebook==5.7.8
numba==0.43.1
numexpr==2.6.9
numpy==1.16.2
numpydoc==0.8.0
olefile==0.46
openpyxl==2.6.1
packaging==19.0
pandas==0.24.2
pandocfilters==1.4.2
parsimonious==0.8.1
parso==0.3.4
partd==0.3.10
path.py==11.5.0
pathlib2==2.3.3
pathtools==0.1.2
patsy==0.5.1
pbkdf2==1.3
pep8==1.7.1
pexpect==4.6.0
pickleshare==0.7.5
Pillow==5.4.1
pkginfo==1.5.0.1
pluggy==0.9.0
ply==3.11
prometheus-client==0.6.0
promise==2.2.1
prompt-toolkit==2.0.9
psutil==5.6.1
ptyprocess==0.6.0
py==1.8.0
pycodestyle==2.5.0
pycosat==0.6.3
pycparser==2.19
pycrypto==2.6.1
pycryptodome==3.8.2
pycurl==7.43.0.2
pyethash==0.1.27
pyflakes==2.1.1
Pygments==2.3.1
PyJWT==1.7.1
pylint==2.3.1
pylru==1.2.0
pyodbc==4.0.26
pyOpenSSL==19.0.0
pyparsing==2.3.1
pyrsistent==0.14.11
pysha3==1.0.2
PySocks==1.6.8
pytest==4.3.1
pytest-arraydiff==0.3
pytest-astropy==0.5.0
pytest-doctestplus==0.3.0
pytest-openfiles==0.3.2
pytest-remotedata==0.3.1
python-dateutil==2.6.1
pytz==2017.3
PyWavelets==1.0.2
PyYAML==5.1
pyzmq==18.0.0
QtAwesome==0.5.7
qtconsole==4.4.3
QtPy==1.7.0
repoze.lru==0.7
requests==2.18.4
rlp==0.6.0
rope==0.12.0
ruamel-yaml==0.15.46
Rx==1.6.1
scikit-image==0.14.2
scikit-learn==0.20.3
scipy==1.2.1
scrypt==0.8.13
seaborn==0.9.0
secp256k1==0.13.2
semantic-version==2.6.0
Send2Trash==1.5.0
simplegeneric==0.8.1
singledispatch==3.4.0.3
six==1.12.0
snowballstemmer==1.2.1
sortedcollections==1.1.2
sortedcontainers==2.1.0
soupsieve==1.8
Sphinx==1.8.5
sphinxcontrib-websupport==1.1.0
spyder==3.3.3
spyder-kernels==0.4.2
SQLAlchemy==1.3.1
statsmodels==0.9.0
stringcase==1.2.0
sympy==1.3
tables==3.5.1
tblib==1.3.2
terminado==0.8.1
testpath==0.4.2
toolz==0.9.0
tornado==6.0.2
tqdm==4.31.1
traitlets==4.3.2
typing-inspect==0.4.0
unicodecsv==0.14.1
urllib3==1.22
virtualenv==16.7.2
voluptuous==0.11.5
voluptuous-serialize==2.1.0
watchdog==0.9.0
wcwidth==0.1.7
web3==4.8.2
webencodings==0.5.1
websockets==6.0
Werkzeug==0.14.1
widgetsnbextension==3.4.2
wrapt==1.11.1
wurlitzer==1.0.2
xlrd==1.2.0
XlsxWriter==1.1.5
xlwings==0.15.4
xlwt==1.3.0
zict==0.1.4
zipp==0.3.3
```
### What was wrong?
I am trying to obtain event logs of the MakerDAO Tub Contract (Contract 1 etherscan) using getTransactionReceipt() and processReceipt(). The problem seems to be in LogNote() events, because all the other events work. Here is the code:
```
Tub_Contract = Web3.toChecksumAddress('0x448a5065aeBB8E423F0896E6c5D525C040f59af3')
ABI_Tub_Contract = """[{"constant":false,"inputs":[{"name":"wad","type":"uint256"}],"name":"join","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"sin","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"skr","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"gov","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"owner_","type":"address"}],"name":"setOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"era","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"cup","type":"bytes32"}],"name":"ink","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"rho","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"air","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"rhi","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"flow","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"cap","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"cup","type":"bytes32"}],"name":"bite","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"cup","type":"bytes32"},{"name":"wad","type":"uint256"}],"name":"draw","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"wad","type":"uint256"}],"name":"bid","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"cupi","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"axe","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"tag","outputs":[{"name":"wad","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"off","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"vox","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"gap","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"cup","type":"bytes32"}],"name":"rap","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"cup","type":"bytes32"},{"name":"wad","type":"uint256"}],"name":"wipe","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"authority_","type":"address"}],"name":"setAuthority","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"gem","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"tap_","type":"address"}],"name":"turn","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"per","outputs":[{"name":"ray","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"wad","type":"uint256"}],"name":"exit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"pip_","type":"address"}],"name":"setPip","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"pie","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"fit_","type":"uint256"},{"name":"jam","type":"uint256"}],"name":"cage","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"rum","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"sai","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"param","type":"bytes32"},{"name":"val","type":"uint256"}],"name":"mold","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"tax","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"drip","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"cup","type":"bytes32"},{"name":"wad","type":"uint256"}],"name":"free","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"mat","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"pep","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"out","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"cup","type":"bytes32"},{"name":"wad","type":"uint256"}],"name":"lock","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"cup","type":"bytes32"}],"name":"shut","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"cup","type":"bytes32"},{"name":"guy","type":"address"}],"name":"give","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"authority","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"fit","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"chi","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"vox_","type":"address"}],"name":"setVox","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"pip","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"pep_","type":"address"}],"name":"setPep","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"fee","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"cup","type":"bytes32"}],"name":"lad","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"din","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"wad","type":"uint256"}],"name":"ask","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"cup","type":"bytes32"}],"name":"safe","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"pit","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"cup","type":"bytes32"}],"name":"tab","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"open","outputs":[{"name":"cup","type":"bytes32"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"tap","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"cups","outputs":[{"name":"lad","type":"address"},{"name":"ink","type":"uint256"},{"name":"art","type":"uint256"},{"name":"ire","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"sai_","type":"address"},{"name":"sin_","type":"address"},{"name":"skr_","type":"address"},{"name":"gem_","type":"address"},{"name":"gov_","type":"address"},{"name":"pip_","type":"address"},{"name":"pep_","type":"address"},{"name":"vox_","type":"address"},{"name":"pit_","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"lad","type":"address"},{"indexed":false,"name":"cup","type":"bytes32"}],"name":"LogNewCup","type":"event"},{"anonymous":true,"inputs":[{"indexed":true,"name":"sig","type":"bytes4"},{"indexed":true,"name":"guy","type":"address"},{"indexed":true,"name":"foo","type":"bytes32"},{"indexed":true,"name":"bar","type":"bytes32"},{"indexed":false,"name":"wad","type":"uint256"},{"indexed":false,"name":"fax","type":"bytes"}],"name":"LogNote","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"authority","type":"address"}],"name":"LogSetAuthority","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"}],"name":"LogSetOwner","type":"event"}]"""
contract = w3.eth.contract(Tub_Contract , abi= ABI_Tub_Contract)
tx_receipt = w3.eth.getTransactionReceipt('0x32f9c2d22ef47cd589a21514ae83aa3c03372e57e8d6a4b4236f9a292c46434c')
event_logs = contract.events.LogNote().processReceipt(tx_receipt)
print(event_logs)
```
The output is the following:
```
File "CDP_events.py", line 9, in
event_logs = contract.events.LogNote().processReceipt(tx_receipt)
File "/anaconda3/lib/python3.7/site-packages/web3/utils/decorators.py", line 14, in _wrapper
return self.method(obj, *args, **kwargs)
File "/anaconda3/lib/python3.7/site-packages/web3/contract.py", line 1279, in processReceipt
return self._parse_logs(txn_receipt)
File "/anaconda3/lib/python3.7/site-packages/eth_utils/functional.py", line 45, in inner
return callback(fn(*args, **kwargs))
File "/anaconda3/lib/python3.7/site-packages/web3/contract.py", line 1285, in _parse_logs
decoded_log = get_event_data(self.abi, log)
File "/anaconda3/lib/python3.7/site-packages/web3/utils/events.py", line 188, in get_event_data
decoded_log_data = decode_abi(log_data_types, log_data)
File "/anaconda3/lib/python3.7/site-packages/eth_abi/abi.py", line 96, in decode_abi
return decoder(stream)
File "/anaconda3/lib/python3.7/site-packages/eth_abi/decoding.py", line 118, in __call__
return self.decode(stream)
File "/anaconda3/lib/python3.7/site-packages/eth_utils/functional.py", line 45, in inner
return callback(fn(*args, **kwargs))
File "/anaconda3/lib/python3.7/site-packages/eth_abi/decoding.py", line 164, in decode
yield decoder(stream)
File "/anaconda3/lib/python3.7/site-packages/eth_abi/decoding.py", line 118, in __call__
return self.decode(stream)
File "/anaconda3/lib/python3.7/site-packages/eth_abi/decoding.py", line 136, in decode
value = self.tail_decoder(stream)
File "/anaconda3/lib/python3.7/site-packages/eth_abi/decoding.py", line 118, in __call__
return self.decode(stream)
File "/anaconda3/lib/python3.7/site-packages/eth_abi/decoding.py", line 186, in decode
raw_data = self.read_data_from_stream(stream)
File "/anaconda3/lib/python3.7/site-packages/eth_abi/decoding.py", line 589, in read_data_from_stream
len(data),
eth_abi.exceptions.InsufficientDataBytes: Tried to read 96 bytes. Only got 68 bytes
```
Contributor guide
Assessment
This issue has not been assessed yet.