apply auction type updates to cli
parent
75c051af04
commit
c1ee2ec7a8
1
go.mod
1
go.mod
|
@ -87,7 +87,6 @@ require (
|
||||||
github.com/gorilla/handlers v1.5.1 // indirect
|
github.com/gorilla/handlers v1.5.1 // indirect
|
||||||
github.com/gorilla/websocket v1.5.0 // indirect
|
github.com/gorilla/websocket v1.5.0 // indirect
|
||||||
github.com/grpc-ecosystem/go-grpc-middleware v1.3.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/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
|
||||||
github.com/gtank/merlin v0.1.1 // indirect
|
github.com/gtank/merlin v0.1.1 // indirect
|
||||||
github.com/gtank/ristretto255 v0.1.2 // indirect
|
github.com/gtank/ristretto255 v0.1.2 // indirect
|
||||||
|
|
2
go.sum
2
go.sum
|
@ -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.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 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo=
|
||||||
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
|
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 h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU=
|
||||||
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0=
|
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=
|
github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s=
|
||||||
|
|
|
@ -15,24 +15,34 @@ var _ = strconv.Itoa(0)
|
||||||
|
|
||||||
func CmdNewAuction() *cobra.Command {
|
func CmdNewAuction() *cobra.Command {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "new-auction [name] [description] [denom]",
|
Use: "new-auction [name] [description] [ceiling] [denom] [end date]",
|
||||||
Short: "Broadcast message newAuction",
|
Short: "Broadcast message newAuction",
|
||||||
Args: cobra.ExactArgs(3),
|
Args: cobra.ExactArgs(5),
|
||||||
RunE: func(cmd *cobra.Command, args []string) (err error) {
|
RunE: func(cmd *cobra.Command, args []string) (err error) {
|
||||||
argName := args[0]
|
argName := args[0]
|
||||||
argDescription := args[1]
|
argDescription := args[1]
|
||||||
argDenom := args[2]
|
argCeiling := args[2]
|
||||||
|
argDenom := args[3]
|
||||||
|
argLeaseEnd := args[4]
|
||||||
|
|
||||||
clientCtx, err := client.GetClientTxContext(cmd)
|
clientCtx, err := client.GetClientTxContext(cmd)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var le int
|
||||||
|
le, err = strconv.Atoi(argLeaseEnd)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
msg := types.NewMsgNewAuction(
|
msg := types.NewMsgNewAuction(
|
||||||
clientCtx.GetFromAddress().String(),
|
clientCtx.GetFromAddress().String(),
|
||||||
argName,
|
argName,
|
||||||
argDescription,
|
argDescription,
|
||||||
|
argCeiling,
|
||||||
argDenom,
|
argDenom,
|
||||||
|
uint64(le),
|
||||||
)
|
)
|
||||||
if err := msg.ValidateBasic(); err != nil {
|
if err := msg.ValidateBasic(); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
@ -9,12 +9,14 @@ const TypeMsgNewAuction = "new_auction"
|
||||||
|
|
||||||
var _ sdk.Msg = &MsgNewAuction{}
|
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{
|
return &MsgNewAuction{
|
||||||
Creator: creator,
|
Creator: creator,
|
||||||
Name: name,
|
Name: name,
|
||||||
Description: description,
|
Description: description,
|
||||||
|
Ceiling: ceiling,
|
||||||
Denom: denom,
|
Denom: denom,
|
||||||
|
LeaseEnd: leaseEnd,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue