mento-protocol / governance-watchdog

A system that monitors Mento Governance events on-chain and sends notifications about them to Discord and Telegram
0 stars 0 forks source link

refactor: better error handling when parsing events #8

Closed nvtaveras closed 1 month ago

nvtaveras commented 1 month ago

This is an improvement over the way events were being parsed in #4, mainly introducing a way to distinguish events by checking their signature on the log topics, so that we can be sure the right ABI is being used when decoding the event, eliminating the unnecessary try/catch blocks in the previous implementation. I also added a few asserts in places that shouldn't be reachable unless there's a wrong assumption in the way events are being parsed.