-
Notifications
You must be signed in to change notification settings - Fork 332
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
Explicit assumptions in packet_from_tx_search_response #617
Conversation
Codecov Report
@@ Coverage Diff @@
## master #617 +/- ##
=========================================
+ Coverage 13.6% 44.5% +30.8%
=========================================
Files 69 144 +75
Lines 3752 9550 +5798
Branches 1374 0 -1374
=========================================
+ Hits 513 4255 +3742
- Misses 2618 5295 +2677
+ Partials 621 0 -621
Continue to review full report at Codecov.
|
relayer/src/chain/cosmos.rs
Outdated
assert_eq!( | ||
e.type_str, | ||
request.event_id.as_str(), | ||
"packet_from_tx_search_response: unexpected event type" | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem right. It is true that there is one single transaction but it may include multiple events. I think what was there before was correct:
assert_eq!( | |
e.type_str, | |
request.event_id.as_str(), | |
"packet_from_tx_search_response: unexpected event type" | |
); | |
if e.type_str != request.event_id.as_str() { | |
continue; | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This was the reason why the tests were failing. Fixed in b0a9aa0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks Vitor!
…ms#617) * Explicit assumption in packet_from_tx_search_response
Closes: #XXX
Description
This PR makes the following two assumptions from
packet_from_tx_search_response
explicit:To make the second assumption explicit, it's required that we iterate all transactions events, which may come with a performance cost. To alleviate this, we're now only trying to parse channel events with
ChannelEvents::try_from_tx(&e)
instead of the more generalfrom_tx_response_event(e)
.This is a follow-up to #613.
For contributor use:
docs/
) and code comments.Files changed
in the Github PR explorer.