Skip to content

Commit

Permalink
ibc: add proto message to Header and Misbehaviour (#8278)
Browse files Browse the repository at this point in the history
* add proto message to Header and Misbehaviour

* format
  • Loading branch information
colin-axner authored Jan 7, 2021
1 parent c840261 commit 7d6345a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
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

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

0 comments on commit 7d6345a

Please sign in to comment.