mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-02 17:31:39 +00:00
feature/1149 vault allocation error (#1173)
- **refactor: update devbox configuration and scripts** - **refactor: remove web documentation** - **refactor: move resolver formatter to services package** - **refactor: Rename x/vault -> x/dwn and x/service -> x/svc** - **refactor: remove unused dependencies and simplify module imports** - **refactor: remove dependency on DWN.pkl** - **refactor: Move IPFS interaction functions to common package** - **refactor: remove unused TUI components** - **feat: add gum package and update devbox configuration** - **refactor: rename Assertion to Account and update related code** - **fix: resolve rendering issue in login modal** - **refactor: migrate build system from Taskfile to Makefile** - **refactor: Deployment setup** - **refactor: Update Credential table to match WebAuthn Credential Descriptor** - **feat: add fast reflection methods for Capability and Resource** - **fix: update devbox lockfile** - **feat: add support for parent field and resources list in Capability message** - **feature/1149-vault-allocation-error** - **fix: adjust fullscreen modal close button margin**
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
package cli
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
|
||||
"github.com/onsonr/sonr/x/dwn/types"
|
||||
)
|
||||
|
||||
// !NOTE: Must enable in module.go (disabled in favor of autocli.go)
|
||||
|
||||
func GetQueryCmd() *cobra.Command {
|
||||
queryCmd := &cobra.Command{
|
||||
Use: types.ModuleName,
|
||||
Short: "Querying commands for " + types.ModuleName,
|
||||
DisableFlagParsing: true,
|
||||
SuggestionsMinimumDistance: 2,
|
||||
RunE: client.ValidateCmd,
|
||||
}
|
||||
queryCmd.AddCommand(
|
||||
GetCmdParams(),
|
||||
)
|
||||
return queryCmd
|
||||
}
|
||||
|
||||
func GetCmdParams() *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "params",
|
||||
Short: "Show all module params",
|
||||
Args: cobra.ExactArgs(0),
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
clientCtx, err := client.GetClientQueryContext(cmd)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
queryClient := types.NewQueryClient(clientCtx)
|
||||
res, err := queryClient.Params(cmd.Context(), &types.QueryParamsRequest{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return clientCtx.PrintProto(res)
|
||||
},
|
||||
}
|
||||
flags.AddQueryFlagsToCmd(cmd)
|
||||
return cmd
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package cli
|
||||
|
||||
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/onsonr/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.
|
||||
func NewTxCmd() *cobra.Command {
|
||||
txCmd := &cobra.Command{
|
||||
Use: types.ModuleName,
|
||||
Short: types.ModuleName + " subcommands.",
|
||||
DisableFlagParsing: true,
|
||||
SuggestionsMinimumDistance: 2,
|
||||
RunE: client.ValidateCmd,
|
||||
}
|
||||
|
||||
txCmd.AddCommand(
|
||||
MsgUpdateParams(),
|
||||
)
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user