From d8642a941e3602d1f7c89d29c9d3e844e14e5919 Mon Sep 17 00:00:00 2001 From: Sam Kleinman Date: Tue, 24 Aug 2021 12:06:27 -0400 Subject: [PATCH] cmd: remove deprecated snakes (#6854) just following up on a deprecation. --- CHANGELOG_PENDING.md | 4 ++-- cmd/tendermint/commands/gen_node_key.go | 8 +++----- cmd/tendermint/commands/gen_validator.go | 8 +++----- cmd/tendermint/commands/probe_upnp.go | 8 +++----- cmd/tendermint/commands/replay.go | 6 ++---- cmd/tendermint/commands/reset_priv_validator.go | 16 ++++++---------- cmd/tendermint/commands/root.go | 8 -------- cmd/tendermint/commands/show_node_id.go | 8 +++----- cmd/tendermint/commands/show_validator.go | 8 +++----- 9 files changed, 25 insertions(+), 49 deletions(-) diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index bb5221bb5..233d11887 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -25,7 +25,7 @@ Friendly reminder: We have a [bug bounty program](https://hackerone.com/tendermi - [rpc/grpc] \#6725 Mark gRPC in the RPC layer as deprecated. - [blockchain/v2] \#6730 Fast Sync v2 is deprecated, please use v0 - [rpc] \#6820 Update RPC methods to reflect changes in the p2p layer, disabling support for `UnsafeDialPeers` and `UnsafeDialPeers` when used with the new p2p layer, and changing the response format of the peer list in `NetInfo` for all users. - + - [cli] \#6854 Remove deprecated snake case commands. (@tychoish) - Apps - [ABCI] \#6408 Change the `key` and `value` fields from `[]byte` to `string` in the `EventAttribute` type. (@alexanderbez) - [ABCI] \#5447 Remove `SetOption` method from `ABCI.Client` interface @@ -158,4 +158,4 @@ Friendly reminder: We have a [bug bounty program](https://hackerone.com/tendermi - [rpc] \#6507 Ensure RPC client can handle URLs without ports (@JayT106) - [statesync] \#6463 Adds Reverse Sync feature to fetch historical light blocks after state sync in order to verify any evidence (@cmwaters) - [fastsync] \#6590 Update the metrics during fast-sync (@JayT106) -- [gitignore] \#6668 Fix gitignore of abci-cli (@tanyabouman) \ No newline at end of file +- [gitignore] \#6668 Fix gitignore of abci-cli (@tanyabouman) diff --git a/cmd/tendermint/commands/gen_node_key.go b/cmd/tendermint/commands/gen_node_key.go index f796f4b7f..d8b493e3c 100644 --- a/cmd/tendermint/commands/gen_node_key.go +++ b/cmd/tendermint/commands/gen_node_key.go @@ -12,11 +12,9 @@ import ( // GenNodeKeyCmd allows the generation of a node key. It prints JSON-encoded // NodeKey to the standard output. var GenNodeKeyCmd = &cobra.Command{ - Use: "gen-node-key", - Aliases: []string{"gen_node_key"}, - Short: "Generate a new node key", - RunE: genNodeKey, - PreRun: deprecateSnakeCase, + Use: "gen-node-key", + Short: "Generate a new node key", + RunE: genNodeKey, } func genNodeKey(cmd *cobra.Command, args []string) error { diff --git a/cmd/tendermint/commands/gen_validator.go b/cmd/tendermint/commands/gen_validator.go index 09f84b09e..830518ce9 100644 --- a/cmd/tendermint/commands/gen_validator.go +++ b/cmd/tendermint/commands/gen_validator.go @@ -13,11 +13,9 @@ import ( // GenValidatorCmd allows the generation of a keypair for a // validator. var GenValidatorCmd = &cobra.Command{ - Use: "gen-validator", - Aliases: []string{"gen_validator"}, - Short: "Generate new validator keypair", - RunE: genValidator, - PreRun: deprecateSnakeCase, + Use: "gen-validator", + Short: "Generate new validator keypair", + RunE: genValidator, } func init() { diff --git a/cmd/tendermint/commands/probe_upnp.go b/cmd/tendermint/commands/probe_upnp.go index 4471024f9..4c71e099a 100644 --- a/cmd/tendermint/commands/probe_upnp.go +++ b/cmd/tendermint/commands/probe_upnp.go @@ -11,11 +11,9 @@ import ( // ProbeUpnpCmd adds capabilities to test the UPnP functionality. var ProbeUpnpCmd = &cobra.Command{ - Use: "probe-upnp", - Aliases: []string{"probe_upnp"}, - Short: "Test UPnP functionality", - RunE: probeUpnp, - PreRun: deprecateSnakeCase, + Use: "probe-upnp", + Short: "Test UPnP functionality", + RunE: probeUpnp, } func probeUpnp(cmd *cobra.Command, args []string) error { diff --git a/cmd/tendermint/commands/replay.go b/cmd/tendermint/commands/replay.go index 6e736bca2..e92274042 100644 --- a/cmd/tendermint/commands/replay.go +++ b/cmd/tendermint/commands/replay.go @@ -17,11 +17,9 @@ var ReplayCmd = &cobra.Command{ // ReplayConsoleCmd allows replaying of messages from the WAL in a // console. var ReplayConsoleCmd = &cobra.Command{ - Use: "replay-console", - Aliases: []string{"replay_console"}, - Short: "Replay messages from WAL in a console", + Use: "replay-console", + Short: "Replay messages from WAL in a console", Run: func(cmd *cobra.Command, args []string) { consensus.RunReplayFile(config.BaseConfig, config.Consensus, true) }, - PreRun: deprecateSnakeCase, } diff --git a/cmd/tendermint/commands/reset_priv_validator.go b/cmd/tendermint/commands/reset_priv_validator.go index 046780ef1..8745e55d8 100644 --- a/cmd/tendermint/commands/reset_priv_validator.go +++ b/cmd/tendermint/commands/reset_priv_validator.go @@ -14,11 +14,9 @@ import ( // ResetAllCmd removes the database of this Tendermint core // instance. var ResetAllCmd = &cobra.Command{ - Use: "unsafe-reset-all", - Aliases: []string{"unsafe_reset_all"}, - Short: "(unsafe) Remove all the data and WAL, reset this node's validator to genesis state", - RunE: resetAll, - PreRun: deprecateSnakeCase, + Use: "unsafe-reset-all", + Short: "(unsafe) Remove all the data and WAL, reset this node's validator to genesis state", + RunE: resetAll, } var keepAddrBook bool @@ -31,11 +29,9 @@ func init() { // ResetPrivValidatorCmd resets the private validator files. var ResetPrivValidatorCmd = &cobra.Command{ - Use: "unsafe-reset-priv-validator", - Aliases: []string{"unsafe_reset_priv_validator"}, - Short: "(unsafe) Reset this node's validator to genesis state", - RunE: resetPrivValidator, - PreRun: deprecateSnakeCase, + Use: "unsafe-reset-priv-validator", + Short: "(unsafe) Reset this node's validator to genesis state", + RunE: resetPrivValidator, } // XXX: this is totally unsafe. diff --git a/cmd/tendermint/commands/root.go b/cmd/tendermint/commands/root.go index 02f260de5..2289ae363 100644 --- a/cmd/tendermint/commands/root.go +++ b/cmd/tendermint/commands/root.go @@ -2,7 +2,6 @@ package commands import ( "fmt" - "strings" "time" "github.com/spf13/cobra" @@ -65,10 +64,3 @@ var RootCmd = &cobra.Command{ return nil }, } - -// deprecateSnakeCase is a util function for 0.34.1. Should be removed in 0.35 -func deprecateSnakeCase(cmd *cobra.Command, args []string) { - if strings.Contains(cmd.CalledAs(), "_") { - fmt.Println("Deprecated: snake_case commands will be replaced by hyphen-case commands in the next major release") - } -} diff --git a/cmd/tendermint/commands/show_node_id.go b/cmd/tendermint/commands/show_node_id.go index 7a5814c3b..488f4c322 100644 --- a/cmd/tendermint/commands/show_node_id.go +++ b/cmd/tendermint/commands/show_node_id.go @@ -8,11 +8,9 @@ import ( // ShowNodeIDCmd dumps node's ID to the standard output. var ShowNodeIDCmd = &cobra.Command{ - Use: "show-node-id", - Aliases: []string{"show_node_id"}, - Short: "Show this node's ID", - RunE: showNodeID, - PreRun: deprecateSnakeCase, + Use: "show-node-id", + Short: "Show this node's ID", + RunE: showNodeID, } func showNodeID(cmd *cobra.Command, args []string) error { diff --git a/cmd/tendermint/commands/show_validator.go b/cmd/tendermint/commands/show_validator.go index 240ed943f..47b372c61 100644 --- a/cmd/tendermint/commands/show_validator.go +++ b/cmd/tendermint/commands/show_validator.go @@ -16,11 +16,9 @@ import ( // ShowValidatorCmd adds capabilities for showing the validator info. var ShowValidatorCmd = &cobra.Command{ - Use: "show-validator", - Aliases: []string{"show_validator"}, - Short: "Show this node's validator info", - RunE: showValidator, - PreRun: deprecateSnakeCase, + Use: "show-validator", + Short: "Show this node's validator info", + RunE: showValidator, } func showValidator(cmd *cobra.Command, args []string) error {