feat(client/v2): support gov proposals (#18461)
This commit is contained in:
parent
4ee4046d69
commit
9c3386ffd2
@ -47,7 +47,7 @@ func ValidatePromptAddress(input string) error { // TODO(@julienrbrt) remove and
|
||||
return fmt.Errorf("invalid address: %w", err)
|
||||
}
|
||||
|
||||
// ValidatePromptYesNo validates that the input is valid sdk.COins
|
||||
// ValidatePromptCoins validates that the input contains valid sdk.Coins
|
||||
func ValidatePromptCoins(input string) error {
|
||||
if _, err := sdk.ParseCoinsNormalized(input); err != nil {
|
||||
return fmt.Errorf("invalid coins: %w", err)
|
||||
|
||||
@ -38,6 +38,10 @@ Ref: https://keepachangelog.com/en/1.0.0/
|
||||
|
||||
<!-- ## [v2.1.0-beta.1] to be tagged after v0.51 final or in SDK agnostic version -->
|
||||
|
||||
### Features
|
||||
|
||||
* [#18461](https://github.com/cosmos/cosmos-sdk/pull/18461) Support governance proposals.
|
||||
|
||||
### API Breaking Changes
|
||||
|
||||
* [#17709](https://github.com/cosmos/cosmos-sdk/pull/17709) Address codecs have been removed from `autocli.AppOptions` and `flag.Builder`. Instead client/v2 uses the address codecs present in the context (introduced in [#17503](https://github.com/cosmos/cosmos-sdk/pull/17503)).
|
||||
|
||||
@ -121,7 +121,7 @@ This field is automatically filled when using the `--from` flag or defining the
|
||||
AutoCLI currently supports only one signer per transaction.
|
||||
:::
|
||||
|
||||
## Module Wiring & Customization
|
||||
## Module wiring & Customization
|
||||
|
||||
The `AutoCLIOptions()` method on your module allows to specify custom commands, sub-commands or flags for each service, as it was a `cobra.Command` instance, within the `RpcCommandOptions` struct. Defining such options will customize the behavior of the `autocli` command generation, which by default generates a command for each method in your gRPC service.
|
||||
|
||||
@ -137,6 +137,11 @@ The `AutoCLIOptions()` method on your module allows to specify custom commands,
|
||||
}
|
||||
```
|
||||
|
||||
:::tip
|
||||
AutoCLI can create a gov proposal of any tx by simply setting the `GovProposal` field to `true` in the `autocli.RpcCommandOptions` struct.
|
||||
Users can however use the `--no-proposal` flag to disable the proposal creation (which is useful if the authority isn't the gov module on a chain).
|
||||
:::
|
||||
|
||||
### Specifying Subcommands
|
||||
|
||||
By default, `autocli` generates a command for each method in your gRPC service. However, you can specify subcommands to group related commands together. To specify subcommands, use the `autocliv1.ServiceCommandDescriptor` struct.
|
||||
|
||||
@ -214,10 +214,10 @@ func (b *Builder) addMessageFlags(ctx context.Context, flagSet *pflag.FlagSet, m
|
||||
|
||||
flagOpts := commandOptions.FlagOptions[string(field.Name())]
|
||||
name, hasValue, err := b.addFieldFlag(ctx, flagSet, field, flagOpts, options)
|
||||
flagOptsByFlagName[name] = flagOpts
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
flagOptsByFlagName[name] = flagOpts
|
||||
|
||||
messageBinder.flagBindings = append(messageBinder.flagBindings, fieldBinding{
|
||||
hasValue: hasValue,
|
||||
|
||||
@ -5,6 +5,7 @@ import (
|
||||
"fmt"
|
||||
|
||||
"github.com/cockroachdb/errors"
|
||||
gogoproto "github.com/cosmos/gogoproto/proto"
|
||||
"github.com/spf13/cobra"
|
||||
"google.golang.org/protobuf/proto"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
@ -12,10 +13,18 @@ import (
|
||||
|
||||
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
|
||||
"cosmossdk.io/client/v2/autocli/flag"
|
||||
"cosmossdk.io/client/v2/internal/flags"
|
||||
"cosmossdk.io/client/v2/internal/util"
|
||||
addresscodec "cosmossdk.io/core/address"
|
||||
authtx "cosmossdk.io/x/auth/tx"
|
||||
authtxconfig "cosmossdk.io/x/auth/tx/config"
|
||||
|
||||
// the following will be extracted to a separate module
|
||||
// https://github.com/cosmos/cosmos-sdk/issues/14403
|
||||
authtypes "cosmossdk.io/x/auth/types"
|
||||
govcli "cosmossdk.io/x/gov/client/cli"
|
||||
govtypes "cosmossdk.io/x/gov/types"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
clienttx "github.com/cosmos/cosmos-sdk/client/tx"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
@ -111,7 +120,7 @@ func (b *Builder) AddMsgServiceCommands(cmd *cobra.Command, cmdDescriptor *autoc
|
||||
|
||||
// BuildMsgMethodCommand returns a command that outputs the JSON representation of the message.
|
||||
func (b *Builder) BuildMsgMethodCommand(descriptor protoreflect.MethodDescriptor, options *autocliv1.RpcCommandOptions) (*cobra.Command, error) {
|
||||
cmd, err := b.buildMethodCommandCommon(descriptor, options, func(cmd *cobra.Command, input protoreflect.Message) error {
|
||||
execFunc := func(cmd *cobra.Command, input protoreflect.Message) error {
|
||||
cmd.SetContext(context.WithValue(context.Background(), client.ClientContextKey, &b.ClientCtx))
|
||||
|
||||
clientCtx, err := client.GetClientTxContext(cmd)
|
||||
@ -140,11 +149,17 @@ func (b *Builder) BuildMsgMethodCommand(descriptor protoreflect.MethodDescriptor
|
||||
clientCtx = clientCtx.WithTxConfig(txConfig)
|
||||
}
|
||||
|
||||
// set signer to signer field if empty
|
||||
fd := input.Descriptor().Fields().ByName(protoreflect.Name(flag.GetSignerFieldName(input.Descriptor())))
|
||||
if addr := input.Get(fd).String(); addr == "" {
|
||||
addressCodec := b.Builder.AddressCodec
|
||||
addressCodec := b.Builder.AddressCodec
|
||||
|
||||
// handle gov proposals commands
|
||||
skipProposal, _ := cmd.Flags().GetBool(flags.FlagNoProposal)
|
||||
if options.GovProposal && !skipProposal {
|
||||
return b.handleGovProposal(options, cmd, input, clientCtx, addressCodec, fd)
|
||||
}
|
||||
|
||||
// set signer to signer field if empty
|
||||
if addr := input.Get(fd).String(); addr == "" {
|
||||
scalarType, ok := flag.GetScalarType(fd)
|
||||
if ok {
|
||||
// override address codec if validator or consensus address
|
||||
@ -172,7 +187,12 @@ func (b *Builder) BuildMsgMethodCommand(descriptor protoreflect.MethodDescriptor
|
||||
proto.Merge(msg, input.Interface())
|
||||
|
||||
return clienttx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg)
|
||||
})
|
||||
}
|
||||
|
||||
cmd, err := b.buildMethodCommandCommon(descriptor, options, execFunc)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if b.AddTxConnFlags != nil {
|
||||
b.AddTxConnFlags(cmd)
|
||||
@ -183,5 +203,51 @@ func (b *Builder) BuildMsgMethodCommand(descriptor protoreflect.MethodDescriptor
|
||||
cmd.SilenceUsage = true
|
||||
}
|
||||
|
||||
return cmd, err
|
||||
// set gov proposal flags if command is a gov proposal
|
||||
if options.GovProposal {
|
||||
govcli.AddGovPropFlagsToCmd(cmd)
|
||||
cmd.Flags().Bool(flags.FlagNoProposal, false, "Skip gov proposal and submit a normal transaction")
|
||||
}
|
||||
|
||||
return cmd, nil
|
||||
}
|
||||
|
||||
// handleGovProposal sets the authority field of the message to the gov module address and creates a gov proposal.
|
||||
func (b *Builder) handleGovProposal(
|
||||
options *autocliv1.RpcCommandOptions,
|
||||
cmd *cobra.Command,
|
||||
input protoreflect.Message,
|
||||
clientCtx client.Context,
|
||||
addressCodec addresscodec.Codec,
|
||||
fd protoreflect.FieldDescriptor,
|
||||
) error {
|
||||
govAuthority := authtypes.NewModuleAddress(govtypes.ModuleName)
|
||||
authority, err := addressCodec.BytesToString(govAuthority.Bytes())
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to convert gov authority: %w", err)
|
||||
}
|
||||
input.Set(fd, protoreflect.ValueOfString(authority))
|
||||
|
||||
signerFromFlag := clientCtx.GetFromAddress()
|
||||
signer, err := addressCodec.BytesToString(signerFromFlag.Bytes())
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to set signer on message, got %q: %w", signerFromFlag, err)
|
||||
}
|
||||
|
||||
proposal, err := govcli.ReadGovPropCmdFlags(signer, cmd.Flags())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// AutoCLI uses protov2 messages, while the SDK only supports proto v1 messages.
|
||||
// Here we use dynamicpb, to create a proto v1 compatible message.
|
||||
// The SDK codec will handle protov2 -> protov1 (marshal)
|
||||
msg := dynamicpb.NewMessage(input.Descriptor())
|
||||
proto.Merge(msg, input.Interface())
|
||||
|
||||
if err := proposal.SetMsgs([]gogoproto.Message{msg}); err != nil {
|
||||
return fmt.Errorf("failed to set msg in proposal %w", err)
|
||||
}
|
||||
|
||||
return clienttx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), proposal)
|
||||
}
|
||||
|
||||
@ -3,14 +3,17 @@ module cosmossdk.io/client/v2
|
||||
go 1.21
|
||||
|
||||
require (
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a
|
||||
cosmossdk.io/core v0.12.0
|
||||
cosmossdk.io/depinject v1.0.0-alpha.4
|
||||
cosmossdk.io/x/bank v0.0.0-00010101000000-000000000000
|
||||
cosmossdk.io/x/gov v0.0.0-20231113122742-912390d5fc4a
|
||||
cosmossdk.io/x/tx v0.12.0
|
||||
github.com/chzyer/readline v1.5.1 // indirect
|
||||
github.com/cockroachdb/errors v1.11.1
|
||||
github.com/cosmos/cosmos-proto v1.0.0-beta.3
|
||||
github.com/cosmos/cosmos-sdk v0.51.0
|
||||
github.com/manifoldco/promptui v0.9.0 // indirect
|
||||
github.com/spf13/cobra v1.8.0
|
||||
github.com/spf13/pflag v1.0.5
|
||||
google.golang.org/grpc v1.59.0
|
||||
@ -47,7 +50,7 @@ require (
|
||||
github.com/cosmos/cosmos-db v1.0.0 // indirect
|
||||
github.com/cosmos/go-bip39 v1.0.0 // indirect
|
||||
github.com/cosmos/gogogateway v1.2.0 // indirect
|
||||
github.com/cosmos/gogoproto v1.4.11 // indirect
|
||||
github.com/cosmos/gogoproto v1.4.11
|
||||
github.com/cosmos/iavl v1.0.0 // indirect
|
||||
github.com/cosmos/ics23/go v0.10.0 // indirect
|
||||
github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect
|
||||
@ -132,7 +135,7 @@ require (
|
||||
github.com/spf13/afero v1.10.0 // indirect
|
||||
github.com/spf13/cast v1.5.1 // indirect
|
||||
github.com/spf13/viper v1.17.0 // indirect
|
||||
github.com/stretchr/testify v1.8.4 // indirect
|
||||
github.com/stretchr/testify v1.8.4
|
||||
github.com/subosito/gotenv v1.6.0 // indirect
|
||||
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
|
||||
github.com/tendermint/go-amino v0.16.0 // indirect
|
||||
@ -163,6 +166,7 @@ replace (
|
||||
cosmossdk.io/x/auth => ./../../x/auth
|
||||
cosmossdk.io/x/bank => ./../../x/bank
|
||||
cosmossdk.io/x/distribution => ./../../x/distribution
|
||||
cosmossdk.io/x/gov => ./../../x/gov
|
||||
cosmossdk.io/x/mint => ./../../x/mint
|
||||
cosmossdk.io/x/protocolpool => ./../../x/protocolpool
|
||||
cosmossdk.io/x/slashing => ./../../x/slashing
|
||||
|
||||
@ -35,8 +35,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl
|
||||
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
|
||||
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
|
||||
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54 h1:c7kl5S1ME0q2g/7cdxngOAZr6N/5L7vVibmrmQZrQ0U=
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54/go.mod h1:7B/5XWh1HYwJk3DzWeNoxOSI+nGx1m5UyYfHLFuKzkw=
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a h1:Zr++x1RCJWi+K8bTZsQKdjtL4SzyHBLGM3Fcn75iWf0=
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a/go.mod h1:7B/5XWh1HYwJk3DzWeNoxOSI+nGx1m5UyYfHLFuKzkw=
|
||||
cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
|
||||
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
|
||||
cosmossdk.io/core v0.12.0 h1:aFuvkG6eDv0IQC+UDjx86wxNWVAxdCFk7OABJ1Vh4RU=
|
||||
@ -128,8 +128,14 @@ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL
|
||||
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
|
||||
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
|
||||
github.com/chzyer/logex v1.2.1 h1:XHDu3E6q+gdHgsdTPH6ImJMIp436vR6MPtH8gP05QzM=
|
||||
github.com/chzyer/logex v1.2.1/go.mod h1:JLbx6lG2kDbNRFnfkgvh4eRJRPX1QCoOIWomwysCBrQ=
|
||||
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
|
||||
github.com/chzyer/readline v1.5.1 h1:upd/6fQk4src78LMRzh5vItIt361/o4uq553V8B5sGI=
|
||||
github.com/chzyer/readline v1.5.1/go.mod h1:Eh+b79XXUwfKfcPLepksvw2tcLE/Ct21YObkaSkeBlk=
|
||||
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
|
||||
github.com/chzyer/test v1.0.0 h1:p3BQDXSxOhOG0P9z6/hGnII4LGiEPOYBhs8asl/fC04=
|
||||
github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8=
|
||||
github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag=
|
||||
github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I=
|
||||
github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE=
|
||||
@ -529,6 +535,8 @@ github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0Q
|
||||
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
|
||||
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
|
||||
github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
|
||||
github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA=
|
||||
github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg=
|
||||
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
|
||||
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||
github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
|
||||
@ -1008,6 +1016,7 @@ golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBc
|
||||
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220315194320-039c03cc5b86/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
|
||||
@ -10,6 +10,13 @@ const (
|
||||
|
||||
// FlagNoIndent is the flag to not indent the output.
|
||||
FlagNoIndent = "no-indent"
|
||||
|
||||
// FlagNoPrompt is the flag to not use a prompt for commands.
|
||||
FlagNoPrompt = "no-prompt"
|
||||
|
||||
// FlagNoProposal is the flag convert a gov proposal command into a normal command.
|
||||
// This is used to allow user of chains with custom authority to not use gov submit proposals for usual proposal commands.
|
||||
FlagNoProposal = "no-proposal"
|
||||
)
|
||||
|
||||
// List of supported output formats
|
||||
|
||||
36
client/v2/internal/prompt/validation.go
Normal file
36
client/v2/internal/prompt/validation.go
Normal file
@ -0,0 +1,36 @@
|
||||
package prompt
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/url"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
)
|
||||
|
||||
// ValidatePromptNotEmpty validates that the input is not empty.
|
||||
func ValidatePromptNotEmpty(input string) error {
|
||||
if input == "" {
|
||||
return fmt.Errorf("input cannot be empty")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ValidatePromptURL validates that the input is a valid URL.
|
||||
func ValidatePromptURL(input string) error {
|
||||
_, err := url.ParseRequestURI(input)
|
||||
if err != nil {
|
||||
return fmt.Errorf("invalid URL: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ValidatePromptCoins validates that the input contains valid sdk.Coins
|
||||
func ValidatePromptCoins(input string) error {
|
||||
if _, err := sdk.ParseCoinsNormalized(input); err != nil {
|
||||
return fmt.Errorf("invalid coins: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
30
client/v2/internal/prompt/validation_test.go
Normal file
30
client/v2/internal/prompt/validation_test.go
Normal file
@ -0,0 +1,30 @@
|
||||
package prompt_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"cosmossdk.io/client/v2/internal/prompt"
|
||||
)
|
||||
|
||||
func TestValidatePromptNotEmpty(t *testing.T) {
|
||||
require := require.New(t)
|
||||
|
||||
require.NoError(prompt.ValidatePromptNotEmpty("foo"))
|
||||
require.ErrorContains(prompt.ValidatePromptNotEmpty(""), "input cannot be empty")
|
||||
}
|
||||
|
||||
func TestValidatePromptURL(t *testing.T) {
|
||||
require := require.New(t)
|
||||
|
||||
require.NoError(prompt.ValidatePromptURL("https://example.com"))
|
||||
require.ErrorContains(prompt.ValidatePromptURL("foo"), "invalid URL")
|
||||
}
|
||||
|
||||
func TestValidatePromptCoins(t *testing.T) {
|
||||
require := require.New(t)
|
||||
|
||||
require.NoError(prompt.ValidatePromptCoins("100stake"))
|
||||
require.ErrorContains(prompt.ValidatePromptCoins("foo"), "invalid coins")
|
||||
}
|
||||
2
go.mod
2
go.mod
@ -3,7 +3,7 @@ go 1.21
|
||||
module github.com/cosmos/cosmos-sdk
|
||||
|
||||
require (
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a
|
||||
cosmossdk.io/collections v0.4.0
|
||||
cosmossdk.io/core v0.12.0
|
||||
cosmossdk.io/depinject v1.0.0-alpha.4
|
||||
|
||||
4
go.sum
4
go.sum
@ -35,8 +35,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl
|
||||
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
|
||||
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
|
||||
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54 h1:c7kl5S1ME0q2g/7cdxngOAZr6N/5L7vVibmrmQZrQ0U=
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54/go.mod h1:7B/5XWh1HYwJk3DzWeNoxOSI+nGx1m5UyYfHLFuKzkw=
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a h1:Zr++x1RCJWi+K8bTZsQKdjtL4SzyHBLGM3Fcn75iWf0=
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a/go.mod h1:7B/5XWh1HYwJk3DzWeNoxOSI+nGx1m5UyYfHLFuKzkw=
|
||||
cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
|
||||
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
|
||||
cosmossdk.io/core v0.12.0 h1:aFuvkG6eDv0IQC+UDjx86wxNWVAxdCFk7OABJ1Vh4RU=
|
||||
|
||||
@ -3,7 +3,7 @@ module cosmossdk.io/simapp
|
||||
go 1.21
|
||||
|
||||
require (
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a
|
||||
cosmossdk.io/client/v2 v2.0.0-20230630094428-02b760776860
|
||||
cosmossdk.io/collections v0.4.0
|
||||
cosmossdk.io/core v0.12.0
|
||||
@ -40,7 +40,7 @@ require (
|
||||
cosmossdk.io/x/authz v0.0.0-00010101000000-000000000000
|
||||
cosmossdk.io/x/bank v0.0.0-00010101000000-000000000000
|
||||
cosmossdk.io/x/distribution v0.0.0-20230925135524-a1bc045b3190
|
||||
cosmossdk.io/x/gov v0.0.0-20230925135524-a1bc045b3190
|
||||
cosmossdk.io/x/gov v0.0.0-20231113122742-912390d5fc4a
|
||||
cosmossdk.io/x/group v0.0.0-00010101000000-000000000000
|
||||
cosmossdk.io/x/mint v0.0.0-00010101000000-000000000000
|
||||
cosmossdk.io/x/slashing v0.0.0-00010101000000-000000000000
|
||||
|
||||
@ -3,7 +3,7 @@ module github.com/cosmos/cosmos-sdk/tests
|
||||
go 1.21
|
||||
|
||||
require (
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a
|
||||
cosmossdk.io/collections v0.4.0
|
||||
cosmossdk.io/core v0.12.0
|
||||
cosmossdk.io/depinject v1.0.0-alpha.4
|
||||
@ -38,7 +38,7 @@ require (
|
||||
cosmossdk.io/x/authz v0.0.0-00010101000000-000000000000
|
||||
cosmossdk.io/x/bank v0.0.0-00010101000000-000000000000
|
||||
cosmossdk.io/x/distribution v0.0.0-20230925135524-a1bc045b3190
|
||||
cosmossdk.io/x/gov v0.0.0-20230925135524-a1bc045b3190
|
||||
cosmossdk.io/x/gov v0.0.0-20231113122742-912390d5fc4a
|
||||
cosmossdk.io/x/group v0.0.0-00010101000000-000000000000
|
||||
cosmossdk.io/x/mint v0.0.0-00010101000000-000000000000
|
||||
cosmossdk.io/x/slashing v0.0.0-00010101000000-000000000000
|
||||
|
||||
@ -52,7 +52,7 @@ require (
|
||||
cloud.google.com/go/compute/metadata v0.2.3 // indirect
|
||||
cloud.google.com/go/iam v1.1.3 // indirect
|
||||
cloud.google.com/go/storage v1.33.0 // indirect
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54 // indirect
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a // indirect
|
||||
cosmossdk.io/client/v2 v2.0.0-20230630094428-02b760776860 // indirect
|
||||
cosmossdk.io/collections v0.4.0 // indirect
|
||||
cosmossdk.io/core v0.12.0 // indirect
|
||||
@ -65,7 +65,7 @@ require (
|
||||
cosmossdk.io/x/distribution v0.0.0-20230925135524-a1bc045b3190 // indirect
|
||||
cosmossdk.io/x/evidence v0.0.0-20230613133644-0a778132a60f // indirect
|
||||
cosmossdk.io/x/feegrant v0.0.0-20230613133644-0a778132a60f // indirect
|
||||
cosmossdk.io/x/gov v0.0.0-20230925135524-a1bc045b3190 // indirect
|
||||
cosmossdk.io/x/gov v0.0.0-20231113122742-912390d5fc4a // indirect
|
||||
cosmossdk.io/x/group v0.0.0-00010101000000-000000000000 // indirect
|
||||
cosmossdk.io/x/mint v0.0.0-00010101000000-000000000000 // indirect
|
||||
cosmossdk.io/x/nft v0.0.0-20230613133644-0a778132a60f // indirect
|
||||
|
||||
@ -3,7 +3,7 @@ module cosmossdk.io/x/accounts
|
||||
go 1.21
|
||||
|
||||
require (
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a
|
||||
cosmossdk.io/collections v0.4.0
|
||||
cosmossdk.io/core v0.12.0
|
||||
github.com/cosmos/cosmos-sdk v0.51.0
|
||||
|
||||
@ -80,8 +80,12 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
|
||||
Service: authv1beta1.Msg_ServiceDesc.ServiceName,
|
||||
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
|
||||
{
|
||||
RpcMethod: "UpdateParams",
|
||||
Skip: true, // skipped because authority gated
|
||||
RpcMethod: "UpdateParams",
|
||||
Use: "update-params-proposal [params]",
|
||||
Short: "Submit a proposal to update auth module params. Note: the entire params must be provided.",
|
||||
Example: fmt.Sprintf(`%s tx auth update-params-proposal '{ "max_memo_characters": 0, "tx_sig_limit": 0, "tx_size_cost_per_byte": 0, "sig_verify_cost_ed25519": 0, "sig_verify_cost_secp256k1": 0 }'`, version.AppName),
|
||||
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "params"}},
|
||||
GovProposal: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@ -3,7 +3,7 @@ module cosmossdk.io/x/auth
|
||||
go 1.21
|
||||
|
||||
require (
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a
|
||||
cosmossdk.io/collections v0.4.0
|
||||
cosmossdk.io/core v0.12.0
|
||||
cosmossdk.io/depinject v1.0.0-alpha.4
|
||||
|
||||
@ -35,8 +35,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl
|
||||
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
|
||||
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
|
||||
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54 h1:c7kl5S1ME0q2g/7cdxngOAZr6N/5L7vVibmrmQZrQ0U=
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54/go.mod h1:7B/5XWh1HYwJk3DzWeNoxOSI+nGx1m5UyYfHLFuKzkw=
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a h1:Zr++x1RCJWi+K8bTZsQKdjtL4SzyHBLGM3Fcn75iWf0=
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a/go.mod h1:7B/5XWh1HYwJk3DzWeNoxOSI+nGx1m5UyYfHLFuKzkw=
|
||||
cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
|
||||
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
|
||||
cosmossdk.io/core v0.12.0 h1:aFuvkG6eDv0IQC+UDjx86wxNWVAxdCFk7OABJ1Vh4RU=
|
||||
|
||||
@ -3,7 +3,7 @@ module cosmossdk.io/x/authz
|
||||
go 1.21
|
||||
|
||||
require (
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a
|
||||
cosmossdk.io/core v0.12.0
|
||||
cosmossdk.io/depinject v1.0.0-alpha.4
|
||||
cosmossdk.io/errors v1.0.0
|
||||
|
||||
@ -1,10 +1,13 @@
|
||||
package bank
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
|
||||
bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/version"
|
||||
)
|
||||
|
||||
// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface.
|
||||
@ -107,12 +110,23 @@ Note: multiple coins can be send by space separated.`,
|
||||
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "from_address"}, {ProtoField: "amount", Varargs: true}},
|
||||
},
|
||||
{
|
||||
RpcMethod: "UpdateParams",
|
||||
Skip: true, // skipped because authority gated
|
||||
RpcMethod: "UpdateParams",
|
||||
Use: "update-params-proposal [params]",
|
||||
Short: "Submit a proposal to update bank module params. Note: the entire params must be provided.",
|
||||
Example: fmt.Sprintf(`%s tx bank update-params-proposal '{ "default_send_enabled": true }'`, version.AppName),
|
||||
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "params"}},
|
||||
GovProposal: true,
|
||||
},
|
||||
{
|
||||
RpcMethod: "SetSendEnabled",
|
||||
Skip: true, // skipped because authority gated
|
||||
RpcMethod: "SetSendEnabled",
|
||||
Use: "set-send-enabled-proposal [send_enabled]",
|
||||
Short: "Submit a proposal to set/update/delete send enabled entries",
|
||||
Example: fmt.Sprintf(`%s tx bank set-send-enabled-proposal '{"denom":"stake","enabled":true}'`, version.AppName),
|
||||
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "send_enabled", Varargs: true}},
|
||||
FlagOptions: map[string]*autocliv1.FlagOptions{
|
||||
"use_default_for": {Name: "use-default-for", Usage: "Use default for the given denom (delete a send enabled entry)"},
|
||||
},
|
||||
GovProposal: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@ -3,7 +3,7 @@ module cosmossdk.io/x/bank
|
||||
go 1.21
|
||||
|
||||
require (
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a
|
||||
cosmossdk.io/collections v0.4.0
|
||||
cosmossdk.io/core v0.12.0
|
||||
cosmossdk.io/depinject v1.0.0-alpha.4
|
||||
|
||||
@ -35,8 +35,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl
|
||||
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
|
||||
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
|
||||
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54 h1:c7kl5S1ME0q2g/7cdxngOAZr6N/5L7vVibmrmQZrQ0U=
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54/go.mod h1:7B/5XWh1HYwJk3DzWeNoxOSI+nGx1m5UyYfHLFuKzkw=
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a h1:Zr++x1RCJWi+K8bTZsQKdjtL4SzyHBLGM3Fcn75iWf0=
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a/go.mod h1:7B/5XWh1HYwJk3DzWeNoxOSI+nGx1m5UyYfHLFuKzkw=
|
||||
cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
|
||||
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
|
||||
cosmossdk.io/core v0.12.0 h1:aFuvkG6eDv0IQC+UDjx86wxNWVAxdCFk7OABJ1Vh4RU=
|
||||
|
||||
@ -3,7 +3,7 @@ module cosmossdk.io/x/circuit
|
||||
go 1.21
|
||||
|
||||
require (
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a
|
||||
cosmossdk.io/collections v0.4.0
|
||||
cosmossdk.io/core v0.12.0
|
||||
cosmossdk.io/depinject v1.0.0-alpha.4
|
||||
|
||||
@ -35,8 +35,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl
|
||||
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
|
||||
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
|
||||
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54 h1:c7kl5S1ME0q2g/7cdxngOAZr6N/5L7vVibmrmQZrQ0U=
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54/go.mod h1:7B/5XWh1HYwJk3DzWeNoxOSI+nGx1m5UyYfHLFuKzkw=
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a h1:Zr++x1RCJWi+K8bTZsQKdjtL4SzyHBLGM3Fcn75iWf0=
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a/go.mod h1:7B/5XWh1HYwJk3DzWeNoxOSI+nGx1m5UyYfHLFuKzkw=
|
||||
cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
|
||||
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
|
||||
cosmossdk.io/core v0.12.0 h1:aFuvkG6eDv0IQC+UDjx86wxNWVAxdCFk7OABJ1Vh4RU=
|
||||
|
||||
@ -1,10 +1,13 @@
|
||||
package consensus
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
|
||||
consensusv1 "cosmossdk.io/api/cosmos/consensus/v1"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client/grpc/cmtservice"
|
||||
"github.com/cosmos/cosmos-sdk/version"
|
||||
)
|
||||
|
||||
// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface.
|
||||
@ -28,7 +31,16 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
|
||||
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
|
||||
{
|
||||
RpcMethod: "UpdateParams",
|
||||
Skip: true, // skipped because authority gated
|
||||
Use: "update-params-proposal [params]",
|
||||
Short: "Submit a proposal to update consensus module params. Note: the entire params must be provided.",
|
||||
Example: fmt.Sprintf(`%s tx consensus update-params-proposal '{ params }'`, version.AppName),
|
||||
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
|
||||
{ProtoField: "block"},
|
||||
{ProtoField: "evidence"},
|
||||
{ProtoField: "validator"},
|
||||
{ProtoField: "abci"},
|
||||
},
|
||||
GovProposal: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@ -1,8 +1,11 @@
|
||||
package crisis
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
|
||||
crisisv1beta1 "cosmossdk.io/api/cosmos/crisis/v1beta1"
|
||||
"github.com/cosmos/cosmos-sdk/version"
|
||||
)
|
||||
|
||||
// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface.
|
||||
@ -21,8 +24,12 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
|
||||
},
|
||||
},
|
||||
{
|
||||
RpcMethod: "UpdateParams",
|
||||
Skip: true, // Skipped because UpdateParams is authority gated
|
||||
RpcMethod: "UpdateParams",
|
||||
Use: "update-params-proposal [params]",
|
||||
Short: "Submit a proposal to update crisis module params. Note: the entire params must be provided.",
|
||||
Example: fmt.Sprintf(`%s tx crisis update-params-proposal '{ "constant_fee": {"denom": "stake", "amount": "1000"} }'`, version.AppName),
|
||||
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "params"}},
|
||||
GovProposal: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
|
||||
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
|
||||
distirbuitonv1beta1 "cosmossdk.io/api/cosmos/distribution/v1beta1"
|
||||
distributionv1beta1 "cosmossdk.io/api/cosmos/distribution/v1beta1"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/version"
|
||||
)
|
||||
@ -13,7 +13,7 @@ import (
|
||||
func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
|
||||
return &autocliv1.ModuleOptions{
|
||||
Query: &autocliv1.ServiceCommandDescriptor{
|
||||
Service: distirbuitonv1beta1.Query_ServiceDesc.ServiceName,
|
||||
Service: distributionv1beta1.Query_ServiceDesc.ServiceName,
|
||||
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
|
||||
{
|
||||
RpcMethod: "Params",
|
||||
@ -79,7 +79,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
|
||||
},
|
||||
},
|
||||
Tx: &autocliv1.ServiceCommandDescriptor{
|
||||
Service: distirbuitonv1beta1.Msg_ServiceDesc.ServiceName,
|
||||
Service: distributionv1beta1.Msg_ServiceDesc.ServiceName,
|
||||
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
|
||||
{
|
||||
RpcMethod: "SetWithdrawAddress",
|
||||
@ -127,12 +127,16 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
|
||||
},
|
||||
},
|
||||
{
|
||||
RpcMethod: "UpdateParams",
|
||||
Skip: true, // skipped because authority gated
|
||||
RpcMethod: "UpdateParams",
|
||||
Use: "update-params-proposal [params]",
|
||||
Short: "Submit a proposal to update distribution module params. Note: the entire params must be provided.",
|
||||
Example: fmt.Sprintf(`%s tx distribution update-params-proposal '{ "community_tax": "20000", "base_proposer_reward": "0", "bonus_proposer_reward": "0", "withdraw_addr_enabled": true }'`, version.AppName),
|
||||
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "params"}},
|
||||
GovProposal: true,
|
||||
},
|
||||
{
|
||||
RpcMethod: "CommunityPoolSpend",
|
||||
Skip: true, // skipped because authority gated
|
||||
Skip: true, // skipped because deprecated in favor of protocolpool
|
||||
},
|
||||
},
|
||||
EnhanceCustomCommand: true,
|
||||
|
||||
@ -3,7 +3,7 @@ module cosmossdk.io/x/distribution
|
||||
go 1.21
|
||||
|
||||
require (
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a
|
||||
cosmossdk.io/collections v0.4.0
|
||||
cosmossdk.io/core v0.12.0
|
||||
cosmossdk.io/depinject v1.0.0-alpha.4
|
||||
|
||||
@ -35,8 +35,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl
|
||||
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
|
||||
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
|
||||
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54 h1:c7kl5S1ME0q2g/7cdxngOAZr6N/5L7vVibmrmQZrQ0U=
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54/go.mod h1:7B/5XWh1HYwJk3DzWeNoxOSI+nGx1m5UyYfHLFuKzkw=
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a h1:Zr++x1RCJWi+K8bTZsQKdjtL4SzyHBLGM3Fcn75iWf0=
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a/go.mod h1:7B/5XWh1HYwJk3DzWeNoxOSI+nGx1m5UyYfHLFuKzkw=
|
||||
cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
|
||||
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
|
||||
cosmossdk.io/core v0.12.0 h1:aFuvkG6eDv0IQC+UDjx86wxNWVAxdCFk7OABJ1Vh4RU=
|
||||
|
||||
@ -3,7 +3,7 @@ module cosmossdk.io/x/evidence
|
||||
go 1.21
|
||||
|
||||
require (
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a
|
||||
cosmossdk.io/collections v0.4.0
|
||||
cosmossdk.io/core v0.12.0
|
||||
cosmossdk.io/depinject v1.0.0-alpha.4
|
||||
|
||||
@ -35,8 +35,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl
|
||||
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
|
||||
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
|
||||
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54 h1:c7kl5S1ME0q2g/7cdxngOAZr6N/5L7vVibmrmQZrQ0U=
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54/go.mod h1:7B/5XWh1HYwJk3DzWeNoxOSI+nGx1m5UyYfHLFuKzkw=
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a h1:Zr++x1RCJWi+K8bTZsQKdjtL4SzyHBLGM3Fcn75iWf0=
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a/go.mod h1:7B/5XWh1HYwJk3DzWeNoxOSI+nGx1m5UyYfHLFuKzkw=
|
||||
cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
|
||||
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
|
||||
cosmossdk.io/core v0.12.0 h1:aFuvkG6eDv0IQC+UDjx86wxNWVAxdCFk7OABJ1Vh4RU=
|
||||
|
||||
@ -3,7 +3,7 @@ module cosmossdk.io/x/feegrant
|
||||
go 1.21
|
||||
|
||||
require (
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a
|
||||
cosmossdk.io/collections v0.4.0
|
||||
cosmossdk.io/core v0.12.0
|
||||
cosmossdk.io/depinject v1.0.0-alpha.4
|
||||
|
||||
@ -35,8 +35,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl
|
||||
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
|
||||
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
|
||||
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54 h1:c7kl5S1ME0q2g/7cdxngOAZr6N/5L7vVibmrmQZrQ0U=
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54/go.mod h1:7B/5XWh1HYwJk3DzWeNoxOSI+nGx1m5UyYfHLFuKzkw=
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a h1:Zr++x1RCJWi+K8bTZsQKdjtL4SzyHBLGM3Fcn75iWf0=
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a/go.mod h1:7B/5XWh1HYwJk3DzWeNoxOSI+nGx1m5UyYfHLFuKzkw=
|
||||
cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
|
||||
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
|
||||
cosmossdk.io/core v0.12.0 h1:aFuvkG6eDv0IQC+UDjx86wxNWVAxdCFk7OABJ1Vh4RU=
|
||||
|
||||
@ -131,8 +131,13 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
|
||||
},
|
||||
},
|
||||
{
|
||||
RpcMethod: "UpdateParams",
|
||||
Skip: true, // skipped because authority gated
|
||||
RpcMethod: "UpdateParams",
|
||||
Use: "update-params-proposal [params]",
|
||||
Short: "Submit a proposal to update gov module params. Note: the entire params must be provided.",
|
||||
Long: fmt.Sprintf("Submit a proposal to update gov module params. Note: the entire params must be provided.\n See the fields to fill in by running `%s query gov params --output json`", version.AppName),
|
||||
Example: fmt.Sprintf(`%s tx gov update-params-proposal '{ params }'`, version.AppName),
|
||||
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "params"}},
|
||||
GovProposal: true,
|
||||
},
|
||||
},
|
||||
EnhanceCustomCommand: true, // We still have manual commands in gov that we want to keep
|
||||
|
||||
@ -58,6 +58,8 @@ var suggestedProposalTypes = []proposalType{
|
||||
// Prompt prompts the user for all values of the given type.
|
||||
// data is the struct to be filled
|
||||
// namePrefix is the name to be displayed as "Enter <namePrefix> <field>"
|
||||
// TODO: when bringing this in autocli, use proto message instead
|
||||
// this will simplify the get address logic
|
||||
func Prompt[T any](data T, namePrefix string) (T, error) {
|
||||
v := reflect.ValueOf(&data).Elem()
|
||||
if v.Kind() == reflect.Interface {
|
||||
|
||||
@ -28,6 +28,8 @@ const (
|
||||
flagStatus = "status"
|
||||
FlagMetadata = "metadata"
|
||||
FlagSummary = "summary"
|
||||
FlagExpedited = "expedited"
|
||||
|
||||
// Deprecated: only used for v1beta1 legacy proposals.
|
||||
FlagProposal = "proposal"
|
||||
// Deprecated: only used for v1beta1 legacy proposals.
|
||||
|
||||
@ -132,13 +132,14 @@ func AddGovPropFlagsToCmd(cmd *cobra.Command) {
|
||||
cmd.Flags().String(FlagMetadata, "", "The metadata to include with the governance proposal")
|
||||
cmd.Flags().String(FlagTitle, "", "The title to put on the governance proposal")
|
||||
cmd.Flags().String(FlagSummary, "", "The summary to include with the governance proposal")
|
||||
cmd.Flags().Bool(FlagExpedited, false, "Whether to expedite the governance proposal")
|
||||
}
|
||||
|
||||
// ReadGovPropFlags parses a MsgSubmitProposal from the provided context and flags.
|
||||
// ReadGovPropCmdFlags parses a MsgSubmitProposal from the provided context and flags.
|
||||
// Setting the messages is up to the caller.
|
||||
//
|
||||
// See also AddGovPropFlagsToCmd.
|
||||
func ReadGovPropFlags(clientCtx client.Context, flagSet *pflag.FlagSet) (*govv1.MsgSubmitProposal, error) {
|
||||
func ReadGovPropCmdFlags(proposer string, flagSet *pflag.FlagSet) (*govv1.MsgSubmitProposal, error) {
|
||||
rv := &govv1.MsgSubmitProposal{}
|
||||
|
||||
deposit, err := flagSet.GetString(FlagDeposit)
|
||||
@ -167,7 +168,21 @@ func ReadGovPropFlags(clientCtx client.Context, flagSet *pflag.FlagSet) (*govv1.
|
||||
return nil, fmt.Errorf("could not read summary: %w", err)
|
||||
}
|
||||
|
||||
rv.Proposer = clientCtx.GetFromAddress().String()
|
||||
rv.Expedited, err = flagSet.GetBool(FlagExpedited)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not read expedited: %w", err)
|
||||
}
|
||||
|
||||
rv.Proposer = proposer
|
||||
|
||||
return rv, nil
|
||||
}
|
||||
|
||||
// ReadGovPropFlags parses a MsgSubmitProposal from the provided context and flags.
|
||||
// Setting the messages is up to the caller.
|
||||
//
|
||||
// See also AddGovPropFlagsToCmd.
|
||||
// Deprecated: use ReadPropCmdFlags instead, as this depends on global bech32 prefixes.
|
||||
func ReadGovPropFlags(clientCtx client.Context, flagSet *pflag.FlagSet) (*govv1.MsgSubmitProposal, error) {
|
||||
return ReadGovPropCmdFlags(clientCtx.GetFromAddress().String(), flagSet)
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@ module cosmossdk.io/x/gov
|
||||
go 1.21
|
||||
|
||||
require (
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a
|
||||
cosmossdk.io/collections v0.4.0
|
||||
cosmossdk.io/core v0.12.0
|
||||
cosmossdk.io/depinject v1.0.0-alpha.4
|
||||
|
||||
@ -3,7 +3,7 @@ module cosmossdk.io/x/group
|
||||
go 1.21
|
||||
|
||||
require (
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a
|
||||
cosmossdk.io/core v0.12.0
|
||||
cosmossdk.io/depinject v1.0.0-alpha.4
|
||||
cosmossdk.io/errors v1.0.0
|
||||
|
||||
@ -35,8 +35,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl
|
||||
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
|
||||
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
|
||||
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54 h1:c7kl5S1ME0q2g/7cdxngOAZr6N/5L7vVibmrmQZrQ0U=
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54/go.mod h1:7B/5XWh1HYwJk3DzWeNoxOSI+nGx1m5UyYfHLFuKzkw=
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a h1:Zr++x1RCJWi+K8bTZsQKdjtL4SzyHBLGM3Fcn75iWf0=
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a/go.mod h1:7B/5XWh1HYwJk3DzWeNoxOSI+nGx1m5UyYfHLFuKzkw=
|
||||
cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
|
||||
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
|
||||
cosmossdk.io/core v0.12.0 h1:aFuvkG6eDv0IQC+UDjx86wxNWVAxdCFk7OABJ1Vh4RU=
|
||||
|
||||
@ -1,8 +1,11 @@
|
||||
package mint
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
|
||||
mintv1beta1 "cosmossdk.io/api/cosmos/mint/v1beta1"
|
||||
"github.com/cosmos/cosmos-sdk/version"
|
||||
)
|
||||
|
||||
func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
|
||||
@ -31,8 +34,13 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
|
||||
Service: mintv1beta1.Msg_ServiceDesc.ServiceName,
|
||||
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
|
||||
{
|
||||
RpcMethod: "UpdateParams",
|
||||
Skip: true, // skipped because authority gated
|
||||
RpcMethod: "UpdateParams",
|
||||
Use: "update-params-proposal [params]",
|
||||
Short: "Submit a proposal to update mint module params. Note: the entire params must be provided.",
|
||||
Long: fmt.Sprintf("Submit a proposal to update mint module params. Note: the entire params must be provided.\n See the fields to fill in by running `%s query mint params --output json`", version.AppName),
|
||||
Example: fmt.Sprintf(`%s tx mint update-params-proposal '{ "mint_denom": "stake", ... }'`, version.AppName),
|
||||
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "params"}},
|
||||
GovProposal: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@ -3,7 +3,7 @@ module cosmossdk.io/x/mint
|
||||
go 1.21
|
||||
|
||||
require (
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a
|
||||
cosmossdk.io/collections v0.4.0
|
||||
cosmossdk.io/core v0.12.0
|
||||
cosmossdk.io/depinject v1.0.0-alpha.4
|
||||
|
||||
@ -35,8 +35,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl
|
||||
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
|
||||
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
|
||||
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54 h1:c7kl5S1ME0q2g/7cdxngOAZr6N/5L7vVibmrmQZrQ0U=
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54/go.mod h1:7B/5XWh1HYwJk3DzWeNoxOSI+nGx1m5UyYfHLFuKzkw=
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a h1:Zr++x1RCJWi+K8bTZsQKdjtL4SzyHBLGM3Fcn75iWf0=
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a/go.mod h1:7B/5XWh1HYwJk3DzWeNoxOSI+nGx1m5UyYfHLFuKzkw=
|
||||
cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
|
||||
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
|
||||
cosmossdk.io/core v0.12.0 h1:aFuvkG6eDv0IQC+UDjx86wxNWVAxdCFk7OABJ1Vh4RU=
|
||||
|
||||
@ -3,7 +3,7 @@ module cosmossdk.io/x/nft
|
||||
go 1.21
|
||||
|
||||
require (
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a
|
||||
cosmossdk.io/core v0.12.0
|
||||
cosmossdk.io/depinject v1.0.0-alpha.4
|
||||
cosmossdk.io/errors v1.0.0
|
||||
|
||||
@ -35,8 +35,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl
|
||||
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
|
||||
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
|
||||
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54 h1:c7kl5S1ME0q2g/7cdxngOAZr6N/5L7vVibmrmQZrQ0U=
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54/go.mod h1:7B/5XWh1HYwJk3DzWeNoxOSI+nGx1m5UyYfHLFuKzkw=
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a h1:Zr++x1RCJWi+K8bTZsQKdjtL4SzyHBLGM3Fcn75iWf0=
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a/go.mod h1:7B/5XWh1HYwJk3DzWeNoxOSI+nGx1m5UyYfHLFuKzkw=
|
||||
cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
|
||||
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
|
||||
cosmossdk.io/core v0.12.0 h1:aFuvkG6eDv0IQC+UDjx86wxNWVAxdCFk7OABJ1Vh4RU=
|
||||
|
||||
@ -3,7 +3,7 @@ module cosmossdk.io/x/params
|
||||
go 1.21
|
||||
|
||||
require (
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a
|
||||
cosmossdk.io/core v0.12.0
|
||||
cosmossdk.io/depinject v1.0.0-alpha.4
|
||||
cosmossdk.io/errors v1.0.0
|
||||
|
||||
@ -35,8 +35,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl
|
||||
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
|
||||
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
|
||||
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54 h1:c7kl5S1ME0q2g/7cdxngOAZr6N/5L7vVibmrmQZrQ0U=
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54/go.mod h1:7B/5XWh1HYwJk3DzWeNoxOSI+nGx1m5UyYfHLFuKzkw=
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a h1:Zr++x1RCJWi+K8bTZsQKdjtL4SzyHBLGM3Fcn75iWf0=
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a/go.mod h1:7B/5XWh1HYwJk3DzWeNoxOSI+nGx1m5UyYfHLFuKzkw=
|
||||
cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
|
||||
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
|
||||
cosmossdk.io/core v0.12.0 h1:aFuvkG6eDv0IQC+UDjx86wxNWVAxdCFk7OABJ1Vh4RU=
|
||||
|
||||
@ -3,7 +3,7 @@ module cosmossdk.io/x/protocolpool
|
||||
go 1.21
|
||||
|
||||
require (
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a
|
||||
cosmossdk.io/collections v0.4.0
|
||||
cosmossdk.io/core v0.12.0
|
||||
cosmossdk.io/depinject v1.0.0-alpha.4
|
||||
|
||||
@ -35,8 +35,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl
|
||||
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
|
||||
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
|
||||
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54 h1:c7kl5S1ME0q2g/7cdxngOAZr6N/5L7vVibmrmQZrQ0U=
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54/go.mod h1:7B/5XWh1HYwJk3DzWeNoxOSI+nGx1m5UyYfHLFuKzkw=
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a h1:Zr++x1RCJWi+K8bTZsQKdjtL4SzyHBLGM3Fcn75iWf0=
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a/go.mod h1:7B/5XWh1HYwJk3DzWeNoxOSI+nGx1m5UyYfHLFuKzkw=
|
||||
cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
|
||||
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
|
||||
cosmossdk.io/core v0.12.0 h1:aFuvkG6eDv0IQC+UDjx86wxNWVAxdCFk7OABJ1Vh4RU=
|
||||
|
||||
@ -46,8 +46,13 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
|
||||
Example: fmt.Sprintf("%s tx slashing unjail --from [validator]", version.AppName),
|
||||
},
|
||||
{
|
||||
RpcMethod: "UpdateParams",
|
||||
Skip: true, // skipped because authority gated
|
||||
RpcMethod: "UpdateParams",
|
||||
Use: "update-params-proposal [params]",
|
||||
Short: "Submit a proposal to update slashing module params. Note: the entire params must be provided.",
|
||||
Long: fmt.Sprintf("Submit a proposal to update slashing module params. Note: the entire params must be provided.\n See the fields to fill in by running `%s query slashing params --output json`", version.AppName),
|
||||
Example: fmt.Sprintf(`%s tx slashing update-params-proposal '{ "signed_blocks_window": "100", ... }'`, version.AppName),
|
||||
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "params"}},
|
||||
GovProposal: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@ -3,7 +3,7 @@ module cosmossdk.io/x/slashing
|
||||
go 1.21
|
||||
|
||||
require (
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a
|
||||
cosmossdk.io/collections v0.4.0
|
||||
cosmossdk.io/core v0.12.0
|
||||
cosmossdk.io/depinject v1.0.0-alpha.4
|
||||
|
||||
@ -35,8 +35,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl
|
||||
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
|
||||
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
|
||||
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54 h1:c7kl5S1ME0q2g/7cdxngOAZr6N/5L7vVibmrmQZrQ0U=
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54/go.mod h1:7B/5XWh1HYwJk3DzWeNoxOSI+nGx1m5UyYfHLFuKzkw=
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a h1:Zr++x1RCJWi+K8bTZsQKdjtL4SzyHBLGM3Fcn75iWf0=
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a/go.mod h1:7B/5XWh1HYwJk3DzWeNoxOSI+nGx1m5UyYfHLFuKzkw=
|
||||
cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
|
||||
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
|
||||
cosmossdk.io/core v0.12.0 h1:aFuvkG6eDv0IQC+UDjx86wxNWVAxdCFk7OABJ1Vh4RU=
|
||||
|
||||
@ -174,8 +174,13 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
|
||||
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "validator_address"}, {ProtoField: "amount"}, {ProtoField: "creation_height"}},
|
||||
},
|
||||
{
|
||||
RpcMethod: "UpdateParams",
|
||||
Skip: true, // skipped because authority gated
|
||||
RpcMethod: "UpdateParams",
|
||||
Use: "update-params-proposal [params]",
|
||||
Short: "Submit a proposal to update staking module params. Note: the entire params must be provided.",
|
||||
Long: fmt.Sprintf("Submit a proposal to update staking module params. Note: the entire params must be provided.\n See the fields to fill in by running `%s query staking params --output json`", version.AppName),
|
||||
Example: fmt.Sprintf(`%s tx staking update-params-proposal '{ "unbonding_time": "504h0m0s", ... }'`, version.AppName),
|
||||
PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "params"}},
|
||||
GovProposal: true,
|
||||
},
|
||||
},
|
||||
EnhanceCustomCommand: true,
|
||||
|
||||
@ -3,7 +3,7 @@ module cosmossdk.io/x/staking
|
||||
go 1.21
|
||||
|
||||
require (
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a
|
||||
cosmossdk.io/collections v0.4.0
|
||||
cosmossdk.io/core v0.12.0
|
||||
cosmossdk.io/depinject v1.0.0-alpha.4
|
||||
|
||||
@ -35,8 +35,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl
|
||||
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
|
||||
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
|
||||
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54 h1:c7kl5S1ME0q2g/7cdxngOAZr6N/5L7vVibmrmQZrQ0U=
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54/go.mod h1:7B/5XWh1HYwJk3DzWeNoxOSI+nGx1m5UyYfHLFuKzkw=
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a h1:Zr++x1RCJWi+K8bTZsQKdjtL4SzyHBLGM3Fcn75iWf0=
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a/go.mod h1:7B/5XWh1HYwJk3DzWeNoxOSI+nGx1m5UyYfHLFuKzkw=
|
||||
cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
|
||||
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
|
||||
cosmossdk.io/core v0.12.0 h1:aFuvkG6eDv0IQC+UDjx86wxNWVAxdCFk7OABJ1Vh4RU=
|
||||
|
||||
@ -49,15 +49,18 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
|
||||
Tx: &autocliv1.ServiceCommandDescriptor{
|
||||
Service: upgradev1beta1.Msg_ServiceDesc.ServiceName,
|
||||
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
|
||||
{
|
||||
RpcMethod: "CancelUpgrade",
|
||||
Use: "cancel-upgrade-proposal",
|
||||
Short: "Submit a proposal to cancel a planned chain upgrade.",
|
||||
GovProposal: true,
|
||||
},
|
||||
{
|
||||
RpcMethod: "SoftwareUpgrade",
|
||||
Skip: true, // skipped because authority gated
|
||||
},
|
||||
{
|
||||
RpcMethod: "CancelUpgrade",
|
||||
Skip: true, // skipped because authority gated
|
||||
},
|
||||
},
|
||||
EnhanceCustomCommand: true,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@ -36,13 +36,13 @@ func GetTxCmd() *cobra.Command {
|
||||
|
||||
cmd.AddCommand(
|
||||
NewCmdSubmitUpgradeProposal(),
|
||||
NewCmdSubmitCancelUpgradeProposal(),
|
||||
)
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
||||
// NewCmdSubmitUpgradeProposal implements a command handler for submitting a software upgrade proposal transaction.
|
||||
// This commands is not migrated to autocli as it contains extra validation that is useful for submitting upgrade proposals.
|
||||
func NewCmdSubmitUpgradeProposal() *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "software-upgrade [name] (--upgrade-height [height]) (--upgrade-info [info]) [flags]",
|
||||
@ -136,60 +136,6 @@ func NewCmdSubmitUpgradeProposal() *cobra.Command {
|
||||
return cmd
|
||||
}
|
||||
|
||||
// NewCmdSubmitCancelUpgradeProposal implements a command handler for submitting a software upgrade cancel proposal transaction.
|
||||
func NewCmdSubmitCancelUpgradeProposal() *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "cancel-software-upgrade [flags]",
|
||||
Args: cobra.ExactArgs(0),
|
||||
Short: "Cancel the current software upgrade proposal",
|
||||
Long: "Cancel a software upgrade along with an initial deposit.",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
clientCtx, err := client.GetClientTxContext(cmd)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
proposal, err := cli.ReadGovPropFlags(clientCtx, cmd.Flags())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
authority, _ := cmd.Flags().GetString(FlagAuthority)
|
||||
if authority != "" {
|
||||
if _, err = clientCtx.AddressCodec.StringToBytes(authority); err != nil {
|
||||
return fmt.Errorf("invalid authority address: %w", err)
|
||||
}
|
||||
} else {
|
||||
if authority, err = clientCtx.AddressCodec.BytesToString(address.Module("gov")); err != nil {
|
||||
return fmt.Errorf("failed to convert authority address to string: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
if err := proposal.SetMsgs([]sdk.Msg{
|
||||
&types.MsgCancelUpgrade{
|
||||
Authority: authority,
|
||||
},
|
||||
}); err != nil {
|
||||
return fmt.Errorf("failed to create cancel upgrade proposal message: %w", err)
|
||||
}
|
||||
|
||||
return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), proposal)
|
||||
},
|
||||
}
|
||||
|
||||
cmd.Flags().String(FlagAuthority, "", "The address of the upgrade module authority (defaults to gov)")
|
||||
|
||||
// add common proposal flags
|
||||
flags.AddTxFlagsToCmd(cmd)
|
||||
cli.AddGovPropFlagsToCmd(cmd)
|
||||
err := cmd.MarkFlagRequired(cli.FlagTitle)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
||||
// getDefaultDaemonName gets the default name to use for the daemon.
|
||||
// If a DAEMON_NAME env var is set, that is used.
|
||||
// Otherwise, the last part of the currently running executable is used.
|
||||
|
||||
@ -3,7 +3,7 @@ module cosmossdk.io/x/upgrade
|
||||
go 1.21
|
||||
|
||||
require (
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a
|
||||
cosmossdk.io/core v0.12.0
|
||||
cosmossdk.io/depinject v1.0.0-alpha.4
|
||||
cosmossdk.io/errors v1.0.0
|
||||
|
||||
@ -187,8 +187,8 @@ cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xX
|
||||
cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg=
|
||||
cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0=
|
||||
cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M=
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54 h1:c7kl5S1ME0q2g/7cdxngOAZr6N/5L7vVibmrmQZrQ0U=
|
||||
cosmossdk.io/api v0.7.3-0.20231029200940-6af7f30bfd54/go.mod h1:7B/5XWh1HYwJk3DzWeNoxOSI+nGx1m5UyYfHLFuKzkw=
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a h1:Zr++x1RCJWi+K8bTZsQKdjtL4SzyHBLGM3Fcn75iWf0=
|
||||
cosmossdk.io/api v0.7.3-0.20231113122742-912390d5fc4a/go.mod h1:7B/5XWh1HYwJk3DzWeNoxOSI+nGx1m5UyYfHLFuKzkw=
|
||||
cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
|
||||
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
|
||||
cosmossdk.io/core v0.12.0 h1:aFuvkG6eDv0IQC+UDjx86wxNWVAxdCFk7OABJ1Vh4RU=
|
||||
|
||||
Loading…
Reference in New Issue
Block a user