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

Add missing channel upgrade tests #5502

Merged
merged 12 commits into from
Jan 4, 2024

Conversation

chatton
Copy link
Contributor

@chatton chatton commented Jan 2, 2024

Description

closes: #5485

Add missing tests for channel upgrades


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.

@codecov-commenter
Copy link

codecov-commenter commented Jan 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f6e3425) 80.96% compared to head (0cd7eb9) 81.06%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5502      +/-   ##
==========================================
+ Coverage   80.96%   81.06%   +0.10%     
==========================================
  Files         197      197              
  Lines       15221    15221              
==========================================
+ Hits        12323    12339      +16     
+ Misses       2427     2413      -14     
+ Partials      471      469       -2     
Files Coverage Δ
modules/core/04-channel/types/msgs.go 94.80% <ø> (+2.16%) ⬆️
modules/core/04-channel/types/params.go 100.00% <100.00%> (+42.85%) ⬆️

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.

left a couple of Qs, lgtm overall 💪

modules/core/04-channel/types/msgs.go Show resolved Hide resolved
tc := tc
suite.Run(tc.name, func() {
suite.SetupTest()
_, err := keeper.Keeper.UpdateChannelParams(*suite.chainA.App.GetIBCKeeper(), suite.chainA.GetContext(), tc.msg)
Copy link
Contributor

Choose a reason for hiding this comment

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

want to also add a check for nil/non-nil assert on the resp?

@@ -27,10 +28,10 @@ func DefaultParams() Params {
// Validate the params.
func (p Params) Validate() error {
if !p.UpgradeTimeout.Height.IsZero() {
return fmt.Errorf("upgrade timeout height must be zero. got : %v", p.UpgradeTimeout.Height)
return errorsmod.Wrapf(ErrInvalidTimeout, "upgrade timeout height must be zero. got : %v", p.UpgradeTimeout.Height)
Copy link
Contributor

@DimitrisJim DimitrisJim Jan 2, 2024

Choose a reason for hiding this comment

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

this seems to be 'invalid packet timeout' yea? Do we want separate error? I'm actually not finding other references for that error tbh 🤔

edit: we could just tweak err message?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good call, it looks like we already have a ErrInvalidUpgradeTimeout, we can use that instead!

@chatton chatton enabled auto-merge (squash) January 4, 2024 09:23
@crodriguezvega crodriguezvega mentioned this pull request Jan 4, 2024
9 tasks
Copy link
Contributor

@crodriguezvega crodriguezvega left a comment

Choose a reason for hiding this comment

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

Looks fantastic to me. Thanks, @chatton!

@chatton chatton merged commit b2368fa into main Jan 4, 2024
61 checks passed
@chatton chatton deleted the cian/issue#5485-add-missing-channel-upgrade-tests branch January 4, 2024 10:37
mergify bot pushed a commit that referenced this pull request Jan 4, 2024
(cherry picked from commit b2368fa)

# Conflicts:
#	modules/core/04-channel/types/msgs.go
#	modules/core/keeper/msg_server_test.go
crodriguezvega added a commit that referenced this pull request Jan 5, 2024
* Add missing channel upgrade tests (#5502)

(cherry picked from commit b2368fa)

# Conflicts:
#	modules/core/04-channel/types/msgs.go
#	modules/core/keeper/msg_server_test.go

* fix conflicts

---------

Co-authored-by: Cian Hatton <[email protected]>
Co-authored-by: Carlos Rodriguez <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
channel-upgradability Channel upgradability feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add missing tests for channel upgradability
5 participants