mirror of
https://github.com/colinear-labs/chain.git
synced 2026-03-05 04:54:25 -08:00
apply auction type updates to cli
This commit is contained in:
@@ -15,24 +15,34 @@ var _ = strconv.Itoa(0)
|
||||
|
||||
func CmdNewAuction() *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "new-auction [name] [description] [denom]",
|
||||
Use: "new-auction [name] [description] [ceiling] [denom] [end date]",
|
||||
Short: "Broadcast message newAuction",
|
||||
Args: cobra.ExactArgs(3),
|
||||
Args: cobra.ExactArgs(5),
|
||||
RunE: func(cmd *cobra.Command, args []string) (err error) {
|
||||
argName := args[0]
|
||||
argDescription := args[1]
|
||||
argDenom := args[2]
|
||||
argCeiling := args[2]
|
||||
argDenom := args[3]
|
||||
argLeaseEnd := args[4]
|
||||
|
||||
clientCtx, err := client.GetClientTxContext(cmd)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var le int
|
||||
le, err = strconv.Atoi(argLeaseEnd)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
msg := types.NewMsgNewAuction(
|
||||
clientCtx.GetFromAddress().String(),
|
||||
argName,
|
||||
argDescription,
|
||||
argCeiling,
|
||||
argDenom,
|
||||
uint64(le),
|
||||
)
|
||||
if err := msg.ValidateBasic(); err != nil {
|
||||
return err
|
||||
|
||||
@@ -9,12 +9,14 @@ const TypeMsgNewAuction = "new_auction"
|
||||
|
||||
var _ sdk.Msg = &MsgNewAuction{}
|
||||
|
||||
func NewMsgNewAuction(creator string, name string, description string, denom string) *MsgNewAuction {
|
||||
func NewMsgNewAuction(creator string, name string, description string, ceiling string, denom string, leaseEnd uint64) *MsgNewAuction {
|
||||
return &MsgNewAuction{
|
||||
Creator: creator,
|
||||
Name: name,
|
||||
Description: description,
|
||||
Ceiling: ceiling,
|
||||
Denom: denom,
|
||||
LeaseEnd: leaseEnd,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user