feat(tm2/gnovm): add msg_idx in event to identify
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: xxxmessage 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.
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.
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.
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.
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
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