* clear

* feat: Add everything

* fix: Commenht
This commit is contained in:
Prad Nukala
2025-10-03 14:45:52 -04:00
committed by GitHub
parent 43b4a11c06
commit 13e6c3e84d
1935 changed files with 655061 additions and 40058 deletions
+5 -41
View File
@@ -4,59 +4,23 @@ import (
"github.com/spf13/cobra"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/client/tx"
"github.com/sonr-io/snrd/x/dwn/types"
"github.com/sonr-io/sonr/x/dwn/types"
)
// !NOTE: Must enable in module.go (disabled in favor of autocli.go)
// NewTxCmd returns a root CLI command handler for certain modules
// transaction commands.
// NewTxCmd returns the root transaction command for the DWN module
func NewTxCmd() *cobra.Command {
txCmd := &cobra.Command{
Use: types.ModuleName,
Short: types.ModuleName + " subcommands.",
Short: "Transaction commands for " + types.ModuleName,
DisableFlagParsing: true,
SuggestionsMinimumDistance: 2,
RunE: client.ValidateCmd,
}
txCmd.AddCommand(
MsgUpdateParams(),
GetWalletTxCommands(),
)
return txCmd
}
// Returns a CLI command handler for registering a
// contract for the module.
func MsgUpdateParams() *cobra.Command {
cmd := &cobra.Command{
Use: "update-params [some-value]",
Short: "Update the params (must be submitted from the authority)",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
cliCtx, err := client.GetClientTxContext(cmd)
if err != nil {
return err
}
senderAddress := cliCtx.GetFromAddress()
msg := &types.MsgUpdateParams{
Authority: senderAddress.String(),
Params: types.Params{},
}
if err := msg.Validate(); err != nil {
return err
}
return tx.GenerateOrBroadcastTxCLI(cliCtx, cmd.Flags(), msg)
},
}
flags.AddTxFlagsToCmd(cmd)
return cmd
}