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

test: event emission on writing error receipts for channel upgrades #5549

Merged
merged 10 commits into from
Jan 10, 2024

Conversation

charleenfei
Copy link
Contributor

Description

closes comment from @DimitrisJim

Commit Message / Changelog Entry

type: commit message

see the guidelines for commit messages. (view raw markdown for examples)


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against the correct branch (see CONTRIBUTING.md).
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards and Go style guide.
  • Wrote unit and integration tests.
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/).
  • Added relevant godoc comments.
  • Provide a commit message to be used for the changelog entry in the PR description for review.
  • Re-reviewed Files changed in the Github PR explorer.
  • Review Codecov Report in the comment section below once CI passes.

channeltypes.AttributeKeyUpgradeSequence: fmt.Sprintf("%d", channel.UpgradeSequence),
},
channeltypes.EventTypeChannelUpgradeError: {
channeltypes.AttributeKeyPortID: path.EndpointA.ChannelConfig.PortID,
Copy link
Contributor Author

@charleenfei charleenfei Jan 8, 2024

Choose a reason for hiding this comment

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

added error receipt event test here

channeltypes.EventTypeChannelUpgradeError: {
channeltypes.AttributeKeyPortID: path.EndpointB.ChannelConfig.PortID,
channeltypes.AttributeKeyChannelID: path.EndpointB.ChannelID,
channeltypes.AttributeCounterpartyPortID: path.EndpointA.ChannelConfig.PortID,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

added error receipt event test here

expEvents := ibctesting.EventsMap{
channeltypes.EventTypeChannelUpgradeError: {
channeltypes.AttributeKeyPortID: path.EndpointB.ChannelConfig.PortID,
channeltypes.AttributeKeyChannelID: path.EndpointB.ChannelID,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

added error receipt event test here on abort

expEvents := ibctesting.EventsMap{
channeltypes.EventTypeChannelUpgradeError: {
channeltypes.AttributeKeyPortID: path.EndpointB.ChannelConfig.PortID,
channeltypes.AttributeKeyChannelID: path.EndpointB.ChannelID,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

added error receipt event test here on abort

expEvents := ibctesting.EventsMap{
channeltypes.EventTypeChannelUpgradeError: {
channeltypes.AttributeKeyPortID: path.EndpointB.ChannelConfig.PortID,
channeltypes.AttributeKeyChannelID: path.EndpointB.ChannelID,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

added error receipt event test here on abort

channeltypes.AttributeKeyUpgradeSequence: fmt.Sprintf("%d", channel.UpgradeSequence),
},
channeltypes.EventTypeChannelUpgradeError: {
channeltypes.AttributeKeyPortID: path.EndpointA.ChannelConfig.PortID,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

added error receipt event test here

@DimitrisJim DimitrisJim added channel-upgradability Channel upgradability feature backport-to-v8.1.x labels Jan 9, 2024
Copy link
Contributor

@DimitrisJim DimitrisJim left a comment

Choose a reason for hiding this comment

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

I think this lgtm, thanks! added a small suggestion for also checking the case that no events are emitted.

modules/core/keeper/msg_server_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@DimitrisJim DimitrisJim left a comment

Choose a reason for hiding this comment

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

pushed a quick nit on arg order. ACK changes

@DimitrisJim DimitrisJim added the priority PRs that need prompt reviews label Jan 10, 2024
Copy link
Contributor

@chatton chatton left a comment

Choose a reason for hiding this comment

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

Sorry for the late review! LGTM, using the events as an arg cleans things up a good bit!

@charleenfei charleenfei merged commit d487fb8 into main Jan 10, 2024
62 checks passed
@charleenfei charleenfei deleted the charly/error_receipt_events branch January 10, 2024 13:32
mergify bot pushed a commit that referenced this pull request Jan 10, 2024
colin-axner pushed a commit that referenced this pull request Jan 10, 2024
…5549) (#5564)

(cherry picked from commit d487fb8)

Co-authored-by: Charly <charly@interchain.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
channel-upgradability Channel upgradability feature priority PRs that need prompt reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants