-
Notifications
You must be signed in to change notification settings - Fork 579
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
chore: move solomachine CheckForMisbehaviour to misbehaviour_handle.go
#2802
Merged
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
3ba5a45
mv fn
charleenfei a7ab28d
mv fn
charleenfei 6d3a9a9
Merge branch 'main' into charly/2006_solomachine
charleenfei 02071d9
Merge branch 'main' into charly/2006_solomachine
charleenfei 56854ff
Merge branch 'charly/2006_solomachine' of github.com:cosmos/ibc-go in…
charleenfei File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I think this can go above CheckForMisbehaviour, it will be called first in
verifyClientMessage
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.
i checked golang conventions and most commenters seemed to suggest having public functions before private functions, as this provides an understanding of the interface for people perusing the file. but i am not strongly opinionated here, so if you prefer to go with this type of reasoning for the ordering of the functions then I am happy to update the PR.
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.
My reasoning is that
verifyMisbehaviour
derives fromVerifyClientMessage
which is public. It is expected that calls toVerifyClientMessage
,CheckForMisbehaviour
,UpdateState
,UpdateStateOnMisbehaviour
are performed together. Thus when I look through light client code, I would expect to reviewverifyMisbehaviour
beforeCheckForMisbehaviour
because logically the first is required to be correct/called for the second to make sense. I'm not sure the go conventions make sense in this situation since I do not expect nor suggest non-core IBC applications to call these public functions. I don't have strong preference. Happy to let y'all decide, it can always be changed at any time in the future