From e647a2c96a5795059a44ff5de360e14dc5a5a815 Mon Sep 17 00:00:00 2001 From: nguyen <144610611+trinitys7@users.noreply.github.com> Date: Wed, 20 Sep 2023 14:51:05 +0700 Subject: [PATCH] chore: add HasValidateBasic compiler assertions to msgs (#4724) * chore: add HasValidateBasic compiler assertions to msgs * linting --------- Co-authored-by: Jim Fasarakis-Hilliard --- .../27-interchain-accounts/controller/types/msgs.go | 4 ++++ .../apps/27-interchain-accounts/host/types/msgs.go | 5 ++++- modules/apps/29-fee/types/msgs.go | 5 +++++ modules/apps/transfer/types/msgs.go | 6 ++++-- modules/core/02-client/types/msgs.go | 8 ++++++++ modules/core/03-connection/types/msgs.go | 6 ++++++ modules/core/04-channel/types/msgs.go | 11 +++++++++++ 7 files changed, 42 insertions(+), 3 deletions(-) diff --git a/modules/apps/27-interchain-accounts/controller/types/msgs.go b/modules/apps/27-interchain-accounts/controller/types/msgs.go index 254173b8431..b600942bf01 100644 --- a/modules/apps/27-interchain-accounts/controller/types/msgs.go +++ b/modules/apps/27-interchain-accounts/controller/types/msgs.go @@ -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 diff --git a/modules/apps/27-interchain-accounts/host/types/msgs.go b/modules/apps/27-interchain-accounts/host/types/msgs.go index 49da2a09469..845139a4a34 100644 --- a/modules/apps/27-interchain-accounts/host/types/msgs.go +++ b/modules/apps/27-interchain-accounts/host/types/msgs.go @@ -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 { diff --git a/modules/apps/29-fee/types/msgs.go b/modules/apps/29-fee/types/msgs.go index 665b6a5ccc0..095d36a604d 100644 --- a/modules/apps/29-fee/types/msgs.go +++ b/modules/apps/29-fee/types/msgs.go @@ -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 diff --git a/modules/apps/transfer/types/msgs.go b/modules/apps/transfer/types/msgs.go index 0cfa61f1bba..33915637017 100644 --- a/modules/apps/transfer/types/msgs.go +++ b/modules/apps/transfer/types/msgs.go @@ -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 diff --git a/modules/core/02-client/types/msgs.go b/modules/core/02-client/types/msgs.go index b0d4528bd87..1eb5472ca87 100644 --- a/modules/core/02-client/types/msgs.go +++ b/modules/core/02-client/types/msgs.go @@ -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) diff --git a/modules/core/03-connection/types/msgs.go b/modules/core/03-connection/types/msgs.go index 01233a20cf3..c46c783767e 100644 --- a/modules/core/03-connection/types/msgs.go +++ b/modules/core/03-connection/types/msgs.go @@ -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) ) diff --git a/modules/core/04-channel/types/msgs.go b/modules/core/04-channel/types/msgs.go index fed5f4123b2..812829307c0 100644 --- a/modules/core/04-channel/types/msgs.go +++ b/modules/core/04-channel/types/msgs.go @@ -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