Ensure unpacking of connection interfaces in msgs (#7252)
This commit is contained in:
parent
221a28f876
commit
2539f6e488
@ -1,6 +1,7 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
||||
clienttypes "github.com/cosmos/cosmos-sdk/x/ibc/02-client/types"
|
||||
@ -144,6 +145,17 @@ func (msg MsgConnectionOpenTry) ValidateBasic() error {
|
||||
return msg.Counterparty.ValidateBasic()
|
||||
}
|
||||
|
||||
// UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces
|
||||
func (msg MsgConnectionOpenTry) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error {
|
||||
var clientState exported.ClientState
|
||||
err := unpacker.UnpackAny(msg.ClientState, &clientState)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetSignBytes implements sdk.Msg
|
||||
func (msg MsgConnectionOpenTry) GetSignBytes() []byte {
|
||||
return sdk.MustSortJSON(SubModuleCdc.MustMarshalJSON(&msg))
|
||||
@ -177,6 +189,17 @@ func NewMsgConnectionOpenAck(
|
||||
}
|
||||
}
|
||||
|
||||
// UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces
|
||||
func (msg MsgConnectionOpenAck) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error {
|
||||
var clientState exported.ClientState
|
||||
err := unpacker.UnpackAny(msg.ClientState, &clientState)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Route implements sdk.Msg
|
||||
func (msg MsgConnectionOpenAck) Route() string {
|
||||
return host.RouterKey
|
||||
|
||||
Loading…
Reference in New Issue
Block a user