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

Re-add polkadot/hyperspace support and update TestHyperspace for ibc-go wasm light client changes #747

Merged
merged 12 commits into from
Sep 14, 2023
Merged
17 changes: 17 additions & 0 deletions chain/cosmos/08-wasm-types/client_message.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package types

import (
"github.com/cosmos/ibc-go/v7/modules/core/exported"
)

var _ exported.ClientMessage = &ClientMessage{}

// ClientType is a Wasm light client.
func (c ClientMessage) ClientType() string {
return "08-wasm"
}

// ValidateBasic defines a basic validation for the wasm client message.
func (c ClientMessage) ValidateBasic() error {
return nil
}
2 changes: 1 addition & 1 deletion chain/cosmos/08-wasm-types/client_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func (c ClientState) VerifyUpgradeAndUpdateState(
func NewClientState(latestSequence uint64, consensusState *ConsensusState) *ClientState {
return &ClientState{
Data: []byte{0},
CodeId: []byte{},
CodeHash: []byte{},
LatestHeight: clienttypes.Height{},
}
}
14 changes: 7 additions & 7 deletions chain/cosmos/08-wasm-types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package types
import (
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/msgservice"

"github.com/cosmos/ibc-go/v7/modules/core/exported"
)

Expand All @@ -17,16 +19,14 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) {
(*exported.ConsensusState)(nil),
&ConsensusState{},
)
registry.RegisterImplementations(
(*sdk.Msg)(nil),
&MsgStoreCode{},
)
registry.RegisterImplementations(
(*exported.ClientMessage)(nil),
&Misbehaviour{},
&ClientMessage{},
)
registry.RegisterImplementations(
(*exported.ClientMessage)(nil),
&Header{},
(*sdk.Msg)(nil),
&MsgStoreCode{},
)

msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
}
2 changes: 1 addition & 1 deletion chain/cosmos/08-wasm-types/consensus_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ func (m ConsensusState) ClientType() string {
}

func (m ConsensusState) GetTimestamp() uint64 {
return m.Timestamp
return 0
}

func (m ConsensusState) ValidateBasic() error {
Expand Down
15 changes: 0 additions & 15 deletions chain/cosmos/08-wasm-types/header.go

This file was deleted.

17 changes: 0 additions & 17 deletions chain/cosmos/08-wasm-types/misbehavior.go

This file was deleted.

16 changes: 13 additions & 3 deletions chain/cosmos/08-wasm-types/msgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,24 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
)

var (
_ sdk.Msg = &MsgStoreCode{}
)
var _ sdk.Msg = (*MsgStoreCode)(nil)

// MsgStoreCode creates a new MsgStoreCode instance
//
//nolint:interfacer
func NewMsgStoreCode(signer string, code []byte) *MsgStoreCode {
return &MsgStoreCode{
Signer: signer,
WasmByteCode: code,
}
}

// ValidateBasic implements sdk.Msg
func (m MsgStoreCode) ValidateBasic() error {
return nil
}

// GetSigners implements sdk.Msg
func (m MsgStoreCode) GetSigners() []sdk.AccAddress {
signer, err := sdk.AccAddressFromBech32(m.Signer)
if err != nil {
Expand Down
84 changes: 45 additions & 39 deletions chain/cosmos/08-wasm-types/tx.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading