-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Emit header in MsgUpdateClient events #8624
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
47d6a77
emit header in update client msg
colin-axner 600e954
update CHANGELOG
colin-axner 3d824ff
update spec
colin-axner 5c82a98
Merge branch 'master' into colin/8598-update-header-event
ccea83b
fix nil header bug
colin-axner 8ce1f53
Merge branch 'colin/8598-update-header-event' of github.com:cosmos/co…
colin-axner 1ea4081
use JSON encoding for emitting header
colin-axner 401abdc
Update x/ibc/core/spec/06_events.md
fedekunze 0052d40
use proto for encoding
colin-axner 046ae44
add tests
colin-axner 1462ce6
Merge branch 'colin/8598-update-header-event' of github.com:cosmos/co…
colin-axner a08b336
fix changelog merge conflict
colin-axner df9dbfa
merge master
colin-axner 732431c
Merge branch 'master' into colin/8598-update-header-event
colin-axner 3f4773e
encode to hex before emitting header in event
colin-axner 9ffcbe9
Merge branch 'colin/8598-update-header-event' of github.com:cosmos/co…
colin-axner cb28f10
add comment addressing reasoning for hex encoding
colin-axner cde3dad
Merge branch 'master' into colin/8598-update-header-event
colin-axner d639449
Merge branch 'master' into colin/8598-update-header-event
colin-axner 75ee333
Merge branch 'master' into colin/8598-update-header-event
colin-axner bcaab1a
Merge branch 'master' into colin/8598-update-header-event
colin-axner 1165dad
Update CHANGELOG.md
colin-axner 6cad885
Merge branch 'master' into colin/8598-update-header-event
colin-axner 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package types_test | ||
|
||
import ( | ||
"github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" | ||
ibctmtypes "github.com/cosmos/cosmos-sdk/x/ibc/light-clients/07-tendermint/types" | ||
) | ||
|
||
func (suite *TypesTestSuite) TestMarshalHeader() { | ||
|
||
cdc := suite.chainA.App.AppCodec() | ||
h := &ibctmtypes.Header{ | ||
TrustedHeight: types.NewHeight(4, 100), | ||
} | ||
|
||
// marshal header | ||
bz, err := types.MarshalHeader(cdc, h) | ||
suite.Require().NoError(err) | ||
|
||
// unmarshal header | ||
newHeader, err := types.UnmarshalHeader(cdc, bz) | ||
suite.Require().NoError(err) | ||
|
||
suite.Require().Equal(h, newHeader) | ||
|
||
// use invalid bytes | ||
invalidHeader, err := types.UnmarshalHeader(cdc, []byte("invalid bytes")) | ||
suite.Require().Error(err) | ||
suite.Require().Nil(invalidHeader) | ||
|
||
} |
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.
this will emit an empty event value if the header is
nil
, is that expected?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.
Yes, the header is only nil for the
localhost
client (which currently doesn't work). I cannot imagine a non-localhost client ever using a nil header. Nil headers should be disallowed following the refactor of the localhost client. I think emitting an empty event value is ok in the short term