From a21eeae5ea59c17327b7b4844c62c53ad091e91d Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 5 Apr 2018 18:45:38 +0300 Subject: [PATCH 1/2] democli: add cool and pow commands --- examples/democoin/cmd/democli/main.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/examples/democoin/cmd/democli/main.go b/examples/democoin/cmd/democli/main.go index bf499458be..2b71db710d 100644 --- a/examples/democoin/cmd/democli/main.go +++ b/examples/democoin/cmd/democli/main.go @@ -21,6 +21,8 @@ import ( "github.com/cosmos/cosmos-sdk/examples/democoin/app" "github.com/cosmos/cosmos-sdk/examples/democoin/types" + coolcmd "github.com/cosmos/cosmos-sdk/examples/democoin/x/cool/commands" + powcmd "github.com/cosmos/cosmos-sdk/examples/democoin/x/pow/commands" ) // rootCmd is the entry point for this binary @@ -49,6 +51,7 @@ func main() { rootCmd.AddCommand(client.LineBreak) // add query/post commands (custom to binary) + // start with commands common to basecoin rootCmd.AddCommand( client.GetCommands( authcmd.GetAccountCmd("main", cdc, types.GetAccountDecoder(cdc)), @@ -70,6 +73,13 @@ func main() { client.PostCommands( simplestakingcmd.UnbondTxCmd(cdc), )...) + // and now democoin specific commands + rootCmd.AddCommand( + client.PostCommands( + coolcmd.QuizTxCmd(cdc), + coolcmd.SetTrendTxCmd(cdc), + powcmd.MineCmd(cdc), + )...) // add proxy, version and key info rootCmd.AddCommand( From bbda5b43ddba125cc6de10672f5265b24a6c13fe Mon Sep 17 00:00:00 2001 From: Christopher Goes Date: Thu, 5 Apr 2018 18:26:09 +0200 Subject: [PATCH 2/2] Update mine command usage information --- examples/democoin/x/pow/commands/tx.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/democoin/x/pow/commands/tx.go b/examples/democoin/x/pow/commands/tx.go index 77cfa621c6..badbe39092 100644 --- a/examples/democoin/x/pow/commands/tx.go +++ b/examples/democoin/x/pow/commands/tx.go @@ -19,7 +19,7 @@ func MineCmd(cdc *wire.Codec) *cobra.Command { Short: "Mine some coins with proof-of-work!", RunE: func(cmd *cobra.Command, args []string) error { if len(args) != 4 { - return errors.New("You must provide a difficulty, a solution, and a nonce (in that order)") + return errors.New("You must provide a difficulty, a count, a solution, and a nonce (in that order)") } // get from address and parse arguments