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

fix: channel must exist before channel creator check #7538

Open
wants to merge 3 commits into
base: feat/ibc-eureka
Choose a base branch
from

Conversation

gjermundgaraba
Copy link
Contributor

Description

Noticed a bit of bad DX when I was sending in the wrong channel-id to register counterparty. Since it was checking the creator first, I got creator not found, when the real issue was that the channel id was not correct (channel not found). Moved the check up and adjusted the test to catch this.


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/).
  • Added relevant godoc comments.
  • Provide a conventional commit message to follow the repository standards.
  • Include a descriptive changelog entry when appropriate. This may be left to the discretion of the PR reviewers. (e.g. chores should be omitted from changelog)
  • Re-reviewed Files changed in the GitHub PR explorer.
  • Review SonarCloud Report in the comment section below once CI passes.

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.

lgtm (left a minor suggestion and a q)

modules/core/04-channel/v2/keeper/msg_server.go Outdated Show resolved Hide resolved
@@ -52,6 +52,7 @@ func (suite *KeeperTestSuite) TestRegisterCounterparty() {
{
"failure: channel must already exist",
func() {
suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.DeleteCreator(suite.chainA.GetContext(), path.EndpointA.ChannelID)
Copy link
Contributor

Choose a reason for hiding this comment

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

is it necessary to delete the creator for this test case to pass? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not anymore, but it was needed to make the test fail in the first place. It passed before because the creator was still there (and it doesn't make a lot of sense for the creator to be present, but not the channel?).

Copy link

sonarcloud bot commented Nov 6, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants