Skip to content
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

Emit message events #564

Merged
merged 5 commits into from
Mar 24, 2023
Merged

Emit message events #564

merged 5 commits into from
Mar 24, 2023

Conversation

yito88
Copy link
Contributor

@yito88 yito88 commented Mar 22, 2023

Closes: #563

Description

Each execution handler emits a message event for the IBC handling according to https://github.com/cosmos/ibc-go/blob/main/docs/ibc/events.md#sendpacket-application-module-call


PR author checklist:

  • Added changelog entry, using unclog.
  • Added tests.
  • Linked to GitHub issue.
  • Updated code comments and documentation (e.g., docs/).
  • Tagged one reviewer who will be the one responsible for shepherding this PR.

Reviewer checklist:

  • Reviewed Files changed in the GitHub PR explorer.
  • Manually tested (in case integration/unit/mock tests are absent).

@codecov
Copy link

codecov bot commented Mar 22, 2023

Codecov Report

Patch coverage: 81.87% and project coverage change: +0.32 🎉

Comparison is base (2d64819) 72.70% compared to head (4d52584) 73.02%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #564      +/-   ##
==========================================
+ Coverage   72.70%   73.02%   +0.32%     
==========================================
  Files         126      126              
  Lines       15550    15679     +129     
==========================================
+ Hits        11306    11450     +144     
+ Misses       4244     4229      -15     
Impacted Files Coverage Δ
crates/ibc/src/core/handler.rs 74.64% <ø> (ø)
crates/ibc/src/events.rs 32.03% <0.00%> (+8.01%) ⬆️
crates/ibc/src/core/context/acknowledgement.rs 97.44% <100.00%> (+0.05%) ⬆️
crates/ibc/src/core/context/chan_close_confirm.rs 96.39% <100.00%> (+0.10%) ⬆️
crates/ibc/src/core/context/chan_close_init.rs 96.55% <100.00%> (+0.06%) ⬆️
crates/ibc/src/core/context/chan_open_ack.rs 96.85% <100.00%> (+0.05%) ⬆️
crates/ibc/src/core/context/chan_open_confirm.rs 96.92% <100.00%> (+0.04%) ⬆️
crates/ibc/src/core/context/chan_open_init.rs 96.74% <100.00%> (+0.05%) ⬆️
crates/ibc/src/core/context/chan_open_try.rs 97.20% <100.00%> (+0.03%) ⬆️
crates/ibc/src/core/context/recv_packet.rs 96.47% <100.00%> (+0.17%) ⬆️
... and 9 more

... and 3 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

crates/ibc/src/events.rs Outdated Show resolved Hide resolved
crates/ibc/src/events.rs Outdated Show resolved Hide resolved
crates/ibc/src/events.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@plafer plafer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks much better! left just a nit

Comment on lines 207 to 210
impl TryFrom<IbcEventType> for abci::Event {
type Error = Error;

fn try_from(event_type: IbcEventType) -> Result<Self, Self::Error> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find this unintuitive since it's not immediately clear to me that the map IbcEventType -> abci::Event yields a message abci Event. Can we instead make this a function

fn try_message_event_from_event_type(event_type: IbcEventType) -> Result<abci::Event, Error> { ... }`

@yito88 yito88 requested a review from plafer March 24, 2023 16:33
Copy link
Contributor

@plafer plafer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@plafer plafer merged commit 8cc943d into cosmos:main Mar 24, 2023
@yito88 yito88 deleted the yuji/message-event branch March 24, 2023 16:43
Farhad-Shabani pushed a commit that referenced this pull request Sep 9, 2024
* emit message events

* add changelog

* for clippy

* remove ClientMisbehaviourMessage

* add try_message_event_from_event_type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Emit "message" event for IBC relayer
2 participants