From c1ee2ec7a8c7c2aa68a278350698fa1d0871c3b2 Mon Sep 17 00:00:00 2001 From: turtlebasket Date: Fri, 2 Sep 2022 21:58:22 +0000 Subject: [PATCH] apply auction type updates to cli --- go.mod | 1 - go.sum | 2 -- x/cosmostest/client/cli/tx_new_auction.go | 16 +++++++++++++--- x/cosmostest/types/message_new_auction.go | 4 +++- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 9ab26ca..ff93dce 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum index ad897ba..07b1083 100644 --- a/go.sum +++ b/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.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= diff --git a/x/cosmostest/client/cli/tx_new_auction.go b/x/cosmostest/client/cli/tx_new_auction.go index 158e889..815275c 100644 --- a/x/cosmostest/client/cli/tx_new_auction.go +++ b/x/cosmostest/client/cli/tx_new_auction.go @@ -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 diff --git a/x/cosmostest/types/message_new_auction.go b/x/cosmostest/types/message_new_auction.go index 2bf4409..f50d89a 100644 --- a/x/cosmostest/types/message_new_auction.go +++ b/x/cosmostest/types/message_new_auction.go @@ -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, } }