Erroneous code in web3._utils.encoding
- Ngôn ngữ chính
- Python
- Star
- 5.5k
- Fork
- 1.7k
- Merge trung bình
- 3 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 2
Mô tả
### What was wrong?
Found some erroneous code in `web3._utils.encoding`: https://github.com/ethereum/web3.py/blob/2271ba22be00dabc3eb8ba08a4d2ccc0dda1b93b/web3/_utils/encoding.py#L309
The problem with the above code is that the `arrlist` property on `ABIType` instances is *always* a tuple of tuples or `None` if no array dimension list was encountered when parsing a type string. So `arrlist[-1]` will never equal `1`.
I tried swapping out the enclosing function (which appears to implement an experimental packed encoder before one was available in eth-abi) for the packed encoder that is now available in eth-abi. This caused tests to fail in `tests/core/filtering/test_contract_topic_filters.py`.
I didn't have time to dig into things and really diagnose the problem. It seems like it could take a bit of time to do that. My sense is that some of the filtering features were built upon incorrect assumptions about packed encodings.
### How can it be fixed?
Not sure yet. Will need to dig into this more deeply.
Hướng dẫn đóng góp
Đánh giá
Issue này chưa được đánh giá.