add example to cli cmd (#648)

This commit is contained in:
Denali Marsh 2020-09-11 14:58:22 +02:00 committed by GitHub
parent 0504f55e26
commit 8966329643
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,6 +13,7 @@ import (
"github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types" sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/version"
"github.com/cosmos/cosmos-sdk/x/auth" "github.com/cosmos/cosmos-sdk/x/auth"
"github.com/cosmos/cosmos-sdk/x/auth/client/utils" "github.com/cosmos/cosmos-sdk/x/auth/client/utils"
@ -43,6 +44,8 @@ func GetCmdPostPrice(cdc *codec.Codec) *cobra.Command {
return &cobra.Command{ return &cobra.Command{
Use: "postprice [marketID] [price] [expiry]", Use: "postprice [marketID] [price] [expiry]",
Short: "post the latest price for a particular market with a given expiry as a UNIX time", Short: "post the latest price for a particular market with a given expiry as a UNIX time",
Example: fmt.Sprintf("%s tx %s postprice bnb:usd 25 9999999999 --from validator",
version.ClientName, types.ModuleName),
Args: cobra.ExactArgs(3), Args: cobra.ExactArgs(3),
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
inBuf := bufio.NewReader(cmd.InOrStdin()) inBuf := bufio.NewReader(cmd.InOrStdin())