Add service provider auctions #59
@ -13,7 +13,6 @@ import (
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
|
||||
wnsUtils "git.vdb.to/cerc-io/laconicd/utils"
|
||||
auctiontypes "git.vdb.to/cerc-io/laconicd/x/auction"
|
||||
@ -49,6 +48,16 @@ func GetCmdCommitBid() *cobra.Command {
|
||||
return err
|
||||
}
|
||||
|
||||
// Take chain id passed by user
|
||||
chainId, _ := cmd.Flags().GetString(flags.FlagChainID)
|
||||
if chainId == "" {
|
||||
// Take from config if not provided
|
||||
chainId = clientCtx.ChainID
|
||||
if chainId == "" {
|
||||
return fmt.Errorf("--chain-id required")
|
||||
}
|
||||
}
|
||||
|
||||
bidAmount, err := sdk.ParseCoinNormalized(args[1])
|
||||
if err != nil {
|
||||
return err
|
||||
@ -59,7 +68,6 @@ func GetCmdCommitBid() *cobra.Command {
|
||||
return err
|
||||
}
|
||||
|
||||
chainId := viper.GetString("chain-id")
|
||||
auctionId := args[0]
|
||||
|
||||
reveal := map[string]interface{}{
|
||||
|
@ -81,17 +81,19 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
|
||||
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
|
||||
{
|
||||
RpcMethod: "CreateAuction",
|
||||
Use: "create [kind] [commits-duration] [reveals-duration] [commit-fee] [reveal-fee] [minimum-bid] [max-price] [num-providers]",
|
||||
Use: "create [commits-duration] [reveals-duration] [commit-fee] [reveal-fee]",
|
||||
Short: "Create an auction",
|
||||
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
|
||||
{ProtoField: "kind"},
|
||||
{ProtoField: "commits_duration"},
|
||||
{ProtoField: "reveals_duration"},
|
||||
{ProtoField: "commit_fee"},
|
||||
{ProtoField: "reveal_fee"},
|
||||
{ProtoField: "minimum_bid"},
|
||||
{ProtoField: "max_price"},
|
||||
{ProtoField: "num_providers"},
|
||||
},
|
||||
FlagOptions: map[string]*autocliv1.FlagOptions{
|
||||
"kind": {Name: "kind", DefaultValue: "vickrey", Usage: "Auction kind (vickrey|provider) (default: vickrey)"},
|
||||
"minimum_bid": {Name: "minimum-bid", Usage: "Minimum bid (required for vickrey auctions)"},
|
||||
"max_price": {Name: "max-price", Usage: "Max price (required for provider auctions)"},
|
||||
"num_providers": {Name: "num-providers", Usage: "Number of desired providers (required for provider auctions)"},
|
||||
},
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user