New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Event ProcessReceipt fails for events with same id but different indexed attributes #1351
Comments
Thanks for raising this and explaining it well. I think that we could address this using a similar pattern to
I'm thinking it could be useful to allow a custom error handler function to be provided as well, but I see a route for us to do that later without needing to introduce a breaking change. Instead of using strings for Also, I'm not set on those three names so feel free to explore better/alternate names. |
I think this also suggests we're lacking an API to do |
Agree with the As you say too, it would be very useful to have a method that allows to process a single |
What was wrong?
When I use
rich_logs = erc721.events.Transfer().processReceipt(tx_receipt)
I expect the relevant logs to be decoded and the others ignored. But if I try to process a tx with mixedERC20
andERC721
Transfer
events (ERC721
has the third parameter of the event indexed,ERC20
not) it will fail decoding the event.ERC20
Transfer Eventevent Transfer(address indexed from, address indexed to, uint256 value);
=3 topics
ERC721
Transfer Eventevent Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
=4 topics
Problem is that signature for
Transfer
is the same, but astokenId
is indexed forERC721
it will have one morelog topic
thanERC20
. Whenweb3.py
tries to decode anERC20
event with theERC721
contract, it will fail as it's expecting one topic more.You can test it easily with rinkeby tx-hash
0x21381484d8f69dcd782560d1fd3cd818e743c79767985d01aec7e61c2a7f1de9
, for example.How can it be fixed?
processReceipt
to skip not complaint logsThe text was updated successfully, but these errors were encountered: