apply auction type updates to cli

master
michael 2022-09-02 21:58:22 +00:00
parent 75c051af04
commit c1ee2ec7a8
4 changed files with 16 additions and 7 deletions

1
go.mod
View File

@ -87,7 +87,6 @@ require (
github.com/gorilla/handlers v1.5.1 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 // indirect
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
github.com/gtank/merlin v0.1.1 // indirect
github.com/gtank/ristretto255 v0.1.2 // indirect

2
go.sum
View File

@ -734,8 +734,6 @@ github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t
github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 h1:lLT7ZLSzGLI08vc9cpd+tYmNWjdKDqyr/2L+f6U12Fk=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w=
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU=
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0=
github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s=

View File

@ -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

View File

@ -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,
}
}