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

Use []abci.Event instead of sdk.Events in argument to testing pkg event parsing functions #3979

Closed
3 tasks
colin-axner opened this issue Jun 28, 2023 · 4 comments · Fixed by #3980
Closed
3 tasks
Labels
testing Testing package and unit/integration tests

Comments

@colin-axner
Copy link
Contributor

colin-axner commented Jun 28, 2023

Summary

Change functions in testing/event.go to use []abci.Event instead of sdk.Events

Problem Definition

In v0.47 SDK, SendMsgs() will end up calling SimDeliver which has access to sdk.Result which has sdk.Events because of this conversion

In v0.50, begin block, deliver tx, and end block are combined into FinalizeBlock which returns a ResponseFinalizeBlock which contains []abci.ExecTxResult. These tx results will contain []abci.Event instead of sdk.Events

Instead of converting []abci.Event into sdk.Events, we should pass around []abci.Event (SendMsgs will also be updated to return a abci.ExecTxResult instead of sdk.Result (but this will occur with the SDK bump)

Proposal

Change functions in testing/event.go to use []abci.Event instead of sdk.Events

Thanks @alpe for the reference fix


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged/assigned
@colin-axner colin-axner added the testing Testing package and unit/integration tests label Jun 28, 2023
@DimitrisJim
Copy link
Contributor

Just for clarity, this is not in any way affected if we moved to typed events, correct? Typed or not typed, we'll still be getting an array of abci.Event from SendMsgs.

@colin-axner
Copy link
Contributor Author

I think that's correct. By typed events you mean creating a type per event type. For example:

type CreateClientEvent struct {}

?

In this situation, indeed FinalizeBlock will still return us a abci.Event as the typed event would only be typed until we emit it. There was discussion a couple years ago to add typed events to the SDK, but it was partially implemented and I'm not sure if it is used today.

@DimitrisJim
Copy link
Contributor

ah, typed events in the way the SDK defined them was what I was referring to. Missing the fact that they aren't really used, there's an old issue you opened on this which might need to be re-examined #54 (and possibly closed)

@colin-axner
Copy link
Contributor Author

Yes exactly. I think #54 should likely be closed as I haven't seen a reason to implement it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Testing package and unit/integration tests
Projects
Status: Done 🥳
Development

Successfully merging a pull request may close this issue.

2 participants