Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove of the client/alias.go #5442

Merged
merged 2 commits into from
Dec 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
129 changes: 0 additions & 129 deletions client/alias.go

This file was deleted.

3 changes: 2 additions & 1 deletion client/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
4 changes: 2 additions & 2 deletions x/auth/client/cli/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions x/auth/client/utils/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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.
Expand All @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion x/bank/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -57,7 +58,7 @@ func SendTxCmd(cdc *codec.Codec) *cobra.Command {
},
}

cmd = client.PostCommands(cmd)[0]
cmd = flags.PostCommands(cmd)[0]

return cmd
}
3 changes: 2 additions & 1 deletion x/crisis/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion x/distribution/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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),
Expand Down
5 changes: 3 additions & 2 deletions x/distribution/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions x/evidence/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion x/evidence/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions x/genutil/client/cli/collect.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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")
Expand Down
Loading