From c245a3deb1b76251b8ea2de21c84e3aae5ce4de8 Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Thu, 22 Nov 2018 13:51:51 +0000 Subject: [PATCH 1/4] Don't get command through client.{Get,Post}Commands() Logic has changed recently and commands are now enriched with flags by default. Closes: #2884 --- docs/examples/basecoin/cmd/basecli/main.go | 52 +++++++++++----------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/docs/examples/basecoin/cmd/basecli/main.go b/docs/examples/basecoin/cmd/basecli/main.go index cb0eeba5b..36952be87 100644 --- a/docs/examples/basecoin/cmd/basecli/main.go +++ b/docs/examples/basecoin/cmd/basecli/main.go @@ -72,35 +72,33 @@ func main() { // add query/post commands (custom to binary) rootCmd.AddCommand( - client.GetCommands( - stakecmd.GetCmdQueryValidator(storeStake, cdc), - stakecmd.GetCmdQueryValidators(storeStake, cdc), - stakecmd.GetCmdQueryValidatorUnbondingDelegations(storeStake, cdc), - stakecmd.GetCmdQueryValidatorRedelegations(storeStake, cdc), - stakecmd.GetCmdQueryDelegation(storeStake, cdc), - stakecmd.GetCmdQueryDelegations(storeStake, cdc), - stakecmd.GetCmdQueryPool(storeStake, cdc), - stakecmd.GetCmdQueryParams(storeStake, cdc), - stakecmd.GetCmdQueryUnbondingDelegation(storeStake, cdc), - stakecmd.GetCmdQueryUnbondingDelegations(storeStake, cdc), - stakecmd.GetCmdQueryRedelegation(storeStake, cdc), - stakecmd.GetCmdQueryRedelegations(storeStake, cdc), - slashingcmd.GetCmdQuerySigningInfo(storeSlashing, cdc), - authcmd.GetAccountCmd(storeAcc, cdc), - )...) + stakecmd.GetCmdQueryValidator(storeStake, cdc), + stakecmd.GetCmdQueryValidators(storeStake, cdc), + stakecmd.GetCmdQueryValidatorUnbondingDelegations(storeStake, cdc), + stakecmd.GetCmdQueryValidatorRedelegations(storeStake, cdc), + stakecmd.GetCmdQueryDelegation(storeStake, cdc), + stakecmd.GetCmdQueryDelegations(storeStake, cdc), + stakecmd.GetCmdQueryPool(storeStake, cdc), + stakecmd.GetCmdQueryParams(storeStake, cdc), + stakecmd.GetCmdQueryUnbondingDelegation(storeStake, cdc), + stakecmd.GetCmdQueryUnbondingDelegations(storeStake, cdc), + stakecmd.GetCmdQueryRedelegation(storeStake, cdc), + stakecmd.GetCmdQueryRedelegations(storeStake, cdc), + slashingcmd.GetCmdQuerySigningInfo(storeSlashing, cdc), + authcmd.GetAccountCmd(storeAcc, cdc), + ) rootCmd.AddCommand( - client.PostCommands( - bankcmd.SendTxCmd(cdc), - ibccmd.IBCTransferCmd(cdc), - ibccmd.IBCRelayCmd(cdc), - stakecmd.GetCmdCreateValidator(cdc), - stakecmd.GetCmdEditValidator(cdc), - stakecmd.GetCmdDelegate(cdc), - stakecmd.GetCmdUnbond(storeStake, cdc), - stakecmd.GetCmdRedelegate(storeStake, cdc), - slashingcmd.GetCmdUnjail(cdc), - )...) + bankcmd.SendTxCmd(cdc), + ibccmd.IBCTransferCmd(cdc), + ibccmd.IBCRelayCmd(cdc), + stakecmd.GetCmdCreateValidator(cdc), + stakecmd.GetCmdEditValidator(cdc), + stakecmd.GetCmdDelegate(cdc), + stakecmd.GetCmdUnbond(storeStake, cdc), + stakecmd.GetCmdRedelegate(storeStake, cdc), + slashingcmd.GetCmdUnjail(cdc), + ) // add proxy, version and key info rootCmd.AddCommand( From 83793a8974a6750208cb027c0e36353acd39799d Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Thu, 22 Nov 2018 14:36:28 +0000 Subject: [PATCH 2/4] Update PENDING.md --- PENDING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/PENDING.md b/PENDING.md index 47c6ab60e..757447358 100644 --- a/PENDING.md +++ b/PENDING.md @@ -91,6 +91,7 @@ BUG FIXES - \#2733 [x/gov, x/mock/simulation] Fix governance simulation, update x/gov import/export - \#2854 [x/bank] Remove unused bank.MsgIssue, prevent possible panic + - \#2884 [docs/examples] Fix `basecli version` panic * Tendermint * [\#2797](https://github.com/tendermint/tendermint/pull/2797) AddressBook requires addresses to have IDs; Do not crap out immediately after sending pex addrs in seed mode From b8b502c43a8ae3e181a716274b2636936bf12feb Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Thu, 22 Nov 2018 14:42:35 +0000 Subject: [PATCH 3/4] Same for democli --- docs/examples/democoin/cmd/democli/main.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/docs/examples/democoin/cmd/democli/main.go b/docs/examples/democoin/cmd/democli/main.go index 0c37d9bd0..a001ee8b5 100644 --- a/docs/examples/democoin/cmd/democli/main.go +++ b/docs/examples/democoin/cmd/democli/main.go @@ -70,13 +70,11 @@ func main() { // add query/post commands (custom to binary) // start with commands common to basecoin rootCmd.AddCommand( - client.GetCommands( - authcmd.GetAccountCmd(storeAcc, cdc), - )...) + authcmd.GetAccountCmd(storeAcc, cdc), + ) rootCmd.AddCommand( - client.PostCommands( - bankcmd.SendTxCmd(cdc), - )...) + bankcmd.SendTxCmd(cdc), + ) rootCmd.AddCommand( client.PostCommands( simplestakingcmd.BondTxCmd(cdc), From c22b400ba84a3dd4cc5b860939609786ae803767 Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Thu, 22 Nov 2018 15:49:56 +0000 Subject: [PATCH 4/4] Add missing cmd --- docs/examples/basecoin/cmd/basecli/main.go | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/examples/basecoin/cmd/basecli/main.go b/docs/examples/basecoin/cmd/basecli/main.go index 36952be87..8093dd3b1 100644 --- a/docs/examples/basecoin/cmd/basecli/main.go +++ b/docs/examples/basecoin/cmd/basecli/main.go @@ -85,6 +85,7 @@ func main() { stakecmd.GetCmdQueryRedelegation(storeStake, cdc), stakecmd.GetCmdQueryRedelegations(storeStake, cdc), slashingcmd.GetCmdQuerySigningInfo(storeSlashing, cdc), + stakecmd.GetCmdQueryValidatorDelegations(storeStake, cdc), authcmd.GetAccountCmd(storeAcc, cdc), )