From 71708de9166408972913e6659160e194c476821e Mon Sep 17 00:00:00 2001 From: Dang Date: Mon, 16 Dec 2024 13:38:53 +0700 Subject: [PATCH] cli --- x/wasm/client/cli/gov_tx.go | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/x/wasm/client/cli/gov_tx.go b/x/wasm/client/cli/gov_tx.go index 4c8864a176..e07f4fd0a9 100644 --- a/x/wasm/client/cli/gov_tx.go +++ b/x/wasm/client/cli/gov_tx.go @@ -53,6 +53,8 @@ func SubmitProposalCmd() *cobra.Command { ProposalAddCodeUploadParamsAddresses(), ProposalRemoveCodeUploadParamsAddresses(), ProposalStoreAndMigrateContractCmd(), + ProposalSetGaslessContractsCmd(), + ProposalUnsetGaslessContractsCmd(), ) return cmd } @@ -719,10 +721,17 @@ func ProposalSetGaslessContractsCmd() *cobra.Command { return err } - msg := types.SetGasLessContractsProposal{ - Title: proposalTitle, - Description: summary, - ContractAddresses: args, + authority, err := cmd.Flags().GetString(flagAuthority) + if err != nil { + return fmt.Errorf("authority: %s", err) + } + + if len(authority) == 0 { + return errors.New("authority address is required") + } + + msg := types.MsgSetGaslessContracts{ + Contracts: args, } if err = msg.ValidateBasic(); err != nil { return err @@ -753,10 +762,17 @@ func ProposalUnsetGaslessContractsCmd() *cobra.Command { return err } - msg := types.UnsetGasLessContractsProposal{ - Title: proposalTitle, - Description: summary, - ContractAddresses: args, + authority, err := cmd.Flags().GetString(flagAuthority) + if err != nil { + return fmt.Errorf("authority: %s", err) + } + + if len(authority) == 0 { + return errors.New("authority address is required") + } + + msg := types.MsgUnsetGaslessContracts{ + Contracts: args, } if err = msg.ValidateBasic(); err != nil { return err