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

ics20 could emit more information on MsgTransfer #2545

Closed
3 tasks
colin-axner opened this issue Oct 14, 2022 · 8 comments · Fixed by #2643
Closed
3 tasks

ics20 could emit more information on MsgTransfer #2545

colin-axner opened this issue Oct 14, 2022 · 8 comments · Fixed by #2643
Assignees
Labels

Comments

@colin-axner
Copy link
Contributor

Summary

We only emit sender/reciever in ics20 send transfer. We could emit amount/denom/metadata as well


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged/assigned
@colin-axner colin-axner changed the title SendTransfer could emit more information ics20 could emit more information on MsgTransfer Oct 14, 2022
@crodriguezvega crodriguezvega added the good first issue Good for newcomers label Oct 14, 2022
@Anmol1696
Copy link
Contributor

Can take this up

@crodriguezvega
Copy link
Contributor

Can take this up

Yes! Thank you, @Anmol1696!

@Anmol1696
Copy link
Contributor

@crodriguezvega in the PR i realized there are not much tests for checking the events itself for any of msg emiters. Do you think it would make sense to add unit tests for testing events as well for each of the msg types. I am think of it more from catching regression perspecitve more than anything else.

I tried to add a way for testing the event in this PR, maybe we can make it better and add it everywhere.

@crodriguezvega
Copy link
Contributor

@crodriguezvega in the PR i realized there are not much tests for checking the events itself for any of msg emiters. Do you think it would make sense to add unit tests for testing events as well for each of the msg types. I am think of it more from catching regression perspecitve more than anything else.

I tried to add a way for testing the event in this PR, maybe we can make it better and add it everywhere.

Yes, I think it makes sense to test the events emitted (at least the ones that external parties, like relayers depend upon). Thanks for adding that to the PR. However, as you can see it requires quite some boilerplate code to be able to test the events, since there's no first-class support for it in the testing package. Before testing other events I think it would be good to hear @colin-axner's opinion as well, in case there's a way to improve the testing package to make this easier and reduce the boilerplate code needed in the tests. Alternatively we can also rely on the e2e tests (which use a relayer) to test that the events get emitted. Since modifying events is a non state-machine breaking change, we can also easily improve upon them and make a patch release.

@Anmol1696
Copy link
Contributor

Hmm that does make sense, for this PR i did not try to optimize the boilerplate for testing events, ideally if this is something of interest, we can optimize it and create helper functions as well.
I am a bigger proponent of e2e tests, but as events are becoming more and more important, maybe having them checked could be a nice to have, if we figure out a good approach to it.

@Anmol1696
Copy link
Contributor

FYI @crodriguezvega I tried to make the boilerplate for checking the events againts an expected map of map in the same PR, https://github.com/cosmos/ibc-go/pull/2643/files#diff-ae66bd29b0c68b16e3fc64fb2d8c88dcc90ef4ed6c1f67be36baf8d693473f8eR9, maybe something like this we could use in a more generic way?

@Anmol1696
Copy link
Contributor

Should i open up a separate issue with more details for this event testing issue with a broader scope?

@colin-axner
Copy link
Contributor Author

Yes, event testing can go in a separate issue and ideally smaller issues are opened for each body of work that should have an associated pr. I find it easier to review/merge pr's that only affect a handful of files as opposed to refactoring all our modules event testing in one pr. For example, if you add a test for testing transfer events, that'd be one pr, same goes for core ibc send packet, recv packet etc

@crodriguezvega crodriguezvega moved this to Todo in ibc-go Nov 23, 2022
@crodriguezvega crodriguezvega moved this from Todo to Done in ibc-go Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done 🥳
Development

Successfully merging a pull request may close this issue.

3 participants