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

ibc: add proto message to Header and Misbehaviour #8278

Merged
merged 2 commits into from
Jan 7, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
add proto message to Header and Misbehaviour
  • Loading branch information
colin-axner committed Jan 7, 2021
commit e13e6034f3d62aa8408486cb0f7cab104edf6924
4 changes: 4 additions & 0 deletions x/ibc/core/exported/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ type ConsensusState interface {

// Misbehaviour defines counterparty misbehaviour for a specific consensus type
type Misbehaviour interface {
proto.Message
fedekunze marked this conversation as resolved.
Show resolved Hide resolved

ClientType() string
GetClientID() string
ValidateBasic() error
Expand All @@ -188,6 +190,8 @@ type Misbehaviour interface {

// Header is the consensus state update information
type Header interface {
proto.Message

ClientType() string
GetHeight() Height
ValidateBasic() error
Expand Down
2 changes: 1 addition & 1 deletion x/ibc/light-clients/06-solomachine/types/header.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/cosmos/cosmos-sdk/x/ibc/core/exported"
)

var _ exported.Header = Header{}
var _ exported.Header = &Header{}

// ClientType defines that the Header is a Solo Machine.
func (Header) ClientType() string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (suite *SoloMachineTestSuite) TestCheckMisbehaviourAndUpdateState() {
"invalid misbehaviour type",
func() {
clientState = solomachine.ClientState()
misbehaviour = ibctmtypes.Misbehaviour{}
misbehaviour = &ibctmtypes.Misbehaviour{}
},
false,
},
Expand Down
2 changes: 1 addition & 1 deletion x/ibc/light-clients/07-tendermint/types/header.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/cosmos/cosmos-sdk/x/ibc/core/exported"
)

var _ exported.Header = Header{}
var _ exported.Header = &Header{}

// ConsensusState returns the updated consensus state associated with the header
func (h Header) ConsensusState() *ConsensusState {
Expand Down
4 changes: 1 addition & 3 deletions x/ibc/light-clients/07-tendermint/types/misbehaviour.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ import (
"github.com/cosmos/cosmos-sdk/x/ibc/core/exported"
)

var (
_ exported.Misbehaviour = Misbehaviour{}
)
var _ exported.Misbehaviour = &Misbehaviour{}

// NewMisbehaviour creates a new Misbehaviour instance.
func NewMisbehaviour(clientID string, header1, header2 *Header) *Misbehaviour {
Expand Down