Skip to content

Commit

Permalink
chore: add HasValidateBasic compiler assertions to msgs (cosmos#4724)
Browse files Browse the repository at this point in the history
* chore: add HasValidateBasic compiler assertions to msgs

* linting

---------

Co-authored-by: Jim Fasarakis-Hilliard <d.f.hilliard@gmail.com>
  • Loading branch information
trinitys7 and DimitrisJim authored Sep 20, 2023
1 parent 83a1994 commit e647a2c
Showing 7 changed files with 42 additions and 3 deletions.
4 changes: 4 additions & 0 deletions modules/apps/27-interchain-accounts/controller/types/msgs.go
Original file line number Diff line number Diff line change
@@ -16,6 +16,10 @@ var (
_ sdk.Msg = (*MsgRegisterInterchainAccount)(nil)
_ sdk.Msg = (*MsgSendTx)(nil)
_ sdk.Msg = (*MsgUpdateParams)(nil)

_ sdk.HasValidateBasic = (*MsgRegisterInterchainAccount)(nil)
_ sdk.HasValidateBasic = (*MsgSendTx)(nil)
_ sdk.HasValidateBasic = (*MsgUpdateParams)(nil)
)

// NewMsgRegisterInterchainAccount creates a new instance of MsgRegisterInterchainAccount
5 changes: 4 additions & 1 deletion modules/apps/27-interchain-accounts/host/types/msgs.go
Original file line number Diff line number Diff line change
@@ -8,7 +8,10 @@ import (
ibcerrors "github.com/cosmos/ibc-go/v8/modules/core/errors"
)

var _ sdk.Msg = (*MsgUpdateParams)(nil)
var (
_ sdk.Msg = (*MsgUpdateParams)(nil)
_ sdk.HasValidateBasic = (*MsgUpdateParams)(nil)
)

// NewMsgUpdateParams creates a new MsgUpdateParams instance
func NewMsgUpdateParams(signer string, params Params) *MsgUpdateParams {
5 changes: 5 additions & 0 deletions modules/apps/29-fee/types/msgs.go
Original file line number Diff line number Diff line change
@@ -17,6 +17,11 @@ var (
_ sdk.Msg = (*MsgRegisterCounterpartyPayee)(nil)
_ sdk.Msg = (*MsgPayPacketFee)(nil)
_ sdk.Msg = (*MsgPayPacketFeeAsync)(nil)

_ sdk.HasValidateBasic = (*MsgRegisterPayee)(nil)
_ sdk.HasValidateBasic = (*MsgRegisterCounterpartyPayee)(nil)
_ sdk.HasValidateBasic = (*MsgPayPacketFee)(nil)
_ sdk.HasValidateBasic = (*MsgPayPacketFeeAsync)(nil)
)

// NewMsgRegisterPayee creates a new instance of MsgRegisterPayee
6 changes: 4 additions & 2 deletions modules/apps/transfer/types/msgs.go
Original file line number Diff line number Diff line change
@@ -13,8 +13,10 @@ import (
)

var (
_ sdk.Msg = (*MsgUpdateParams)(nil)
_ sdk.Msg = (*MsgTransfer)(nil)
_ sdk.Msg = (*MsgUpdateParams)(nil)
_ sdk.Msg = (*MsgTransfer)(nil)
_ sdk.HasValidateBasic = (*MsgUpdateParams)(nil)
_ sdk.HasValidateBasic = (*MsgTransfer)(nil)
)

// NewMsgUpdateParams creates a new MsgUpdateParams instance
8 changes: 8 additions & 0 deletions modules/core/02-client/types/msgs.go
Original file line number Diff line number Diff line change
@@ -21,6 +21,14 @@ var (
_ sdk.Msg = (*MsgIBCSoftwareUpgrade)(nil)
_ sdk.Msg = (*MsgRecoverClient)(nil)

_ sdk.HasValidateBasic = (*MsgCreateClient)(nil)
_ sdk.HasValidateBasic = (*MsgUpdateClient)(nil)
_ sdk.HasValidateBasic = (*MsgSubmitMisbehaviour)(nil)
_ sdk.HasValidateBasic = (*MsgUpgradeClient)(nil)
_ sdk.HasValidateBasic = (*MsgUpdateParams)(nil)
_ sdk.HasValidateBasic = (*MsgIBCSoftwareUpgrade)(nil)
_ sdk.HasValidateBasic = (*MsgRecoverClient)(nil)

_ codectypes.UnpackInterfacesMessage = (*MsgCreateClient)(nil)
_ codectypes.UnpackInterfacesMessage = (*MsgUpdateClient)(nil)
_ codectypes.UnpackInterfacesMessage = (*MsgSubmitMisbehaviour)(nil)
6 changes: 6 additions & 0 deletions modules/core/03-connection/types/msgs.go
Original file line number Diff line number Diff line change
@@ -20,6 +20,12 @@ var (
_ sdk.Msg = (*MsgConnectionOpenTry)(nil)
_ sdk.Msg = (*MsgUpdateParams)(nil)

_ sdk.HasValidateBasic = (*MsgConnectionOpenInit)(nil)
_ sdk.HasValidateBasic = (*MsgConnectionOpenConfirm)(nil)
_ sdk.HasValidateBasic = (*MsgConnectionOpenAck)(nil)
_ sdk.HasValidateBasic = (*MsgConnectionOpenTry)(nil)
_ sdk.HasValidateBasic = (*MsgUpdateParams)(nil)

_ codectypes.UnpackInterfacesMessage = (*MsgConnectionOpenTry)(nil)
_ codectypes.UnpackInterfacesMessage = (*MsgConnectionOpenAck)(nil)
)
11 changes: 11 additions & 0 deletions modules/core/04-channel/types/msgs.go
Original file line number Diff line number Diff line change
@@ -24,6 +24,17 @@ var (
_ sdk.Msg = (*MsgAcknowledgement)(nil)
_ sdk.Msg = (*MsgTimeout)(nil)
_ sdk.Msg = (*MsgTimeoutOnClose)(nil)

_ sdk.HasValidateBasic = (*MsgChannelOpenInit)(nil)
_ sdk.HasValidateBasic = (*MsgChannelOpenTry)(nil)
_ sdk.HasValidateBasic = (*MsgChannelOpenAck)(nil)
_ sdk.HasValidateBasic = (*MsgChannelOpenConfirm)(nil)
_ sdk.HasValidateBasic = (*MsgChannelCloseInit)(nil)
_ sdk.HasValidateBasic = (*MsgChannelCloseConfirm)(nil)
_ sdk.HasValidateBasic = (*MsgRecvPacket)(nil)
_ sdk.HasValidateBasic = (*MsgAcknowledgement)(nil)
_ sdk.HasValidateBasic = (*MsgTimeout)(nil)
_ sdk.HasValidateBasic = (*MsgTimeoutOnClose)(nil)
)

// NewMsgChannelOpenInit creates a new MsgChannelOpenInit. It sets the counterparty channel

0 comments on commit e647a2c

Please sign in to comment.