gno icon indicating copy to clipboard operation
gno copied to clipboard

feat(tm2/gnovm): add msg_idx in event to identify

Open r3v4s opened this issue 1 year ago • 3 comments

Closes #2031

As describe in above issue, this pr adds msg_idx field in ctx.Event struct to identify which event was emitted by which msg.

FYI, this pr also includes another bug fix in #2030. It can be close if we're willing to merge this one

Contributors' checklist...
  • [x] Added new tests, or not needed, or not feasible
  • [x] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory
  • [x] Updated the official documentation or not needed
  • [x] No breaking changes were made, or a BREAKING CHANGE: xxx message was included in the description
  • [x] Added references to related issues and PRs
  • [ ] Provided any useful hints for running manual tests
  • [ ] Added new benchmarks to generated graphs, if any. More info here.

r3v4s avatar May 09 '24 06:05 r3v4s

Codecov Report

Attention: Patch coverage is 54.09836% with 28 lines in your changes are missing coverage. Please review.

Project coverage is 46.25%. Comparing base (8057505) to head (dabf13c). Report is 9 commits behind head on master.

Files Patch % Lines
gno.land/pkg/gnoclient/client_txs.go 57.44% 10 Missing and 10 partials :warning:
tm2/pkg/bft/abci/types/types.go 0.00% 4 Missing :warning:
tm2/pkg/sdk/baseapp.go 60.00% 3 Missing and 1 partial :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2061      +/-   ##
==========================================
- Coverage   54.96%   46.25%   -8.72%     
==========================================
  Files         481      505      +24     
  Lines       67391    71040    +3649     
==========================================
- Hits        37040    32856    -4184     
- Misses      27330    35457    +8127     
+ Partials     3021     2727     -294     
Flag Coverage Δ
gno.land 61.65% <57.44%> (?)
tm2 53.94% <42.85%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar May 09 '24 06:05 codecov[bot]

Why do you need an index when the events are delivered in an ordered slice?

Your PR only shows msg_idx=0, which seems incorrect.

moul avatar May 12 '24 09:05 moul

Why do you need an index when the events are delivered in an ordered slice?

Your PR only shows msg_idx=0, which seems incorrect.

Index is about MESSAGE index, not EVENT. So as described in #2031, current event output is just list of events without knowing which msg emitted which event if tx inlcudes 2 or more msgs.

I'll add test cases that runs 2 messages // UPDATE 3002936883a10a4812b15a176057473feeaf0dff

r3v4s avatar May 13 '24 01:05 r3v4s

After our PR discussions, and discussions with @r3v4s, we've decided to close this PR. The bulk of the reasoning is outlined here: https://github.com/gnolang/gno/pull/2061#discussion_r1602884318

zivkovicmilos avatar Jun 11 '24 08:06 zivkovicmilos