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: assert previous channel identifer is empty in Msg ValidateBasic #1792

Merged
merged 9 commits into from
Jul 28, 2022

Conversation

colin-axner
Copy link
Contributor

@colin-axner colin-axner commented Jul 27, 2022

Description

closes: #1778


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.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

@colin-axner colin-axner changed the title fix: Assert previous channel identifer is empty in Msg ValidateBasic fix: ssert previous channel identifer is empty in Msg ValidateBasic Jul 27, 2022
@colin-axner colin-axner changed the title fix: ssert previous channel identifer is empty in Msg ValidateBasic fix: assert previous channel identifer is empty in Msg ValidateBasic Jul 27, 2022
Comment on lines -158 to -160
{"too short channel id", types.NewMsgChannelOpenTry(portid, invalidShortChannel, version, types.ORDERED, connHops, cpportid, cpchanid, version, suite.proof, height, addr), false},
{"too long channel id", types.NewMsgChannelOpenTry(portid, invalidLongChannel, version, types.ORDERED, connHops, cpportid, cpchanid, version, suite.proof, height, addr), false},
{"channel id contains non-alpha", types.NewMsgChannelOpenTry(portid, invalidChannel, version, types.ORDERED, connHops, cpportid, cpchanid, version, suite.proof, height, addr), false},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed these three cases

{"invalid counterparty channel id", types.NewMsgChannelOpenTry(portid, version, types.UNORDERED, connHops, cpportid, invalidChannel, version, suite.proof, height, addr), false},
{"empty proof", types.NewMsgChannelOpenTry(portid, version, types.UNORDERED, connHops, cpportid, cpchanid, version, emptyProof, height, addr), false},
{"channel not in TRYOPEN state", &types.MsgChannelOpenTry{portid, "", initChannel, version, suite.proof, height, addr}, false},
{"previous channel id is not empty", &types.MsgChannelOpenTry{portid, chanid, initChannel, version, suite.proof, height, addr}, false},
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 this test case

@codecov-commenter
Copy link

codecov-commenter commented Jul 27, 2022

Codecov Report

Merging #1792 (cacd1b4) into main (88e4388) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1792      +/-   ##
==========================================
- Coverage   79.92%   79.92%   -0.01%     
==========================================
  Files         166      166              
  Lines       12439    12437       -2     
==========================================
- Hits         9942     9940       -2     
  Misses       2030     2030              
  Partials      467      467              
Impacted Files Coverage Δ
modules/core/04-channel/types/msgs.go 77.09% <100.00%> (-0.15%) ⬇️

Copy link
Member

@damiannolan damiannolan left a comment

Choose a reason for hiding this comment

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

Nice work!

CHANGELOG.md Outdated Show resolved Hide resolved
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.

Thanks, @colin-axner!

CHANGELOG.md Outdated Show resolved Hide resolved
@colin-axner colin-axner merged commit 4a781e5 into main Jul 28, 2022
@colin-axner colin-axner deleted the colin/1778-04channel-leftover branch July 28, 2022 18:36
mergify bot pushed a commit that referenced this pull request Jul 28, 2022
…1792)

* remove previous channel id from NewMsgChanOpenTry, assert previous channel id to be empty

* add changelog entry

* move changelog entry to correct location

* add migration docs

* Update docs/migrations/v3-to-v4.md

Co-authored-by: Carlos Rodriguez <[email protected]>

* Update CHANGELOG.md

Co-authored-by: Carlos Rodriguez <[email protected]>

Co-authored-by: Carlos Rodriguez <[email protected]>
(cherry picked from commit 4a781e5)

# Conflicts:
#	CHANGELOG.md
crodriguezvega pushed a commit that referenced this pull request Jul 29, 2022
…(backport #1792) (#1827)

* fix: assert previous channel identifer is empty in Msg ValidateBasic (#1792)

* remove previous channel id from NewMsgChanOpenTry, assert previous channel id to be empty

* add changelog entry

* move changelog entry to correct location

* add migration docs

* Update docs/migrations/v3-to-v4.md

Co-authored-by: Carlos Rodriguez <[email protected]>

* Update CHANGELOG.md

Co-authored-by: Carlos Rodriguez <[email protected]>

Co-authored-by: Carlos Rodriguez <[email protected]>
(cherry picked from commit 4a781e5)

# Conflicts:
#	CHANGELOG.md

* fix conflicts

Co-authored-by: colin axnér <[email protected]>
Co-authored-by: Carlos Rodriguez <[email protected]>
ulbqb pushed a commit to ulbqb/ibc-go that referenced this pull request Jul 27, 2023
…(backport cosmos#1792) (cosmos#1827)

* fix: assert previous channel identifer is empty in Msg ValidateBasic (cosmos#1792)

* remove previous channel id from NewMsgChanOpenTry, assert previous channel id to be empty

* add changelog entry

* move changelog entry to correct location

* add migration docs

* Update docs/migrations/v3-to-v4.md

Co-authored-by: Carlos Rodriguez <[email protected]>

* Update CHANGELOG.md

Co-authored-by: Carlos Rodriguez <[email protected]>

Co-authored-by: Carlos Rodriguez <[email protected]>
(cherry picked from commit 4a781e5)

# Conflicts:
#	CHANGELOG.md

* fix conflicts

Co-authored-by: colin axnér <[email protected]>
Co-authored-by: Carlos Rodriguez <[email protected]>
ulbqb pushed a commit to ulbqb/ibc-go that referenced this pull request Jul 31, 2023
…(backport cosmos#1792) (cosmos#1827)

* fix: assert previous channel identifer is empty in Msg ValidateBasic (cosmos#1792)

* remove previous channel id from NewMsgChanOpenTry, assert previous channel id to be empty

* add changelog entry

* move changelog entry to correct location

* add migration docs

* Update docs/migrations/v3-to-v4.md

Co-authored-by: Carlos Rodriguez <[email protected]>

* Update CHANGELOG.md

Co-authored-by: Carlos Rodriguez <[email protected]>

Co-authored-by: Carlos Rodriguez <[email protected]>
(cherry picked from commit 4a781e5)

# Conflicts:
#	CHANGELOG.md

* fix conflicts

Co-authored-by: colin axnér <[email protected]>
Co-authored-by: Carlos Rodriguez <[email protected]>
ulbqb pushed a commit to ulbqb/ibc-go that referenced this pull request Jul 31, 2023
…(backport cosmos#1792) (cosmos#1827)

* fix: assert previous channel identifer is empty in Msg ValidateBasic (cosmos#1792)

* remove previous channel id from NewMsgChanOpenTry, assert previous channel id to be empty

* add changelog entry

* move changelog entry to correct location

* add migration docs

* Update docs/migrations/v3-to-v4.md

Co-authored-by: Carlos Rodriguez <[email protected]>

* Update CHANGELOG.md

Co-authored-by: Carlos Rodriguez <[email protected]>

Co-authored-by: Carlos Rodriguez <[email protected]>
(cherry picked from commit 4a781e5)

# Conflicts:
#	CHANGELOG.md

* fix conflicts

Co-authored-by: colin axnér <[email protected]>
Co-authored-by: Carlos Rodriguez <[email protected]>
@ulbqb ulbqb mentioned this pull request Jul 31, 2023
9 tasks
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.

Remove leftover code from 04-channel handshake crossing hellos
4 participants