diff --git a/x/ibc/02-client/handler.go b/x/ibc/02-client/handler.go index 8a9fe5883..398f59766 100644 --- a/x/ibc/02-client/handler.go +++ b/x/ibc/02-client/handler.go @@ -25,9 +25,9 @@ func HandleMsgCreateClient(ctx sdk.Context, k keeper.Keeper, msg exported.MsgCre switch clientType { case exported.Tendermint: - tmMsg, ok := msg.(ibctmtypes.MsgCreateClient) + tmMsg, ok := msg.(*ibctmtypes.MsgCreateClient) if !ok { - return nil, sdkerrors.Wrapf(types.ErrInvalidClientType, "got %T, expected %T", msg, ibctmtypes.MsgCreateClient{}) + return nil, sdkerrors.Wrapf(types.ErrInvalidClientType, "got %T, expected %T", msg, &ibctmtypes.MsgCreateClient{}) } var err error diff --git a/x/ibc/07-tendermint/types/client_state.go b/x/ibc/07-tendermint/types/client_state.go index a9d0e2721..df4c58eb8 100644 --- a/x/ibc/07-tendermint/types/client_state.go +++ b/x/ibc/07-tendermint/types/client_state.go @@ -52,7 +52,7 @@ type ClientState struct { } // InitializeFromMsg creates a tendermint client state from a CreateClientMsg -func InitializeFromMsg(msg MsgCreateClient) (ClientState, error) { +func InitializeFromMsg(msg *MsgCreateClient) (ClientState, error) { return Initialize( msg.GetClientID(), msg.TrustLevel, msg.TrustingPeriod, msg.UnbondingPeriod, msg.MaxClockDrift, diff --git a/x/ibc/07-tendermint/types/msgs.go b/x/ibc/07-tendermint/types/msgs.go index 6cc16c234..1e5f175b7 100644 --- a/x/ibc/07-tendermint/types/msgs.go +++ b/x/ibc/07-tendermint/types/msgs.go @@ -45,18 +45,18 @@ type MsgCreateClient struct { const TODO = "TODO" // dummy implementation of proto.Message -func (msg MsgCreateClient) Reset() {} -func (msg MsgCreateClient) String() string { return TODO } -func (msg MsgCreateClient) ProtoMessage() {} +func (msg *MsgCreateClient) Reset() {} +func (msg *MsgCreateClient) String() string { return TODO } +func (msg *MsgCreateClient) ProtoMessage() {} // NewMsgCreateClient creates a new MsgCreateClient instance func NewMsgCreateClient( id string, header Header, trustLevel tmmath.Fraction, trustingPeriod, unbondingPeriod, maxClockDrift time.Duration, specs []*ics23.ProofSpec, signer sdk.AccAddress, -) MsgCreateClient { +) *MsgCreateClient { - return MsgCreateClient{ + return &MsgCreateClient{ ClientID: id, Header: header, TrustLevel: trustLevel, @@ -157,13 +157,13 @@ type MsgUpdateClient struct { } // dummy implementation of proto.Message -func (msg MsgUpdateClient) Reset() {} -func (msg MsgUpdateClient) String() string { return TODO } -func (msg MsgUpdateClient) ProtoMessage() {} +func (msg *MsgUpdateClient) Reset() {} +func (msg *MsgUpdateClient) String() string { return TODO } +func (msg *MsgUpdateClient) ProtoMessage() {} // NewMsgUpdateClient creates a new MsgUpdateClient instance -func NewMsgUpdateClient(id string, header Header, signer sdk.AccAddress) MsgUpdateClient { - return MsgUpdateClient{ +func NewMsgUpdateClient(id string, header Header, signer sdk.AccAddress) *MsgUpdateClient { + return &MsgUpdateClient{ ClientID: id, Header: header, Signer: signer, diff --git a/x/ibc/07-tendermint/types/msgs_test.go b/x/ibc/07-tendermint/types/msgs_test.go index 686dbfc2c..ddf20d9fe 100644 --- a/x/ibc/07-tendermint/types/msgs_test.go +++ b/x/ibc/07-tendermint/types/msgs_test.go @@ -20,7 +20,7 @@ func (suite *TendermintTestSuite) TestMsgCreateClientValidateBasic() { invalidHeader.ValidatorSet = nil cases := []struct { - msg ibctmtypes.MsgCreateClient + msg *ibctmtypes.MsgCreateClient expPass bool errMsg string }{ @@ -52,7 +52,7 @@ func (suite *TendermintTestSuite) TestMsgUpdateClient() { signer := sdk.AccAddress(privKey.PubKey().Address()) cases := []struct { - msg ibctmtypes.MsgUpdateClient + msg *ibctmtypes.MsgUpdateClient expPass bool errMsg string }{