-
Notifications
You must be signed in to change notification settings - Fork 616
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 revision number tests for 07-tendermint #1302
Conversation
adds UpgradeChain which manually upgrades the chainID to the next revision adds test cases for VerifyClientMessage in relation to a changing revision number
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wunderschön!
Going to adjust the handling of revision misbehaviour. Revert to old assumption:
In light of #1308 and #1309, this will be safe since arbitrary changing of the chainID will not be supported. If a chain wants to go from a non-revision number chainID to a revision number chainID, they must start at |
see comment
|
…o into colin/1184-revisionid-tests
Addresses #1331 Needed to fix a lot of tests to handle the new chain ID using a revision number of 0. Removed some of the hard coding and left other parts |
true, | ||
}, | ||
{ | ||
"valid misbehaviour with trusted heights at a previous revision", func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work on these tests!
|
||
// update counterparty client manually | ||
clientState.ChainId = newChainID | ||
clientState.LatestHeight = clienttypes.NewHeight(revisionNumber+1, clientState.LatestHeight.GetRevisionHeight()+1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we be resetting revision height here to prove that resetting height still works
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too difficult right now. Would require resetting the SimApp
such that it uses a zero height rather than incrementing its existing height
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Just a nit on the test comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, lgtm!
testing/endpoint.go
Outdated
// and upgrading the client via MsgUpgradeClient | ||
// see reference https://github.com/cosmos/ibc-go/pull/1169 | ||
func (endpoint *Endpoint) UpgradeChain() error { | ||
if endpoint.Counterparty.ClientID == "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Should we use strings.TrimSpace()
here?
Co-authored-by: Aditya <adityasripal@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
amazing work
* add revision tests for VerifyClientMessage adds UpgradeChain which manually upgrades the chainID to the next revision adds test cases for VerifyClientMessage in relation to a changing revision number * fix revision tests * update revision tests, use revision format as default in testing * remove hard coding from upgrade tests * fix misbehaviour handle tests * add changelog entry * fix client state tests * disable updates to previous revisions * fix hard coded tests * add test case for unsuccessful update to previous revision * Update modules/light-clients/07-tendermint/types/update_test.go Co-authored-by: Aditya <adityasripal@gmail.com> * add strings trim space * add tests for non revision chainIDs Co-authored-by: Aditya <adityasripal@gmail.com>
Description
closes: #1184
closes: #1331
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.
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerCodecov Report
in the comment section below once CI passes