Merge PR #5442: Remove of the client/alias.go
This commit is contained in:
parent
d12919987a
commit
8353680115
|
@ -50,6 +50,8 @@ logic has been implemented for v0.38 target version. Applications can migrate vi
|
|||
|
||||
### API Breaking Changes
|
||||
|
||||
* (client) [\#5442](https://github.com/cosmos/cosmos-sdk/pull/5442) Remove client/alias.go as it's not necessary and
|
||||
components can be imported directly from the packages.
|
||||
* (store) [\#4748](https://github.com/cosmos/cosmos-sdk/pull/4748) The `CommitMultiStore` interface
|
||||
now requires a `SetInterBlockCache` method. Applications that do not wish to support this can simply
|
||||
have this method perform a no-op.
|
||||
|
|
129
client/alias.go
129
client/alias.go
|
@ -1,129 +0,0 @@
|
|||
// nolint
|
||||
// autogenerated code using github.com/rigelrozanski/multitool
|
||||
// aliases generated for the following subdirectories:
|
||||
// ALIASGEN: github.com/cosmos/cosmos-sdk/client/context
|
||||
// ALIASGEN: github.com/cosmos/cosmos-sdk/client/flags
|
||||
// ALIASGEN: github.com/cosmos/cosmos-sdk/client/keys
|
||||
// ALIASGEN: github.com/cosmos/cosmos-sdk/client/lcd
|
||||
// ALIASGEN: github.com/cosmos/cosmos-sdk/client/rest
|
||||
// ALIASGEN: github.com/cosmos/cosmos-sdk/client/rpc
|
||||
// ALIASGEN: github.com/cosmos/cosmos-sdk/client/tx
|
||||
// ALIASGEN: github.com/cosmos/cosmos-sdk/client/utils
|
||||
// ALIASGEN: github.com/cosmos/cosmos-sdk/client/input
|
||||
package client
|
||||
|
||||
import (
|
||||
"github.com/cosmos/cosmos-sdk/client/context"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/cosmos/cosmos-sdk/client/input"
|
||||
"github.com/cosmos/cosmos-sdk/client/keys"
|
||||
"github.com/cosmos/cosmos-sdk/client/lcd"
|
||||
"github.com/cosmos/cosmos-sdk/client/rpc"
|
||||
)
|
||||
|
||||
const (
|
||||
DefaultGasAdjustment = flags.DefaultGasAdjustment
|
||||
DefaultGasLimit = flags.DefaultGasLimit
|
||||
DefaultKeyringBackend = flags.DefaultKeyringBackend
|
||||
GasFlagAuto = flags.GasFlagAuto
|
||||
BroadcastBlock = flags.BroadcastBlock
|
||||
BroadcastSync = flags.BroadcastSync
|
||||
BroadcastAsync = flags.BroadcastAsync
|
||||
FlagHome = flags.FlagHome
|
||||
FlagUseLedger = flags.FlagUseLedger
|
||||
FlagChainID = flags.FlagChainID
|
||||
FlagNode = flags.FlagNode
|
||||
FlagHeight = flags.FlagHeight
|
||||
FlagGasAdjustment = flags.FlagGasAdjustment
|
||||
FlagTrustNode = flags.FlagTrustNode
|
||||
FlagFrom = flags.FlagFrom
|
||||
FlagName = flags.FlagName
|
||||
FlagAccountNumber = flags.FlagAccountNumber
|
||||
FlagSequence = flags.FlagSequence
|
||||
FlagMemo = flags.FlagMemo
|
||||
FlagFees = flags.FlagFees
|
||||
FlagGasPrices = flags.FlagGasPrices
|
||||
FlagBroadcastMode = flags.FlagBroadcastMode
|
||||
FlagDryRun = flags.FlagDryRun
|
||||
FlagGenerateOnly = flags.FlagGenerateOnly
|
||||
FlagIndentResponse = flags.FlagIndentResponse
|
||||
FlagKeyringBackend = flags.FlagKeyringBackend
|
||||
FlagListenAddr = flags.FlagListenAddr
|
||||
FlagMaxOpenConnections = flags.FlagMaxOpenConnections
|
||||
FlagRPCReadTimeout = flags.FlagRPCReadTimeout
|
||||
FlagRPCWriteTimeout = flags.FlagRPCWriteTimeout
|
||||
FlagOutputDocument = flags.FlagOutputDocument
|
||||
FlagSkipConfirmation = flags.FlagSkipConfirmation
|
||||
KeyringBackendFile = flags.KeyringBackendFile
|
||||
KeyringBackendOS = flags.KeyringBackendOS
|
||||
KeyringBackendTest = flags.KeyringBackendTest
|
||||
DefaultKeyPass = keys.DefaultKeyPass
|
||||
FlagAddress = keys.FlagAddress
|
||||
FlagPublicKey = keys.FlagPublicKey
|
||||
FlagBechPrefix = keys.FlagBechPrefix
|
||||
FlagDevice = keys.FlagDevice
|
||||
OutputFormatText = keys.OutputFormatText
|
||||
OutputFormatJSON = keys.OutputFormatJSON
|
||||
MinPassLength = input.MinPassLength
|
||||
)
|
||||
|
||||
var (
|
||||
// functions aliases
|
||||
NewCLIContextWithFrom = context.NewCLIContextWithFrom
|
||||
NewCLIContextWithInput = context.NewCLIContextWithInput
|
||||
NewCLIContextWithInputAndFrom = context.NewCLIContextWithInputAndFrom
|
||||
NewCLIContext = context.NewCLIContext
|
||||
GetFromFields = context.GetFromFields
|
||||
ErrInvalidAccount = context.ErrInvalidAccount
|
||||
ErrVerifyCommit = context.ErrVerifyCommit
|
||||
GetCommands = flags.GetCommands
|
||||
PostCommands = flags.PostCommands
|
||||
RegisterRestServerFlags = flags.RegisterRestServerFlags
|
||||
ParseGas = flags.ParseGas
|
||||
NewCompletionCmd = flags.NewCompletionCmd
|
||||
MarshalJSON = keys.MarshalJSON
|
||||
UnmarshalJSON = keys.UnmarshalJSON
|
||||
Commands = keys.Commands
|
||||
NewAddNewKey = keys.NewAddNewKey
|
||||
NewRecoverKey = keys.NewRecoverKey
|
||||
NewUpdateKeyReq = keys.NewUpdateKeyReq
|
||||
NewDeleteKeyReq = keys.NewDeleteKeyReq
|
||||
NewKeyringFromDir = keys.NewKeyringFromDir
|
||||
NewKeyringFromHomeFlag = keys.NewKeyringFromHomeFlag
|
||||
NewInMemoryKeyBase = keys.NewInMemoryKeyBase
|
||||
NewRestServer = lcd.NewRestServer
|
||||
ServeCommand = lcd.ServeCommand
|
||||
BlockCommand = rpc.BlockCommand
|
||||
GetChainHeight = rpc.GetChainHeight
|
||||
BlockRequestHandlerFn = rpc.BlockRequestHandlerFn
|
||||
LatestBlockRequestHandlerFn = rpc.LatestBlockRequestHandlerFn
|
||||
RegisterRPCRoutes = rpc.RegisterRPCRoutes
|
||||
StatusCommand = rpc.StatusCommand
|
||||
NodeInfoRequestHandlerFn = rpc.NodeInfoRequestHandlerFn
|
||||
NodeSyncingRequestHandlerFn = rpc.NodeSyncingRequestHandlerFn
|
||||
ValidatorCommand = rpc.ValidatorCommand
|
||||
GetValidators = rpc.GetValidators
|
||||
ValidatorSetRequestHandlerFn = rpc.ValidatorSetRequestHandlerFn
|
||||
LatestValidatorSetRequestHandlerFn = rpc.LatestValidatorSetRequestHandlerFn
|
||||
GetPassword = input.GetPassword
|
||||
GetCheckPassword = input.GetCheckPassword
|
||||
GetConfirmation = input.GetConfirmation
|
||||
GetString = input.GetString
|
||||
PrintPrefixed = input.PrintPrefixed
|
||||
|
||||
// variable aliases
|
||||
LineBreak = flags.LineBreak
|
||||
GasFlagVar = flags.GasFlagVar
|
||||
)
|
||||
|
||||
type (
|
||||
CLIContext = context.CLIContext
|
||||
GasSetting = flags.GasSetting
|
||||
AddNewKey = keys.AddNewKey
|
||||
RecoverKey = keys.RecoverKey
|
||||
UpdateKeyReq = keys.UpdateKeyReq
|
||||
DeleteKeyReq = keys.DeleteKeyReq
|
||||
RestServer = lcd.RestServer
|
||||
ValidatorOutput = rpc.ValidatorOutput
|
||||
ResultValidatorsOutput = rpc.ResultValidatorsOutput
|
||||
)
|
|
@ -4,9 +4,10 @@ import (
|
|||
"github.com/gorilla/mux"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client/context"
|
||||
"github.com/cosmos/cosmos-sdk/client/rpc"
|
||||
)
|
||||
|
||||
// Register routes
|
||||
func RegisterRoutes(cliCtx context.CLIContext, r *mux.Router) {
|
||||
RegisterRPCRoutes(cliCtx, r)
|
||||
rpc.RegisterRPCRoutes(cliCtx, r)
|
||||
}
|
||||
|
|
|
@ -10,8 +10,8 @@ import (
|
|||
"github.com/spf13/cobra"
|
||||
"github.com/tendermint/go-amino"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/context"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
"github.com/cosmos/cosmos-sdk/version"
|
||||
"github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
|
@ -43,7 +43,7 @@ func GetDecodeCommand(codec *amino.Codec) *cobra.Command {
|
|||
},
|
||||
}
|
||||
|
||||
return client.PostCommands(cmd)[0]
|
||||
return flags.PostCommands(cmd)[0]
|
||||
}
|
||||
|
||||
// GetDecodeTxCmd - returns the command to decode a tx from hex or base64
|
||||
|
|
|
@ -10,10 +10,10 @@ import (
|
|||
"github.com/pkg/errors"
|
||||
"github.com/spf13/viper"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/context"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/cosmos/cosmos-sdk/client/input"
|
||||
"github.com/cosmos/cosmos-sdk/client/keys"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||
|
@ -94,7 +94,7 @@ func CompleteAndBroadcastTxCLI(txBldr authtypes.TxBuilder, cliCtx context.CLICon
|
|||
}
|
||||
|
||||
// build and sign the transaction
|
||||
txBytes, err := txBldr.BuildAndSign(fromName, client.DefaultKeyPass, msgs)
|
||||
txBytes, err := txBldr.BuildAndSign(fromName, keys.DefaultKeyPass, msgs)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -192,7 +192,7 @@ func SignStdTx(
|
|||
}
|
||||
}
|
||||
|
||||
return txBldr.SignStdTx(name, client.DefaultKeyPass, stdTx, appendSig)
|
||||
return txBldr.SignStdTx(name, keys.DefaultKeyPass, stdTx, appendSig)
|
||||
}
|
||||
|
||||
// SignStdTxWithSignerAddress attaches a signature to a StdTx and returns a copy of a it.
|
||||
|
@ -214,7 +214,7 @@ func SignStdTxWithSignerAddress(txBldr authtypes.TxBuilder, cliCtx context.CLICo
|
|||
}
|
||||
}
|
||||
|
||||
return txBldr.SignStdTx(name, client.DefaultKeyPass, stdTx, false)
|
||||
return txBldr.SignStdTx(name, keys.DefaultKeyPass, stdTx, false)
|
||||
}
|
||||
|
||||
// Read and decode a StdTx from the given filename. Can pass "-" to read from stdin.
|
||||
|
|
|
@ -7,6 +7,7 @@ import (
|
|||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/context"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/auth"
|
||||
|
@ -57,7 +58,7 @@ func SendTxCmd(cdc *codec.Codec) *cobra.Command {
|
|||
},
|
||||
}
|
||||
|
||||
cmd = client.PostCommands(cmd)[0]
|
||||
cmd = flags.PostCommands(cmd)[0]
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ import (
|
|||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/context"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/auth"
|
||||
|
@ -46,7 +47,7 @@ func GetTxCmd(cdc *codec.Codec) *cobra.Command {
|
|||
RunE: client.ValidateCmd,
|
||||
}
|
||||
|
||||
txCmd.AddCommand(client.PostCommands(
|
||||
txCmd.AddCommand(flags.PostCommands(
|
||||
GetCmdInvariantBroken(cdc),
|
||||
)...)
|
||||
return txCmd
|
||||
|
|
|
@ -9,6 +9,7 @@ import (
|
|||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/context"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/version"
|
||||
|
@ -26,7 +27,7 @@ func GetQueryCmd(queryRoute string, cdc *codec.Codec) *cobra.Command {
|
|||
RunE: client.ValidateCmd,
|
||||
}
|
||||
|
||||
distQueryCmd.AddCommand(client.GetCommands(
|
||||
distQueryCmd.AddCommand(flags.GetCommands(
|
||||
GetCmdQueryParams(queryRoute, cdc),
|
||||
GetCmdQueryValidatorOutstandingRewards(queryRoute, cdc),
|
||||
GetCmdQueryValidatorCommission(queryRoute, cdc),
|
||||
|
|
|
@ -11,6 +11,7 @@ import (
|
|||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/context"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/version"
|
||||
|
@ -43,7 +44,7 @@ func GetTxCmd(storeKey string, cdc *codec.Codec) *cobra.Command {
|
|||
RunE: client.ValidateCmd,
|
||||
}
|
||||
|
||||
distTxCmd.AddCommand(client.PostCommands(
|
||||
distTxCmd.AddCommand(flags.PostCommands(
|
||||
GetCmdWithdrawRewards(cdc),
|
||||
GetCmdSetWithdrawAddr(cdc),
|
||||
GetCmdWithdrawAllRewards(cdc, storeKey),
|
||||
|
@ -150,7 +151,7 @@ $ %s tx distribution withdraw-all-rewards --from mykey
|
|||
// The transaction cannot be generated offline since it requires a query
|
||||
// to get all the validators.
|
||||
if cliCtx.GenerateOnly {
|
||||
return fmt.Errorf("command disabled with the provided flag: %s", client.FlagGenerateOnly)
|
||||
return fmt.Errorf("command disabled with the provided flag: %s", flags.FlagGenerateOnly)
|
||||
}
|
||||
|
||||
msgs, err := common.WithdrawAllDelegatorRewards(cliCtx, queryRoute, delAddr)
|
||||
|
|
|
@ -10,6 +10,7 @@ import (
|
|||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/context"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
"github.com/cosmos/cosmos-sdk/version"
|
||||
"github.com/cosmos/cosmos-sdk/x/evidence/exported"
|
||||
|
@ -46,9 +47,9 @@ $ %s query %s --page=2 --limit=50
|
|||
cmd.Flags().Int(flagPage, 1, "pagination page of evidence to to query for")
|
||||
cmd.Flags().Int(flagLimit, 100, "pagination limit of evidence to query for")
|
||||
|
||||
cmd.AddCommand(client.GetCommands(QueryParamsCmd(cdc))...)
|
||||
cmd.AddCommand(flags.GetCommands(QueryParamsCmd(cdc))...)
|
||||
|
||||
return client.GetCommands(cmd)[0]
|
||||
return flags.GetCommands(cmd)[0]
|
||||
}
|
||||
|
||||
// QueryParamsCmd returns the command handler for evidence parameter querying.
|
||||
|
|
|
@ -2,6 +2,7 @@ package cli
|
|||
|
||||
import (
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
"github.com/cosmos/cosmos-sdk/x/evidence/internal/types"
|
||||
|
||||
|
@ -24,7 +25,7 @@ func GetTxCmd(storeKey string, cdc *codec.Codec, childCmds []*cobra.Command) *co
|
|||
|
||||
submitEvidenceCmd := SubmitEvidenceCmd(cdc)
|
||||
for _, childCmd := range childCmds {
|
||||
submitEvidenceCmd.AddCommand(client.PostCommands(childCmd)[0])
|
||||
submitEvidenceCmd.AddCommand(flags.PostCommands(childCmd)[0])
|
||||
}
|
||||
|
||||
// TODO: Add tx commands.
|
||||
|
|
|
@ -10,7 +10,7 @@ import (
|
|||
"github.com/tendermint/tendermint/libs/cli"
|
||||
tmtypes "github.com/tendermint/tendermint/types"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
"github.com/cosmos/cosmos-sdk/server"
|
||||
"github.com/cosmos/cosmos-sdk/x/genutil"
|
||||
|
@ -29,7 +29,7 @@ func CollectGenTxsCmd(ctx *server.Context, cdc *codec.Codec,
|
|||
RunE: func(_ *cobra.Command, _ []string) error {
|
||||
config := ctx.Config
|
||||
config.SetRoot(viper.GetString(cli.HomeFlag))
|
||||
name := viper.GetString(client.FlagName)
|
||||
name := viper.GetString(flags.FlagName)
|
||||
nodeID, valPubKey, err := genutil.InitializeNodeValidatorFiles(config)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "failed to initialize node validator files")
|
||||
|
|
|
@ -21,9 +21,9 @@ import (
|
|||
"github.com/tendermint/tendermint/libs/common"
|
||||
tmtypes "github.com/tendermint/tendermint/types"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/context"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/cosmos/cosmos-sdk/client/keys"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
kbkeys "github.com/cosmos/cosmos-sdk/crypto/keys"
|
||||
"github.com/cosmos/cosmos-sdk/server"
|
||||
|
@ -64,7 +64,7 @@ func GenTxCmd(ctx *server.Context, cdc *codec.Codec, mbm module.BasicManager, sm
|
|||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
|
||||
config := ctx.Config
|
||||
config.SetRoot(viper.GetString(client.FlagHome))
|
||||
config.SetRoot(viper.GetString(flags.FlagHome))
|
||||
nodeID, valPubKey, err := genutil.InitializeNodeValidatorFiles(ctx.Config)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "failed to initialize node validator files")
|
||||
|
@ -97,19 +97,19 @@ func GenTxCmd(ctx *server.Context, cdc *codec.Codec, mbm module.BasicManager, sm
|
|||
}
|
||||
|
||||
inBuf := bufio.NewReader(cmd.InOrStdin())
|
||||
kb, err := client.NewKeyringFromDir(viper.GetString(flagClientHome), inBuf)
|
||||
kb, err := keys.NewKeyringFromDir(viper.GetString(flagClientHome), inBuf)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "failed to initialize keybase")
|
||||
}
|
||||
|
||||
name := viper.GetString(client.FlagName)
|
||||
name := viper.GetString(flags.FlagName)
|
||||
key, err := kb.Get(name)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "failed to read from keybase")
|
||||
}
|
||||
|
||||
// Set flags for creating gentx
|
||||
viper.Set(client.FlagHome, viper.GetString(flagClientHome))
|
||||
viper.Set(flags.FlagHome, viper.GetString(flagClientHome))
|
||||
smbh.PrepareFlagsForTxCreateValidator(config, nodeID, genDoc.ChainID, valPubKey)
|
||||
|
||||
// Fetch the amount of coins staked
|
||||
|
@ -125,14 +125,14 @@ func GenTxCmd(ctx *server.Context, cdc *codec.Codec, mbm module.BasicManager, sm
|
|||
}
|
||||
|
||||
txBldr := auth.NewTxBuilderFromCLI(inBuf).WithTxEncoder(utils.GetTxEncoder(cdc))
|
||||
cliCtx := client.NewCLIContextWithInput(inBuf).WithCodec(cdc)
|
||||
cliCtx := context.NewCLIContextWithInput(inBuf).WithCodec(cdc)
|
||||
|
||||
// Set the generate-only flag here after the CLI context has
|
||||
// been created. This allows the from name/key to be correctly populated.
|
||||
//
|
||||
// TODO: Consider removing the manual setting of generate-only in
|
||||
// favor of a 'gentx' flag in the create-validator command.
|
||||
viper.Set(client.FlagGenerateOnly, true)
|
||||
viper.Set(flags.FlagGenerateOnly, true)
|
||||
|
||||
// create a 'create-validator' message
|
||||
txBldr, msg, err := smbh.BuildCreateValidatorMsg(cliCtx, txBldr)
|
||||
|
@ -166,7 +166,7 @@ func GenTxCmd(ctx *server.Context, cdc *codec.Codec, mbm module.BasicManager, sm
|
|||
}
|
||||
|
||||
// Fetch output file name
|
||||
outputDocument := viper.GetString(client.FlagOutputDocument)
|
||||
outputDocument := viper.GetString(flags.FlagOutputDocument)
|
||||
if outputDocument == "" {
|
||||
outputDocument, err = makeOutputFilepath(config.RootDir, nodeID)
|
||||
if err != nil {
|
||||
|
@ -184,16 +184,16 @@ func GenTxCmd(ctx *server.Context, cdc *codec.Codec, mbm module.BasicManager, sm
|
|||
},
|
||||
}
|
||||
|
||||
cmd.Flags().String(client.FlagHome, defaultNodeHome, "node's home directory")
|
||||
cmd.Flags().String(flags.FlagHome, defaultNodeHome, "node's home directory")
|
||||
cmd.Flags().String(flagClientHome, defaultCLIHome, "client's home directory")
|
||||
cmd.Flags().String(client.FlagName, "", "name of private key with which to sign the gentx")
|
||||
cmd.Flags().String(client.FlagOutputDocument, "",
|
||||
cmd.Flags().String(flags.FlagName, "", "name of private key with which to sign the gentx")
|
||||
cmd.Flags().String(flags.FlagOutputDocument, "",
|
||||
"write the genesis transaction JSON document to the given file instead of the default location")
|
||||
cmd.Flags().AddFlagSet(fsCreateValidator)
|
||||
cmd.Flags().String(client.FlagKeyringBackend, client.DefaultKeyringBackend, "Select keyring's backend (os|file|test)")
|
||||
cmd.Flags().String(flags.FlagKeyringBackend, flags.DefaultKeyringBackend, "Select keyring's backend (os|file|test)")
|
||||
viper.BindPFlag(flags.FlagKeyringBackend, cmd.Flags().Lookup(flags.FlagKeyringBackend))
|
||||
|
||||
cmd.MarkFlagRequired(client.FlagName)
|
||||
cmd.MarkFlagRequired(flags.FlagName)
|
||||
return cmd
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ import (
|
|||
"github.com/tendermint/tendermint/libs/common"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
"github.com/cosmos/cosmos-sdk/server"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
|
@ -70,7 +70,7 @@ func InitCmd(ctx *server.Context, cdc *codec.Codec, mbm module.BasicManager,
|
|||
config := ctx.Config
|
||||
config.SetRoot(viper.GetString(cli.HomeFlag))
|
||||
|
||||
chainID := viper.GetString(client.FlagChainID)
|
||||
chainID := viper.GetString(flags.FlagChainID)
|
||||
if chainID == "" {
|
||||
chainID = fmt.Sprintf("test-chain-%v", common.RandStr(6))
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ func InitCmd(ctx *server.Context, cdc *codec.Codec, mbm module.BasicManager,
|
|||
|
||||
cmd.Flags().String(cli.HomeFlag, defaultNodeHome, "node's home directory")
|
||||
cmd.Flags().BoolP(flagOverwrite, "o", false, "overwrite the genesis.json file")
|
||||
cmd.Flags().String(client.FlagChainID, "", "genesis file chain-id, if left blank will be randomly created")
|
||||
cmd.Flags().String(flags.FlagChainID, "", "genesis file chain-id, if left blank will be randomly created")
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ import (
|
|||
"github.com/tendermint/tendermint/libs/cli"
|
||||
"github.com/tendermint/tendermint/libs/log"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
"github.com/cosmos/cosmos-sdk/server"
|
||||
"github.com/cosmos/cosmos-sdk/server/mock"
|
||||
|
@ -126,7 +126,7 @@ func TestInitNodeValidatorFiles(t *testing.T) {
|
|||
home, cleanup := tests.NewTestCaseDir(t)
|
||||
defer cleanup()
|
||||
viper.Set(cli.HomeFlag, home)
|
||||
viper.Set(client.FlagName, "moniker")
|
||||
viper.Set(flags.FlagName, "moniker")
|
||||
cfg, err := tcmd.ParseConfig()
|
||||
require.Nil(t, err)
|
||||
nodeID, valPubKey, err := genutil.InitializeNodeValidatorFiles(cfg)
|
||||
|
|
|
@ -12,7 +12,7 @@ import (
|
|||
"github.com/tendermint/tendermint/libs/cli"
|
||||
"github.com/tendermint/tendermint/libs/log"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/cosmos/cosmos-sdk/server"
|
||||
"github.com/cosmos/cosmos-sdk/tests"
|
||||
)
|
||||
|
@ -39,7 +39,7 @@ func TestGetMigrationCallback(t *testing.T) {
|
|||
func TestMigrateGenesis(t *testing.T) {
|
||||
home, cleanup := tests.NewTestCaseDir(t)
|
||||
viper.Set(cli.HomeFlag, home)
|
||||
viper.Set(client.FlagName, "moniker")
|
||||
viper.Set(flags.FlagName, "moniker")
|
||||
logger := log.NewNopLogger()
|
||||
cfg, err := tcmd.ParseConfig()
|
||||
require.Nil(t, err)
|
||||
|
|
|
@ -10,6 +10,7 @@ import (
|
|||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/context"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/version"
|
||||
|
@ -29,7 +30,7 @@ func GetQueryCmd(queryRoute string, cdc *codec.Codec) *cobra.Command {
|
|||
RunE: client.ValidateCmd,
|
||||
}
|
||||
|
||||
govQueryCmd.AddCommand(client.GetCommands(
|
||||
govQueryCmd.AddCommand(flags.GetCommands(
|
||||
GetCmdQueryProposal(queryRoute, cdc),
|
||||
GetCmdQueryProposals(queryRoute, cdc),
|
||||
GetCmdQueryVote(queryRoute, cdc),
|
||||
|
|
|
@ -10,6 +10,7 @@ import (
|
|||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/context"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/version"
|
||||
|
@ -66,10 +67,10 @@ func GetTxCmd(storeKey string, cdc *codec.Codec, pcmds []*cobra.Command) *cobra.
|
|||
|
||||
cmdSubmitProp := GetCmdSubmitProposal(cdc)
|
||||
for _, pcmd := range pcmds {
|
||||
cmdSubmitProp.AddCommand(client.PostCommands(pcmd)[0])
|
||||
cmdSubmitProp.AddCommand(flags.PostCommands(pcmd)[0])
|
||||
}
|
||||
|
||||
govTxCmd.AddCommand(client.PostCommands(
|
||||
govTxCmd.AddCommand(flags.PostCommands(
|
||||
GetCmdDeposit(cdc),
|
||||
GetCmdVote(cdc),
|
||||
cmdSubmitProp,
|
||||
|
|
|
@ -7,6 +7,7 @@ import (
|
|||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/context"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/mint/internal/types"
|
||||
|
@ -23,7 +24,7 @@ func GetQueryCmd(cdc *codec.Codec) *cobra.Command {
|
|||
}
|
||||
|
||||
mintingQueryCmd.AddCommand(
|
||||
client.GetCommands(
|
||||
flags.GetCommands(
|
||||
GetCmdQueryParams(cdc),
|
||||
GetCmdQueryInflation(cdc),
|
||||
GetCmdQueryAnnualProvisions(cdc),
|
||||
|
|
|
@ -8,6 +8,7 @@ import (
|
|||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/context"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
|
||||
|
@ -26,7 +27,7 @@ func GetQueryCmd(queryRoute string, cdc *codec.Codec) *cobra.Command {
|
|||
}
|
||||
|
||||
slashingQueryCmd.AddCommand(
|
||||
client.GetCommands(
|
||||
flags.GetCommands(
|
||||
GetCmdQuerySigningInfo(queryRoute, cdc),
|
||||
GetCmdQueryParams(cdc),
|
||||
)...,
|
||||
|
|
|
@ -7,6 +7,7 @@ import (
|
|||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/context"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/auth"
|
||||
|
@ -24,7 +25,7 @@ func GetTxCmd(cdc *codec.Codec) *cobra.Command {
|
|||
RunE: client.ValidateCmd,
|
||||
}
|
||||
|
||||
slashingTxCmd.AddCommand(client.PostCommands(
|
||||
slashingTxCmd.AddCommand(flags.PostCommands(
|
||||
GetCmdUnjail(cdc),
|
||||
)...)
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ import (
|
|||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/context"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/version"
|
||||
|
@ -24,7 +25,7 @@ func GetQueryCmd(queryRoute string, cdc *codec.Codec) *cobra.Command {
|
|||
SuggestionsMinimumDistance: 2,
|
||||
RunE: client.ValidateCmd,
|
||||
}
|
||||
stakingQueryCmd.AddCommand(client.GetCommands(
|
||||
stakingQueryCmd.AddCommand(flags.GetCommands(
|
||||
GetCmdQueryDelegation(queryRoute, cdc),
|
||||
GetCmdQueryDelegations(queryRoute, cdc),
|
||||
GetCmdQueryUnbondingDelegation(queryRoute, cdc),
|
||||
|
|
|
@ -15,6 +15,7 @@ import (
|
|||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/context"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/version"
|
||||
|
@ -33,7 +34,7 @@ func GetTxCmd(storeKey string, cdc *codec.Codec) *cobra.Command {
|
|||
RunE: client.ValidateCmd,
|
||||
}
|
||||
|
||||
stakingTxCmd.AddCommand(client.PostCommands(
|
||||
stakingTxCmd.AddCommand(flags.PostCommands(
|
||||
GetCmdCreateValidator(cdc),
|
||||
GetCmdEditValidator(cdc),
|
||||
GetCmdDelegate(cdc),
|
||||
|
@ -69,10 +70,10 @@ func GetCmdCreateValidator(cdc *codec.Codec) *cobra.Command {
|
|||
cmd.Flags().AddFlagSet(FsCommissionCreate)
|
||||
cmd.Flags().AddFlagSet(FsMinSelfDelegation)
|
||||
|
||||
cmd.Flags().String(FlagIP, "", fmt.Sprintf("The node's public IP. It takes effect only when used in combination with --%s", client.FlagGenerateOnly))
|
||||
cmd.Flags().String(FlagIP, "", fmt.Sprintf("The node's public IP. It takes effect only when used in combination with --%s", flags.FlagGenerateOnly))
|
||||
cmd.Flags().String(FlagNodeID, "", "The node's ID")
|
||||
|
||||
cmd.MarkFlagRequired(client.FlagFrom)
|
||||
cmd.MarkFlagRequired(flags.FlagFrom)
|
||||
cmd.MarkFlagRequired(FlagAmount)
|
||||
cmd.MarkFlagRequired(FlagPubKey)
|
||||
cmd.MarkFlagRequired(FlagMoniker)
|
||||
|
@ -309,8 +310,8 @@ func PrepareFlagsForTxCreateValidator(
|
|||
details := viper.GetString(FlagDetails)
|
||||
identity := viper.GetString(FlagIdentity)
|
||||
|
||||
viper.Set(client.FlagChainID, chainID)
|
||||
viper.Set(client.FlagFrom, viper.GetString(client.FlagName))
|
||||
viper.Set(flags.FlagChainID, chainID)
|
||||
viper.Set(flags.FlagFrom, viper.GetString(flags.FlagName))
|
||||
viper.Set(FlagNodeID, nodeID)
|
||||
viper.Set(FlagIP, ip)
|
||||
viper.Set(FlagPubKey, sdk.MustBech32ifyConsPub(valPubKey))
|
||||
|
@ -321,7 +322,7 @@ func PrepareFlagsForTxCreateValidator(
|
|||
viper.Set(FlagIdentity, identity)
|
||||
|
||||
if config.Moniker == "" {
|
||||
viper.Set(FlagMoniker, viper.GetString(client.FlagName))
|
||||
viper.Set(FlagMoniker, viper.GetString(flags.FlagName))
|
||||
}
|
||||
if viper.GetString(FlagAmount) == "" {
|
||||
viper.Set(FlagAmount, defaultAmount)
|
||||
|
@ -384,7 +385,7 @@ func BuildCreateValidatorMsg(cliCtx context.CLIContext, txBldr auth.TxBuilder) (
|
|||
sdk.ValAddress(valAddr), pk, amount, description, commissionRates, minSelfDelegation,
|
||||
)
|
||||
|
||||
if viper.GetBool(client.FlagGenerateOnly) {
|
||||
if viper.GetBool(flags.FlagGenerateOnly) {
|
||||
ip := viper.GetString(FlagIP)
|
||||
nodeID := viper.GetString(FlagNodeID)
|
||||
if nodeID != "" && ip != "" {
|
||||
|
|
|
@ -8,6 +8,7 @@ import (
|
|||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/context"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/version"
|
||||
|
@ -25,7 +26,7 @@ func GetQueryCmd(cdc *codec.Codec) *cobra.Command {
|
|||
RunE: client.ValidateCmd,
|
||||
}
|
||||
|
||||
supplyQueryCmd.AddCommand(client.GetCommands(
|
||||
supplyQueryCmd.AddCommand(flags.GetCommands(
|
||||
GetCmdQueryTotalSupply(cdc),
|
||||
)...)
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@ import (
|
|||
"github.com/gorilla/mux"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/context"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/types/module"
|
||||
|
@ -52,7 +52,7 @@ func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command {
|
|||
Use: "upgrade",
|
||||
Short: "Querying commands for the upgrade module",
|
||||
}
|
||||
queryCmd.AddCommand(client.GetCommands(
|
||||
queryCmd.AddCommand(flags.GetCommands(
|
||||
cli.GetPlanCmd(StoreKey, cdc),
|
||||
cli.GetAppliedHeightCmd(StoreKey, cdc),
|
||||
)...)
|
||||
|
@ -66,7 +66,7 @@ func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command {
|
|||
Use: "upgrade",
|
||||
Short: "Upgrade transaction subcommands",
|
||||
}
|
||||
txCmd.AddCommand(client.PostCommands()...)
|
||||
txCmd.AddCommand(flags.PostCommands()...)
|
||||
return txCmd
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue