Merge pull request #796 from cosmos/bucky/democoin
democli: add cool and pow commands
This commit is contained in:
commit
66e5d3c5f3
|
@ -21,6 +21,8 @@ import (
|
||||||
|
|
||||||
"github.com/cosmos/cosmos-sdk/examples/democoin/app"
|
"github.com/cosmos/cosmos-sdk/examples/democoin/app"
|
||||||
"github.com/cosmos/cosmos-sdk/examples/democoin/types"
|
"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
|
// rootCmd is the entry point for this binary
|
||||||
|
@ -49,6 +51,7 @@ func main() {
|
||||||
rootCmd.AddCommand(client.LineBreak)
|
rootCmd.AddCommand(client.LineBreak)
|
||||||
|
|
||||||
// add query/post commands (custom to binary)
|
// add query/post commands (custom to binary)
|
||||||
|
// start with commands common to basecoin
|
||||||
rootCmd.AddCommand(
|
rootCmd.AddCommand(
|
||||||
client.GetCommands(
|
client.GetCommands(
|
||||||
authcmd.GetAccountCmd("main", cdc, types.GetAccountDecoder(cdc)),
|
authcmd.GetAccountCmd("main", cdc, types.GetAccountDecoder(cdc)),
|
||||||
|
@ -70,6 +73,13 @@ func main() {
|
||||||
client.PostCommands(
|
client.PostCommands(
|
||||||
simplestakingcmd.UnbondTxCmd(cdc),
|
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
|
// add proxy, version and key info
|
||||||
rootCmd.AddCommand(
|
rootCmd.AddCommand(
|
||||||
|
|
|
@ -19,7 +19,7 @@ func MineCmd(cdc *wire.Codec) *cobra.Command {
|
||||||
Short: "Mine some coins with proof-of-work!",
|
Short: "Mine some coins with proof-of-work!",
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
if len(args) != 4 {
|
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
|
// get from address and parse arguments
|
||||||
|
|
Loading…
Reference in New Issue