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

update the Order check in ValidateUpgradeFields util method #3774

Conversation

charleenfei
Copy link
Contributor

Description

closes: #3635


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 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.

@charleenfei charleenfei changed the title update the Order check in ValidateUpgradeFields util method update the Order check in ValidateUpgradeFields util method Jun 7, 2023
@charleenfei charleenfei marked this pull request as ready for review June 7, 2023 11:28
@@ -278,8 +278,8 @@ func (k Keeper) validateUpgradeFields(ctx sdk.Context, proposedUpgrade types.Upg
}

connectionID := proposedUpgrade.ConnectionHops[0]
connection, err := k.GetConnection(ctx, connectionID)
if err != nil {
connection, found := k.connectionKeeper.GetConnection(ctx, connectionID)
Copy link
Member

Choose a reason for hiding this comment

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

This is because k.GetConnection was returning the interface exported.ConnectionI rather than the concrete ConnectionEnd type, right? So that GetVersions() can be used below.

Should we add GetVersions() as an interface method to exported.ConnectionI? cc. @colin-axner

Copy link
Contributor Author

@charleenfei charleenfei Jun 7, 2023

Choose a reason for hiding this comment

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

yes, precisely @damiannolan, i'd be in favour of adding GetVersions(), i think it's the only method missing from the keeper methods in the ConnectionI interface

@@ -554,7 +556,7 @@ func (suite *KeeperTestSuite) TestValidateProposedUpgradeFields() {
{
name: "change channel version",
malleate: func() {
proposedUpgrade.Version = "1.0.0"
proposedUpgrade.Version = mockUpgradeVersion
Copy link
Member

Choose a reason for hiding this comment

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

there is mock.UpgradeVersion now, can we use that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah, yes, forgot about that value! i can use it.

@charleenfei charleenfei enabled auto-merge (squash) June 7, 2023 13:38
@charleenfei charleenfei merged commit 5bcf9d9 into 04-channel-upgrades Jun 7, 2023
@charleenfei charleenfei deleted the charly/#3635-order-check-validateupgradefields branch June 7, 2023 13:44
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