From 66e674d38704caeea20e283841bcaf1bc43850d9 Mon Sep 17 00:00:00 2001 From: IshaVenikar Date: Fri, 13 Sep 2024 12:58:19 +0530 Subject: [PATCH 01/29] Update proto files and bindings --- api/cerc/auction/v1/auction.pulsar.go | 688 +++++++++++++++++++------- api/cerc/auction/v1/tx.pulsar.go | 473 +++++++++++++----- proto/cerc/auction/v1/auction.proto | 26 +- proto/cerc/auction/v1/tx.proto | 14 + x/auction/auction.pb.go | 298 ++++++++--- x/auction/tx.pb.go | 258 +++++++--- 6 files changed, 1316 insertions(+), 441 deletions(-) diff --git a/api/cerc/auction/v1/auction.pulsar.go b/api/cerc/auction/v1/auction.pulsar.go index 0594ccc3..dc9a22e9 100644 --- a/api/cerc/auction/v1/auction.pulsar.go +++ b/api/cerc/auction/v1/auction.pulsar.go @@ -767,6 +767,103 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { } } +var _ protoreflect.List = (*_Auction_10_list)(nil) + +type _Auction_10_list struct { + list *[]string +} + +func (x *_Auction_10_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Auction_10_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Auction_10_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Auction_10_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Auction_10_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Auction at list field WinnerAddresses as it is not of Message kind")) +} + +func (x *_Auction_10_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Auction_10_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Auction_10_list) IsValid() bool { + return x.list != nil +} + +var _ protoreflect.List = (*_Auction_11_list)(nil) + +type _Auction_11_list struct { + list *[]*v1beta1.Coin +} + +func (x *_Auction_11_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Auction_11_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_Auction_11_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + (*x.list)[i] = concreteValue +} + +func (x *_Auction_11_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + *x.list = append(*x.list, concreteValue) +} + +func (x *_Auction_11_list) AppendMutable() protoreflect.Value { + v := new(v1beta1.Coin) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Auction_11_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_Auction_11_list) NewElement() protoreflect.Value { + v := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Auction_11_list) IsValid() bool { + return x.list != nil +} + var ( md_Auction protoreflect.MessageDescriptor fd_Auction_id protoreflect.FieldDescriptor @@ -778,9 +875,12 @@ var ( fd_Auction_commit_fee protoreflect.FieldDescriptor fd_Auction_reveal_fee protoreflect.FieldDescriptor fd_Auction_minimum_bid protoreflect.FieldDescriptor - fd_Auction_winner_address protoreflect.FieldDescriptor - fd_Auction_winning_bid protoreflect.FieldDescriptor + fd_Auction_winner_addresses protoreflect.FieldDescriptor + fd_Auction_winning_bids protoreflect.FieldDescriptor fd_Auction_winning_price protoreflect.FieldDescriptor + fd_Auction_max_price protoreflect.FieldDescriptor + fd_Auction_kind protoreflect.FieldDescriptor + fd_Auction_num_providers protoreflect.FieldDescriptor ) func init() { @@ -795,9 +895,12 @@ func init() { fd_Auction_commit_fee = md_Auction.Fields().ByName("commit_fee") fd_Auction_reveal_fee = md_Auction.Fields().ByName("reveal_fee") fd_Auction_minimum_bid = md_Auction.Fields().ByName("minimum_bid") - fd_Auction_winner_address = md_Auction.Fields().ByName("winner_address") - fd_Auction_winning_bid = md_Auction.Fields().ByName("winning_bid") + fd_Auction_winner_addresses = md_Auction.Fields().ByName("winner_addresses") + fd_Auction_winning_bids = md_Auction.Fields().ByName("winning_bids") fd_Auction_winning_price = md_Auction.Fields().ByName("winning_price") + fd_Auction_max_price = md_Auction.Fields().ByName("max_price") + fd_Auction_kind = md_Auction.Fields().ByName("kind") + fd_Auction_num_providers = md_Auction.Fields().ByName("num_providers") } var _ protoreflect.Message = (*fastReflection_Auction)(nil) @@ -919,15 +1022,15 @@ func (x *fastReflection_Auction) Range(f func(protoreflect.FieldDescriptor, prot return } } - if x.WinnerAddress != "" { - value := protoreflect.ValueOfString(x.WinnerAddress) - if !f(fd_Auction_winner_address, value) { + if len(x.WinnerAddresses) != 0 { + value := protoreflect.ValueOfList(&_Auction_10_list{list: &x.WinnerAddresses}) + if !f(fd_Auction_winner_addresses, value) { return } } - if x.WinningBid != nil { - value := protoreflect.ValueOfMessage(x.WinningBid.ProtoReflect()) - if !f(fd_Auction_winning_bid, value) { + if len(x.WinningBids) != 0 { + value := protoreflect.ValueOfList(&_Auction_11_list{list: &x.WinningBids}) + if !f(fd_Auction_winning_bids, value) { return } } @@ -937,6 +1040,24 @@ func (x *fastReflection_Auction) Range(f func(protoreflect.FieldDescriptor, prot return } } + if x.MaxPrice != nil { + value := protoreflect.ValueOfMessage(x.MaxPrice.ProtoReflect()) + if !f(fd_Auction_max_price, value) { + return + } + } + if x.Kind != "" { + value := protoreflect.ValueOfString(x.Kind) + if !f(fd_Auction_kind, value) { + return + } + } + if x.NumProviders != int32(0) { + value := protoreflect.ValueOfInt32(x.NumProviders) + if !f(fd_Auction_num_providers, value) { + return + } + } } // Has reports whether a field is populated. @@ -970,12 +1091,18 @@ func (x *fastReflection_Auction) Has(fd protoreflect.FieldDescriptor) bool { return x.RevealFee != nil case "cerc.auction.v1.Auction.minimum_bid": return x.MinimumBid != nil - case "cerc.auction.v1.Auction.winner_address": - return x.WinnerAddress != "" - case "cerc.auction.v1.Auction.winning_bid": - return x.WinningBid != nil + case "cerc.auction.v1.Auction.winner_addresses": + return len(x.WinnerAddresses) != 0 + case "cerc.auction.v1.Auction.winning_bids": + return len(x.WinningBids) != 0 case "cerc.auction.v1.Auction.winning_price": return x.WinningPrice != nil + case "cerc.auction.v1.Auction.max_price": + return x.MaxPrice != nil + case "cerc.auction.v1.Auction.kind": + return x.Kind != "" + case "cerc.auction.v1.Auction.num_providers": + return x.NumProviders != int32(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.v1.Auction")) @@ -1010,12 +1137,18 @@ func (x *fastReflection_Auction) Clear(fd protoreflect.FieldDescriptor) { x.RevealFee = nil case "cerc.auction.v1.Auction.minimum_bid": x.MinimumBid = nil - case "cerc.auction.v1.Auction.winner_address": - x.WinnerAddress = "" - case "cerc.auction.v1.Auction.winning_bid": - x.WinningBid = nil + case "cerc.auction.v1.Auction.winner_addresses": + x.WinnerAddresses = nil + case "cerc.auction.v1.Auction.winning_bids": + x.WinningBids = nil case "cerc.auction.v1.Auction.winning_price": x.WinningPrice = nil + case "cerc.auction.v1.Auction.max_price": + x.MaxPrice = nil + case "cerc.auction.v1.Auction.kind": + x.Kind = "" + case "cerc.auction.v1.Auction.num_providers": + x.NumProviders = int32(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.v1.Auction")) @@ -1059,15 +1192,30 @@ func (x *fastReflection_Auction) Get(descriptor protoreflect.FieldDescriptor) pr case "cerc.auction.v1.Auction.minimum_bid": value := x.MinimumBid return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "cerc.auction.v1.Auction.winner_address": - value := x.WinnerAddress - return protoreflect.ValueOfString(value) - case "cerc.auction.v1.Auction.winning_bid": - value := x.WinningBid - return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cerc.auction.v1.Auction.winner_addresses": + if len(x.WinnerAddresses) == 0 { + return protoreflect.ValueOfList(&_Auction_10_list{}) + } + listValue := &_Auction_10_list{list: &x.WinnerAddresses} + return protoreflect.ValueOfList(listValue) + case "cerc.auction.v1.Auction.winning_bids": + if len(x.WinningBids) == 0 { + return protoreflect.ValueOfList(&_Auction_11_list{}) + } + listValue := &_Auction_11_list{list: &x.WinningBids} + return protoreflect.ValueOfList(listValue) case "cerc.auction.v1.Auction.winning_price": value := x.WinningPrice return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cerc.auction.v1.Auction.max_price": + value := x.MaxPrice + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cerc.auction.v1.Auction.kind": + value := x.Kind + return protoreflect.ValueOfString(value) + case "cerc.auction.v1.Auction.num_providers": + value := x.NumProviders + return protoreflect.ValueOfInt32(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.v1.Auction")) @@ -1106,12 +1254,22 @@ func (x *fastReflection_Auction) Set(fd protoreflect.FieldDescriptor, value prot x.RevealFee = value.Message().Interface().(*v1beta1.Coin) case "cerc.auction.v1.Auction.minimum_bid": x.MinimumBid = value.Message().Interface().(*v1beta1.Coin) - case "cerc.auction.v1.Auction.winner_address": - x.WinnerAddress = value.Interface().(string) - case "cerc.auction.v1.Auction.winning_bid": - x.WinningBid = value.Message().Interface().(*v1beta1.Coin) + case "cerc.auction.v1.Auction.winner_addresses": + lv := value.List() + clv := lv.(*_Auction_10_list) + x.WinnerAddresses = *clv.list + case "cerc.auction.v1.Auction.winning_bids": + lv := value.List() + clv := lv.(*_Auction_11_list) + x.WinningBids = *clv.list case "cerc.auction.v1.Auction.winning_price": x.WinningPrice = value.Message().Interface().(*v1beta1.Coin) + case "cerc.auction.v1.Auction.max_price": + x.MaxPrice = value.Message().Interface().(*v1beta1.Coin) + case "cerc.auction.v1.Auction.kind": + x.Kind = value.Interface().(string) + case "cerc.auction.v1.Auction.num_providers": + x.NumProviders = int32(value.Int()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.v1.Auction")) @@ -1162,24 +1320,38 @@ func (x *fastReflection_Auction) Mutable(fd protoreflect.FieldDescriptor) protor x.MinimumBid = new(v1beta1.Coin) } return protoreflect.ValueOfMessage(x.MinimumBid.ProtoReflect()) - case "cerc.auction.v1.Auction.winning_bid": - if x.WinningBid == nil { - x.WinningBid = new(v1beta1.Coin) + case "cerc.auction.v1.Auction.winner_addresses": + if x.WinnerAddresses == nil { + x.WinnerAddresses = []string{} } - return protoreflect.ValueOfMessage(x.WinningBid.ProtoReflect()) + value := &_Auction_10_list{list: &x.WinnerAddresses} + return protoreflect.ValueOfList(value) + case "cerc.auction.v1.Auction.winning_bids": + if x.WinningBids == nil { + x.WinningBids = []*v1beta1.Coin{} + } + value := &_Auction_11_list{list: &x.WinningBids} + return protoreflect.ValueOfList(value) case "cerc.auction.v1.Auction.winning_price": if x.WinningPrice == nil { x.WinningPrice = new(v1beta1.Coin) } return protoreflect.ValueOfMessage(x.WinningPrice.ProtoReflect()) + case "cerc.auction.v1.Auction.max_price": + if x.MaxPrice == nil { + x.MaxPrice = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.MaxPrice.ProtoReflect()) case "cerc.auction.v1.Auction.id": panic(fmt.Errorf("field id of message cerc.auction.v1.Auction is not mutable")) case "cerc.auction.v1.Auction.status": panic(fmt.Errorf("field status of message cerc.auction.v1.Auction is not mutable")) case "cerc.auction.v1.Auction.owner_address": panic(fmt.Errorf("field owner_address of message cerc.auction.v1.Auction is not mutable")) - case "cerc.auction.v1.Auction.winner_address": - panic(fmt.Errorf("field winner_address of message cerc.auction.v1.Auction is not mutable")) + case "cerc.auction.v1.Auction.kind": + panic(fmt.Errorf("field kind of message cerc.auction.v1.Auction is not mutable")) + case "cerc.auction.v1.Auction.num_providers": + panic(fmt.Errorf("field num_providers of message cerc.auction.v1.Auction is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.v1.Auction")) @@ -1217,14 +1389,22 @@ func (x *fastReflection_Auction) NewField(fd protoreflect.FieldDescriptor) proto case "cerc.auction.v1.Auction.minimum_bid": m := new(v1beta1.Coin) return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "cerc.auction.v1.Auction.winner_address": - return protoreflect.ValueOfString("") - case "cerc.auction.v1.Auction.winning_bid": - m := new(v1beta1.Coin) - return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cerc.auction.v1.Auction.winner_addresses": + list := []string{} + return protoreflect.ValueOfList(&_Auction_10_list{list: &list}) + case "cerc.auction.v1.Auction.winning_bids": + list := []*v1beta1.Coin{} + return protoreflect.ValueOfList(&_Auction_11_list{list: &list}) case "cerc.auction.v1.Auction.winning_price": m := new(v1beta1.Coin) return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cerc.auction.v1.Auction.max_price": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cerc.auction.v1.Auction.kind": + return protoreflect.ValueOfString("") + case "cerc.auction.v1.Auction.num_providers": + return protoreflect.ValueOfInt32(int32(0)) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.v1.Auction")) @@ -1330,18 +1510,33 @@ func (x *fastReflection_Auction) ProtoMethods() *protoiface.Methods { l = options.Size(x.MinimumBid) n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.WinnerAddress) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) + if len(x.WinnerAddresses) > 0 { + for _, s := range x.WinnerAddresses { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } } - if x.WinningBid != nil { - l = options.Size(x.WinningBid) - n += 1 + l + runtime.Sov(uint64(l)) + if len(x.WinningBids) > 0 { + for _, e := range x.WinningBids { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } } if x.WinningPrice != nil { l = options.Size(x.WinningPrice) n += 1 + l + runtime.Sov(uint64(l)) } + if x.MaxPrice != nil { + l = options.Size(x.MaxPrice) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Kind) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.NumProviders != 0 { + n += 1 + runtime.Sov(uint64(x.NumProviders)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -1371,6 +1566,32 @@ func (x *fastReflection_Auction) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.NumProviders != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.NumProviders)) + i-- + dAtA[i] = 0x78 + } + if len(x.Kind) > 0 { + i -= len(x.Kind) + copy(dAtA[i:], x.Kind) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Kind))) + i-- + dAtA[i] = 0x72 + } + if x.MaxPrice != nil { + encoded, err := options.Marshal(x.MaxPrice) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x6a + } if x.WinningPrice != nil { encoded, err := options.Marshal(x.WinningPrice) if err != nil { @@ -1385,26 +1606,30 @@ func (x *fastReflection_Auction) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x62 } - if x.WinningBid != nil { - encoded, err := options.Marshal(x.WinningBid) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err + if len(x.WinningBids) > 0 { + for iNdEx := len(x.WinningBids) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.WinningBids[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x5a } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x5a } - if len(x.WinnerAddress) > 0 { - i -= len(x.WinnerAddress) - copy(dAtA[i:], x.WinnerAddress) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.WinnerAddress))) - i-- - dAtA[i] = 0x52 + if len(x.WinnerAddresses) > 0 { + for iNdEx := len(x.WinnerAddresses) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.WinnerAddresses[iNdEx]) + copy(dAtA[i:], x.WinnerAddresses[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.WinnerAddresses[iNdEx]))) + i-- + dAtA[i] = 0x52 + } } if x.MinimumBid != nil { encoded, err := options.Marshal(x.MinimumBid) @@ -1874,7 +2099,7 @@ func (x *fastReflection_Auction) ProtoMethods() *protoiface.Methods { iNdEx = postIndex case 10: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field WinnerAddress", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field WinnerAddresses", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1902,11 +2127,11 @@ func (x *fastReflection_Auction) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.WinnerAddress = string(dAtA[iNdEx:postIndex]) + x.WinnerAddresses = append(x.WinnerAddresses, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 11: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field WinningBid", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field WinningBids", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1933,10 +2158,8 @@ func (x *fastReflection_Auction) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - if x.WinningBid == nil { - x.WinningBid = &v1beta1.Coin{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.WinningBid); err != nil { + x.WinningBids = append(x.WinningBids, &v1beta1.Coin{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.WinningBids[len(x.WinningBids)-1]); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex @@ -1976,6 +2199,93 @@ func (x *fastReflection_Auction) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex + case 13: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MaxPrice", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.MaxPrice == nil { + x.MaxPrice = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.MaxPrice); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 14: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Kind = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 15: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NumProviders", wireType) + } + x.NumProviders = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.NumProviders |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -3620,12 +3930,18 @@ type Auction struct { RevealFee *v1beta1.Coin `protobuf:"bytes,8,opt,name=reveal_fee,json=revealFee,proto3" json:"reveal_fee,omitempty"` // Minimum acceptable bid amount for a valid commit MinimumBid *v1beta1.Coin `protobuf:"bytes,9,opt,name=minimum_bid,json=minimumBid,proto3" json:"minimum_bid,omitempty"` - // Address of the winner - WinnerAddress string `protobuf:"bytes,10,opt,name=winner_address,json=winnerAddress,proto3" json:"winner_address,omitempty"` - // Winning bid, i.e., the highest bid - WinningBid *v1beta1.Coin `protobuf:"bytes,11,opt,name=winning_bid,json=winningBid,proto3" json:"winning_bid,omitempty"` - // Amount the winner pays, i.e. the second highest auction + // Addresses of the winners + WinnerAddresses []string `protobuf:"bytes,10,rep,name=winner_addresses,json=winnerAddresses,proto3" json:"winner_addresses,omitempty"` + // Winning bids, i.e., the best bids + WinningBids []*v1beta1.Coin `protobuf:"bytes,11,rep,name=winning_bids,json=winningBids,proto3" json:"winning_bids,omitempty"` + // Amount the winner pays, i.e. the second best bid WinningPrice *v1beta1.Coin `protobuf:"bytes,12,opt,name=winning_price,json=winningPrice,proto3" json:"winning_price,omitempty"` + // Maximum acceptable bid amount for a valid commit for reverse auctions + MaxPrice *v1beta1.Coin `protobuf:"bytes,13,opt,name=max_price,json=maxPrice,proto3" json:"max_price,omitempty"` + // Auction kind can be vickrey or service_provider + Kind string `protobuf:"bytes,14,opt,name=kind,proto3" json:"kind,omitempty"` + // Number of providers to be selected + NumProviders int32 `protobuf:"varint,15,opt,name=num_providers,json=numProviders,proto3" json:"num_providers,omitempty"` } func (x *Auction) Reset() { @@ -3711,16 +4027,16 @@ func (x *Auction) GetMinimumBid() *v1beta1.Coin { return nil } -func (x *Auction) GetWinnerAddress() string { +func (x *Auction) GetWinnerAddresses() []string { if x != nil { - return x.WinnerAddress + return x.WinnerAddresses } - return "" + return nil } -func (x *Auction) GetWinningBid() *v1beta1.Coin { +func (x *Auction) GetWinningBids() []*v1beta1.Coin { if x != nil { - return x.WinningBid + return x.WinningBids } return nil } @@ -3732,6 +4048,27 @@ func (x *Auction) GetWinningPrice() *v1beta1.Coin { return nil } +func (x *Auction) GetMaxPrice() *v1beta1.Coin { + if x != nil { + return x.MaxPrice + } + return nil +} + +func (x *Auction) GetKind() string { + if x != nil { + return x.Kind + } + return "" +} + +func (x *Auction) GetNumProviders() int32 { + if x != nil { + return x.NumProviders + } + return 0 +} + // Auctions represent all the auctions in the module type Auctions struct { state protoimpl.MessageState @@ -3918,7 +4255,7 @@ var file_cerc_auction_v1_auction_proto_rawDesc = []byte{ 0x1f, 0x25, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x62, 0x69, 0x64, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x62, 0x69, 0x64, 0x22, 0x52, 0x0a, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, - 0x42, 0x69, 0x64, 0x3a, 0x04, 0x98, 0xa0, 0x1f, 0x00, 0x22, 0x92, 0x08, 0x0a, 0x07, 0x41, 0x75, + 0x42, 0x69, 0x64, 0x3a, 0x04, 0x98, 0xa0, 0x1f, 0x00, 0x22, 0xd3, 0x09, 0x0a, 0x07, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x23, 0x0a, @@ -3967,83 +4304,95 @@ var file_cerc_auction_v1_auction_proto_rawDesc = []byte{ 0x1f, 0x25, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x62, 0x69, 0x64, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x62, 0x69, 0x64, 0x22, 0x52, 0x0a, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, - 0x42, 0x69, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x77, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x77, 0x69, 0x6e, - 0x6e, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x69, 0x0a, 0x0b, 0x77, 0x69, - 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x69, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x42, 0x69, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x77, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x77, + 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x12, 0x6d, + 0x0a, 0x0c, 0x77, 0x69, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x69, 0x64, 0x73, 0x18, 0x0b, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, + 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, + 0x2f, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x27, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x77, + 0x69, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x69, 0x64, 0x73, 0x22, 0x20, 0x79, 0x61, 0x6d, + 0x6c, 0x3a, 0x22, 0x77, 0x69, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x69, 0x64, 0x73, 0x22, + 0x52, 0x0b, 0x77, 0x69, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x42, 0x69, 0x64, 0x73, 0x12, 0x71, 0x0a, + 0x0d, 0x77, 0x69, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x0c, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, + 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, + 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x29, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x77, + 0x69, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x22, 0x20, 0x79, 0x61, + 0x6d, 0x6c, 0x3a, 0x22, 0x77, 0x69, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x72, 0x69, 0x63, + 0x65, 0x22, 0x52, 0x0c, 0x77, 0x69, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x69, 0x63, 0x65, + 0x12, 0x61, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x0d, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, + 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x29, + 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x21, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6d, 0x61, + 0x78, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6d, + 0x61, 0x78, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x22, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x50, 0x72, + 0x69, 0x63, 0x65, 0x12, 0x2f, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x0e, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x1b, 0xf2, 0xde, 0x1f, 0x17, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6b, 0x69, 0x6e, + 0x64, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6b, 0x69, 0x6e, 0x64, 0x22, 0x52, 0x04, + 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x6e, 0x75, 0x6d, 0x5f, 0x70, 0x72, 0x6f, 0x76, + 0x69, 0x64, 0x65, 0x72, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6e, 0x75, 0x6d, + 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x22, + 0x4c, 0x0a, 0x08, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3a, 0x0a, 0x08, 0x61, + 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, + 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, + 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x08, 0x61, + 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x22, 0x9f, 0x05, + 0x0a, 0x03, 0x42, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x5f, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x62, 0x69, + 0x64, 0x64, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x68, 0x61, + 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x48, 0x61, 0x73, 0x68, 0x12, 0x6e, 0x0a, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x74, + 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x25, 0x6a, + 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, + 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x74, + 0x69, 0x6d, 0x65, 0x22, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x54, 0x69, 0x6d, 0x65, 0x12, 0x65, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x66, + 0x65, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, + 0x6f, 0x69, 0x6e, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x23, 0x6a, 0x73, 0x6f, + 0x6e, 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x66, 0x65, 0x65, 0x22, 0x20, 0x79, + 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x66, 0x65, 0x65, 0x22, + 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x46, 0x65, 0x65, 0x12, 0x6e, 0x0a, 0x0b, 0x72, + 0x65, 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x31, 0xc8, 0xde, + 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x25, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x72, 0x65, 0x76, 0x65, + 0x61, 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x72, + 0x65, 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x90, 0xdf, 0x1f, 0x01, 0x52, + 0x0a, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x65, 0x0a, 0x0a, 0x72, + 0x65, 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x2d, 0xc8, 0xde, 0x1f, 0x00, - 0xf2, 0xde, 0x1f, 0x25, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x77, 0x69, 0x6e, 0x6e, 0x69, 0x6e, - 0x67, 0x5f, 0x62, 0x69, 0x64, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x77, 0x69, 0x6e, - 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x69, 0x64, 0x22, 0x52, 0x0a, 0x77, 0x69, 0x6e, 0x6e, 0x69, - 0x6e, 0x67, 0x42, 0x69, 0x64, 0x12, 0x71, 0x0a, 0x0d, 0x77, 0x69, 0x6e, 0x6e, 0x69, 0x6e, 0x67, - 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, - 0x29, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x77, 0x69, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x70, - 0x72, 0x69, 0x63, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x77, 0x69, 0x6e, 0x6e, - 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x22, 0x52, 0x0c, 0x77, 0x69, 0x6e, 0x6e, - 0x69, 0x6e, 0x67, 0x50, 0x72, 0x69, 0x63, 0x65, 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x22, 0x4c, - 0x0a, 0x08, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3a, 0x0a, 0x08, 0x61, 0x75, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, - 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x41, - 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x08, 0x61, 0x75, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x22, 0x9f, 0x05, 0x0a, - 0x03, 0x42, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x5f, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x62, 0x69, 0x64, - 0x64, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x68, 0x61, 0x73, - 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x48, - 0x61, 0x73, 0x68, 0x12, 0x6e, 0x0a, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x74, 0x69, - 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x25, 0x6a, 0x73, - 0x6f, 0x6e, 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, - 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x74, 0x69, - 0x6d, 0x65, 0x22, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x54, - 0x69, 0x6d, 0x65, 0x12, 0x65, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x66, 0x65, - 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, - 0x69, 0x6e, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x23, 0x6a, 0x73, 0x6f, 0x6e, - 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x66, 0x65, 0x65, 0x22, 0x20, 0x79, 0x61, - 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x66, 0x65, 0x65, 0x22, 0x52, - 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x46, 0x65, 0x65, 0x12, 0x6e, 0x0a, 0x0b, 0x72, 0x65, - 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x31, 0xc8, 0xde, 0x1f, - 0x00, 0xf2, 0xde, 0x1f, 0x25, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x72, 0x65, 0x76, 0x65, 0x61, - 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x72, 0x65, - 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0a, - 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x65, 0x0a, 0x0a, 0x72, 0x65, - 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, - 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xf2, - 0xde, 0x1f, 0x23, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x5f, - 0x66, 0x65, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x72, 0x65, 0x76, 0x65, 0x61, - 0x6c, 0x5f, 0x66, 0x65, 0x65, 0x22, 0x52, 0x09, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x46, 0x65, - 0x65, 0x12, 0x65, 0x0a, 0x0a, 0x62, 0x69, 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, - 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, - 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, - 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x23, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, - 0x62, 0x69, 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, - 0x3a, 0x22, 0x62, 0x69, 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x52, 0x09, 0x62, - 0x69, 0x64, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x42, 0xbc, - 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x2e, 0x76, 0x64, 0x62, 0x2e, - 0x74, 0x6f, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2d, 0x69, 0x6f, 0x2f, 0x6c, 0x61, 0x63, 0x6f, 0x6e, - 0x69, 0x63, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x61, 0x75, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x76, - 0x31, 0xa2, 0x02, 0x03, 0x43, 0x41, 0x58, 0xaa, 0x02, 0x0f, 0x43, 0x65, 0x72, 0x63, 0x2e, 0x41, - 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x43, 0x65, 0x72, 0x63, - 0x5c, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1b, 0x43, 0x65, - 0x72, 0x63, 0x5c, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, - 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x43, 0x65, 0x72, 0x63, - 0x3a, 0x3a, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, + 0xf2, 0xde, 0x1f, 0x23, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, + 0x5f, 0x66, 0x65, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x72, 0x65, 0x76, 0x65, + 0x61, 0x6c, 0x5f, 0x66, 0x65, 0x65, 0x22, 0x52, 0x09, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x46, + 0x65, 0x65, 0x12, 0x65, 0x0a, 0x0a, 0x62, 0x69, 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, + 0x6e, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x23, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, + 0x22, 0x62, 0x69, 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x20, 0x79, 0x61, 0x6d, + 0x6c, 0x3a, 0x22, 0x62, 0x69, 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x52, 0x09, + 0x62, 0x69, 0x64, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x42, + 0xbc, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x2e, 0x76, 0x64, 0x62, + 0x2e, 0x74, 0x6f, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2d, 0x69, 0x6f, 0x2f, 0x6c, 0x61, 0x63, 0x6f, + 0x6e, 0x69, 0x63, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x61, 0x75, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x41, 0x58, 0xaa, 0x02, 0x0f, 0x43, 0x65, 0x72, 0x63, 0x2e, + 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x43, 0x65, 0x72, + 0x63, 0x5c, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1b, 0x43, + 0x65, 0x72, 0x63, 0x5c, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x43, 0x65, 0x72, + 0x63, 0x3a, 0x3a, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -4080,19 +4429,20 @@ var file_cerc_auction_v1_auction_proto_depIdxs = []int32{ 5, // 8: cerc.auction.v1.Auction.commit_fee:type_name -> cosmos.base.v1beta1.Coin 5, // 9: cerc.auction.v1.Auction.reveal_fee:type_name -> cosmos.base.v1beta1.Coin 5, // 10: cerc.auction.v1.Auction.minimum_bid:type_name -> cosmos.base.v1beta1.Coin - 5, // 11: cerc.auction.v1.Auction.winning_bid:type_name -> cosmos.base.v1beta1.Coin + 5, // 11: cerc.auction.v1.Auction.winning_bids:type_name -> cosmos.base.v1beta1.Coin 5, // 12: cerc.auction.v1.Auction.winning_price:type_name -> cosmos.base.v1beta1.Coin - 1, // 13: cerc.auction.v1.Auctions.auctions:type_name -> cerc.auction.v1.Auction - 6, // 14: cerc.auction.v1.Bid.commit_time:type_name -> google.protobuf.Timestamp - 5, // 15: cerc.auction.v1.Bid.commit_fee:type_name -> cosmos.base.v1beta1.Coin - 6, // 16: cerc.auction.v1.Bid.reveal_time:type_name -> google.protobuf.Timestamp - 5, // 17: cerc.auction.v1.Bid.reveal_fee:type_name -> cosmos.base.v1beta1.Coin - 5, // 18: cerc.auction.v1.Bid.bid_amount:type_name -> cosmos.base.v1beta1.Coin - 19, // [19:19] is the sub-list for method output_type - 19, // [19:19] is the sub-list for method input_type - 19, // [19:19] is the sub-list for extension type_name - 19, // [19:19] is the sub-list for extension extendee - 0, // [0:19] is the sub-list for field type_name + 5, // 13: cerc.auction.v1.Auction.max_price:type_name -> cosmos.base.v1beta1.Coin + 1, // 14: cerc.auction.v1.Auctions.auctions:type_name -> cerc.auction.v1.Auction + 6, // 15: cerc.auction.v1.Bid.commit_time:type_name -> google.protobuf.Timestamp + 5, // 16: cerc.auction.v1.Bid.commit_fee:type_name -> cosmos.base.v1beta1.Coin + 6, // 17: cerc.auction.v1.Bid.reveal_time:type_name -> google.protobuf.Timestamp + 5, // 18: cerc.auction.v1.Bid.reveal_fee:type_name -> cosmos.base.v1beta1.Coin + 5, // 19: cerc.auction.v1.Bid.bid_amount:type_name -> cosmos.base.v1beta1.Coin + 20, // [20:20] is the sub-list for method output_type + 20, // [20:20] is the sub-list for method input_type + 20, // [20:20] is the sub-list for extension type_name + 20, // [20:20] is the sub-list for extension extendee + 0, // [0:20] is the sub-list for field type_name } func init() { file_cerc_auction_v1_auction_proto_init() } diff --git a/api/cerc/auction/v1/tx.pulsar.go b/api/cerc/auction/v1/tx.pulsar.go index 739099fd..28177724 100644 --- a/api/cerc/auction/v1/tx.pulsar.go +++ b/api/cerc/auction/v1/tx.pulsar.go @@ -26,6 +26,9 @@ var ( fd_MsgCreateAuction_reveal_fee protoreflect.FieldDescriptor fd_MsgCreateAuction_minimum_bid protoreflect.FieldDescriptor fd_MsgCreateAuction_signer protoreflect.FieldDescriptor + fd_MsgCreateAuction_max_price protoreflect.FieldDescriptor + fd_MsgCreateAuction_kind protoreflect.FieldDescriptor + fd_MsgCreateAuction_num_providers protoreflect.FieldDescriptor ) func init() { @@ -37,6 +40,9 @@ func init() { fd_MsgCreateAuction_reveal_fee = md_MsgCreateAuction.Fields().ByName("reveal_fee") fd_MsgCreateAuction_minimum_bid = md_MsgCreateAuction.Fields().ByName("minimum_bid") fd_MsgCreateAuction_signer = md_MsgCreateAuction.Fields().ByName("signer") + fd_MsgCreateAuction_max_price = md_MsgCreateAuction.Fields().ByName("max_price") + fd_MsgCreateAuction_kind = md_MsgCreateAuction.Fields().ByName("kind") + fd_MsgCreateAuction_num_providers = md_MsgCreateAuction.Fields().ByName("num_providers") } var _ protoreflect.Message = (*fastReflection_MsgCreateAuction)(nil) @@ -140,6 +146,24 @@ func (x *fastReflection_MsgCreateAuction) Range(f func(protoreflect.FieldDescrip return } } + if x.MaxPrice != nil { + value := protoreflect.ValueOfMessage(x.MaxPrice.ProtoReflect()) + if !f(fd_MsgCreateAuction_max_price, value) { + return + } + } + if x.Kind != "" { + value := protoreflect.ValueOfString(x.Kind) + if !f(fd_MsgCreateAuction_kind, value) { + return + } + } + if x.NumProviders != int32(0) { + value := protoreflect.ValueOfInt32(x.NumProviders) + if !f(fd_MsgCreateAuction_num_providers, value) { + return + } + } } // Has reports whether a field is populated. @@ -167,6 +191,12 @@ func (x *fastReflection_MsgCreateAuction) Has(fd protoreflect.FieldDescriptor) b return x.MinimumBid != nil case "cerc.auction.v1.MsgCreateAuction.signer": return x.Signer != "" + case "cerc.auction.v1.MsgCreateAuction.max_price": + return x.MaxPrice != nil + case "cerc.auction.v1.MsgCreateAuction.kind": + return x.Kind != "" + case "cerc.auction.v1.MsgCreateAuction.num_providers": + return x.NumProviders != int32(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.v1.MsgCreateAuction")) @@ -195,6 +225,12 @@ func (x *fastReflection_MsgCreateAuction) Clear(fd protoreflect.FieldDescriptor) x.MinimumBid = nil case "cerc.auction.v1.MsgCreateAuction.signer": x.Signer = "" + case "cerc.auction.v1.MsgCreateAuction.max_price": + x.MaxPrice = nil + case "cerc.auction.v1.MsgCreateAuction.kind": + x.Kind = "" + case "cerc.auction.v1.MsgCreateAuction.num_providers": + x.NumProviders = int32(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.v1.MsgCreateAuction")) @@ -229,6 +265,15 @@ func (x *fastReflection_MsgCreateAuction) Get(descriptor protoreflect.FieldDescr case "cerc.auction.v1.MsgCreateAuction.signer": value := x.Signer return protoreflect.ValueOfString(value) + case "cerc.auction.v1.MsgCreateAuction.max_price": + value := x.MaxPrice + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cerc.auction.v1.MsgCreateAuction.kind": + value := x.Kind + return protoreflect.ValueOfString(value) + case "cerc.auction.v1.MsgCreateAuction.num_providers": + value := x.NumProviders + return protoreflect.ValueOfInt32(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.v1.MsgCreateAuction")) @@ -261,6 +306,12 @@ func (x *fastReflection_MsgCreateAuction) Set(fd protoreflect.FieldDescriptor, v x.MinimumBid = value.Message().Interface().(*v1beta1.Coin) case "cerc.auction.v1.MsgCreateAuction.signer": x.Signer = value.Interface().(string) + case "cerc.auction.v1.MsgCreateAuction.max_price": + x.MaxPrice = value.Message().Interface().(*v1beta1.Coin) + case "cerc.auction.v1.MsgCreateAuction.kind": + x.Kind = value.Interface().(string) + case "cerc.auction.v1.MsgCreateAuction.num_providers": + x.NumProviders = int32(value.Int()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.v1.MsgCreateAuction")) @@ -306,8 +357,17 @@ func (x *fastReflection_MsgCreateAuction) Mutable(fd protoreflect.FieldDescripto x.MinimumBid = new(v1beta1.Coin) } return protoreflect.ValueOfMessage(x.MinimumBid.ProtoReflect()) + case "cerc.auction.v1.MsgCreateAuction.max_price": + if x.MaxPrice == nil { + x.MaxPrice = new(v1beta1.Coin) + } + return protoreflect.ValueOfMessage(x.MaxPrice.ProtoReflect()) case "cerc.auction.v1.MsgCreateAuction.signer": panic(fmt.Errorf("field signer of message cerc.auction.v1.MsgCreateAuction is not mutable")) + case "cerc.auction.v1.MsgCreateAuction.kind": + panic(fmt.Errorf("field kind of message cerc.auction.v1.MsgCreateAuction is not mutable")) + case "cerc.auction.v1.MsgCreateAuction.num_providers": + panic(fmt.Errorf("field num_providers of message cerc.auction.v1.MsgCreateAuction is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.v1.MsgCreateAuction")) @@ -338,6 +398,13 @@ func (x *fastReflection_MsgCreateAuction) NewField(fd protoreflect.FieldDescript return protoreflect.ValueOfMessage(m.ProtoReflect()) case "cerc.auction.v1.MsgCreateAuction.signer": return protoreflect.ValueOfString("") + case "cerc.auction.v1.MsgCreateAuction.max_price": + m := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cerc.auction.v1.MsgCreateAuction.kind": + return protoreflect.ValueOfString("") + case "cerc.auction.v1.MsgCreateAuction.num_providers": + return protoreflect.ValueOfInt32(int32(0)) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.v1.MsgCreateAuction")) @@ -431,6 +498,17 @@ func (x *fastReflection_MsgCreateAuction) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } + if x.MaxPrice != nil { + l = options.Size(x.MaxPrice) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Kind) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.NumProviders != 0 { + n += 1 + runtime.Sov(uint64(x.NumProviders)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -460,6 +538,32 @@ func (x *fastReflection_MsgCreateAuction) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.NumProviders != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.NumProviders)) + i-- + dAtA[i] = 0x48 + } + if len(x.Kind) > 0 { + i -= len(x.Kind) + copy(dAtA[i:], x.Kind) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Kind))) + i-- + dAtA[i] = 0x42 + } + if x.MaxPrice != nil { + encoded, err := options.Marshal(x.MaxPrice) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x3a + } if len(x.Signer) > 0 { i -= len(x.Signer) copy(dAtA[i:], x.Signer) @@ -798,6 +902,93 @@ func (x *fastReflection_MsgCreateAuction) ProtoMethods() *protoiface.Methods { } x.Signer = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MaxPrice", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.MaxPrice == nil { + x.MaxPrice = &v1beta1.Coin{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.MaxPrice); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Kind = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NumProviders", wireType) + } + x.NumProviders = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.NumProviders |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -4120,6 +4311,12 @@ type MsgCreateAuction struct { MinimumBid *v1beta1.Coin `protobuf:"bytes,5,opt,name=minimum_bid,json=minimumBid,proto3" json:"minimum_bid,omitempty"` // Address of the signer Signer string `protobuf:"bytes,6,opt,name=signer,proto3" json:"signer,omitempty"` + // Maximum acceptable bid amount (for reverse auctions) + MaxPrice *v1beta1.Coin `protobuf:"bytes,7,opt,name=max_price,json=maxPrice,proto3" json:"max_price,omitempty"` + // Auction kind can be vickrey or service_provider + Kind string `protobuf:"bytes,8,opt,name=kind,proto3" json:"kind,omitempty"` + // Number of providers to be selected + NumProviders int32 `protobuf:"varint,9,opt,name=num_providers,json=numProviders,proto3" json:"num_providers,omitempty"` } func (x *MsgCreateAuction) Reset() { @@ -4184,6 +4381,27 @@ func (x *MsgCreateAuction) GetSigner() string { return "" } +func (x *MsgCreateAuction) GetMaxPrice() *v1beta1.Coin { + if x != nil { + return x.MaxPrice + } + return nil +} + +func (x *MsgCreateAuction) GetKind() string { + if x != nil { + return x.Kind + } + return "" +} + +func (x *MsgCreateAuction) GetNumProviders() int32 { + if x != nil { + return x.NumProviders + } + return 0 +} + // MsgCreateAuctionResponse returns the details of the created auction type MsgCreateAuctionResponse struct { state protoimpl.MessageState @@ -4500,7 +4718,7 @@ var file_cerc_auction_v1_tx_proto_rawDesc = []byte{ 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0x9d, 0x05, 0x0a, 0x10, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x74, 0x6f, 0x22, 0xd6, 0x06, 0x0a, 0x10, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x81, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, @@ -4541,110 +4759,122 @@ var file_cerc_auction_v1_tx_proto_rawDesc = []byte{ 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1f, 0xf2, 0xde, 0x1f, 0x1b, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, - 0x72, 0x3a, 0x0f, 0x88, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x69, 0x67, 0x6e, - 0x65, 0x72, 0x22, 0x77, 0x0a, 0x18, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, - 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, - 0x0a, 0x07, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x18, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, - 0x31, 0x2e, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x21, 0xf2, 0xde, 0x1f, 0x1d, 0x6a, - 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x20, 0x79, 0x61, - 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x52, 0x07, 0x61, 0x75, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x22, 0xec, 0x01, 0x0a, 0x0c, - 0x4d, 0x73, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x42, 0x69, 0x64, 0x12, 0x46, 0x0a, 0x0a, - 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x27, 0xf2, 0xde, 0x1f, 0x23, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x61, 0x75, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x75, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x22, 0x52, 0x09, 0x61, 0x75, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x4a, 0x0a, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x68, - 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x29, 0xf2, 0xde, 0x1f, 0x25, 0x6a, - 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, - 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x68, - 0x61, 0x73, 0x68, 0x22, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x48, 0x61, 0x73, 0x68, - 0x12, 0x37, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x1f, 0xf2, 0xde, 0x1f, 0x1b, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x73, 0x69, 0x67, 0x6e, - 0x65, 0x72, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, - 0x22, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x3a, 0x0f, 0x88, 0xa0, 0x1f, 0x00, 0x82, - 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, 0x5f, 0x0a, 0x14, 0x4d, 0x73, - 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x42, 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x41, 0x0a, 0x03, 0x62, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x14, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, - 0x31, 0x2e, 0x42, 0x69, 0x64, 0x42, 0x19, 0xf2, 0xde, 0x1f, 0x15, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, - 0x22, 0x62, 0x69, 0x64, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x62, 0x69, 0x64, 0x22, - 0x52, 0x03, 0x62, 0x69, 0x64, 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x22, 0xd9, 0x01, 0x0a, 0x0c, - 0x4d, 0x73, 0x67, 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x42, 0x69, 0x64, 0x12, 0x46, 0x0a, 0x0a, - 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x27, 0xf2, 0xde, 0x1f, 0x23, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x61, 0x75, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x75, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x22, 0x52, 0x09, 0x61, 0x75, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x37, 0x0a, 0x06, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x1f, 0xf2, 0xde, 0x1f, 0x1b, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, - 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x72, 0x65, - 0x76, 0x65, 0x61, 0x6c, 0x22, 0x52, 0x06, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, 0x37, 0x0a, - 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1f, 0xf2, - 0xde, 0x1f, 0x1b, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, - 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, 0x52, 0x06, - 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x3a, 0x0f, 0x88, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, - 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, 0x73, 0x0a, 0x14, 0x4d, 0x73, 0x67, 0x52, 0x65, - 0x76, 0x65, 0x61, 0x6c, 0x42, 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x55, 0x0a, 0x07, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x18, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x76, 0x31, 0x2e, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x21, 0xf2, 0xde, 0x1f, 0x1d, - 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x20, 0x79, - 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x52, 0x07, 0x61, - 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x22, 0x90, 0x01, 0x0a, - 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, - 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x35, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, - 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, - 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, - 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xe1, 0x03, 0x0a, 0x03, 0x4d, - 0x73, 0x67, 0x12, 0x86, 0x01, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x75, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x29, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, - 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x22, 0x1f, 0x2f, 0x63, 0x65, 0x72, - 0x63, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x5f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x76, 0x0a, 0x09, 0x43, - 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x42, 0x69, 0x64, 0x12, 0x1d, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, - 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x42, 0x69, 0x64, 0x1a, 0x25, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, - 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x42, 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x22, 0x1b, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x61, 0x75, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, - 0x62, 0x69, 0x64, 0x12, 0x76, 0x0a, 0x09, 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x42, 0x69, 0x64, - 0x12, 0x1d, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x42, 0x69, 0x64, 0x1a, - 0x25, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, - 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x42, 0x69, 0x64, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x22, 0x1b, - 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, - 0x2f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x62, 0x69, 0x64, 0x12, 0x5a, 0x0a, 0x0c, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x20, 0x2e, 0x63, 0x65, - 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, - 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x28, 0x2e, + 0x72, 0x12, 0x61, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, + 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, + 0x29, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x21, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6d, + 0x61, 0x78, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, + 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x22, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x50, + 0x72, 0x69, 0x63, 0x65, 0x12, 0x2f, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x1b, 0xf2, 0xde, 0x1f, 0x17, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6b, 0x69, + 0x6e, 0x64, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6b, 0x69, 0x6e, 0x64, 0x22, 0x52, + 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x6e, 0x75, 0x6d, 0x5f, 0x70, 0x72, 0x6f, + 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6e, 0x75, + 0x6d, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x3a, 0x0f, 0x88, 0xa0, 0x1f, 0x00, + 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, 0x77, 0x0a, 0x18, 0x4d, + 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x07, 0x61, 0x75, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, + 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x42, 0x21, 0xf2, 0xde, 0x1f, 0x1d, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x61, 0x75, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x75, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x52, 0x07, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x04, + 0x88, 0xa0, 0x1f, 0x00, 0x22, 0xec, 0x01, 0x0a, 0x0c, 0x4d, 0x73, 0x67, 0x43, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x42, 0x69, 0x64, 0x12, 0x46, 0x0a, 0x0a, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x27, 0xf2, 0xde, 0x1f, 0x23, 0x6a, + 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x22, + 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, + 0x64, 0x22, 0x52, 0x09, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x4a, 0x0a, + 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x29, 0xf2, 0xde, 0x1f, 0x25, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x63, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, + 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x22, 0x52, 0x0a, 0x63, + 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x37, 0x0a, 0x06, 0x73, 0x69, 0x67, + 0x6e, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1f, 0xf2, 0xde, 0x1f, 0x1b, 0x6a, + 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, 0x20, 0x79, 0x61, 0x6d, + 0x6c, 0x3a, 0x22, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, + 0x65, 0x72, 0x3a, 0x0f, 0x88, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x69, 0x67, + 0x6e, 0x65, 0x72, 0x22, 0x5f, 0x0a, 0x14, 0x4d, 0x73, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x42, 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x03, 0x62, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, + 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x69, 0x64, 0x42, 0x19, + 0xf2, 0xde, 0x1f, 0x15, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x62, 0x69, 0x64, 0x22, 0x20, 0x79, + 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x62, 0x69, 0x64, 0x22, 0x52, 0x03, 0x62, 0x69, 0x64, 0x3a, 0x04, + 0x88, 0xa0, 0x1f, 0x00, 0x22, 0xd9, 0x01, 0x0a, 0x0c, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x76, 0x65, + 0x61, 0x6c, 0x42, 0x69, 0x64, 0x12, 0x46, 0x0a, 0x0a, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x27, 0xf2, 0xde, 0x1f, 0x23, 0x6a, + 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x22, + 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, + 0x64, 0x22, 0x52, 0x09, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x37, 0x0a, + 0x06, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1f, 0xf2, + 0xde, 0x1f, 0x1b, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x22, + 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x22, 0x52, 0x06, + 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x12, 0x37, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1f, 0xf2, 0xde, 0x1f, 0x1b, 0x6a, 0x73, 0x6f, 0x6e, + 0x3a, 0x22, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, + 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x3a, + 0x0f, 0x88, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, + 0x22, 0x73, 0x0a, 0x14, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x42, 0x69, 0x64, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x07, 0x61, 0x75, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x65, 0x72, 0x63, + 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x42, 0x21, 0xf2, 0xde, 0x1f, 0x1d, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x61, + 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x75, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x52, 0x07, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, + 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x22, 0x90, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, + 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x12, 0x35, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, + 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x32, 0xe1, 0x03, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x86, 0x01, 0x0a, 0x0d, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, - 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xb7, - 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, - 0x01, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x2e, 0x76, 0x64, 0x62, 0x2e, 0x74, 0x6f, 0x2f, 0x63, 0x65, - 0x72, 0x63, 0x2d, 0x69, 0x6f, 0x2f, 0x6c, 0x61, 0x63, 0x6f, 0x6e, 0x69, 0x63, 0x64, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, - 0x76, 0x31, 0x3b, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, - 0x41, 0x58, 0xaa, 0x02, 0x0f, 0x43, 0x65, 0x72, 0x63, 0x2e, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x41, 0x75, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1b, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x41, 0x75, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x43, 0x65, 0x72, 0x63, 0x3a, 0x3a, 0x41, 0x75, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x1a, 0x29, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x75, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x27, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x21, 0x22, 0x1f, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x75, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x76, 0x0a, 0x09, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x42, 0x69, + 0x64, 0x12, 0x1d, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x42, 0x69, 0x64, + 0x1a, 0x25, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x42, 0x69, 0x64, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x22, + 0x1b, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, + 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x62, 0x69, 0x64, 0x12, 0x76, 0x0a, 0x09, + 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x42, 0x69, 0x64, 0x12, 0x1d, 0x2e, 0x63, 0x65, 0x72, 0x63, + 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, + 0x65, 0x76, 0x65, 0x61, 0x6c, 0x42, 0x69, 0x64, 0x1a, 0x25, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, + 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, + 0x76, 0x65, 0x61, 0x6c, 0x42, 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x22, 0x1b, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x61, + 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, + 0x5f, 0x62, 0x69, 0x64, 0x12, 0x5a, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x12, 0x20, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x28, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xb7, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, + 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x42, + 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x2e, + 0x76, 0x64, 0x62, 0x2e, 0x74, 0x6f, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2d, 0x69, 0x6f, 0x2f, 0x6c, + 0x61, 0x63, 0x6f, 0x6e, 0x69, 0x63, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x65, 0x72, 0x63, + 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x75, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x41, 0x58, 0xaa, 0x02, 0x0f, 0x43, 0x65, + 0x72, 0x63, 0x2e, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, + 0x43, 0x65, 0x72, 0x63, 0x5c, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0xe2, + 0x02, 0x1b, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, + 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, + 0x43, 0x65, 0x72, 0x63, 0x3a, 0x3a, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x3a, 0x56, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -4681,23 +4911,24 @@ var file_cerc_auction_v1_tx_proto_depIdxs = []int32{ 9, // 2: cerc.auction.v1.MsgCreateAuction.commit_fee:type_name -> cosmos.base.v1beta1.Coin 9, // 3: cerc.auction.v1.MsgCreateAuction.reveal_fee:type_name -> cosmos.base.v1beta1.Coin 9, // 4: cerc.auction.v1.MsgCreateAuction.minimum_bid:type_name -> cosmos.base.v1beta1.Coin - 10, // 5: cerc.auction.v1.MsgCreateAuctionResponse.auction:type_name -> cerc.auction.v1.Auction - 11, // 6: cerc.auction.v1.MsgCommitBidResponse.bid:type_name -> cerc.auction.v1.Bid - 10, // 7: cerc.auction.v1.MsgRevealBidResponse.auction:type_name -> cerc.auction.v1.Auction - 12, // 8: cerc.auction.v1.MsgUpdateParams.params:type_name -> cerc.auction.v1.Params - 0, // 9: cerc.auction.v1.Msg.CreateAuction:input_type -> cerc.auction.v1.MsgCreateAuction - 2, // 10: cerc.auction.v1.Msg.CommitBid:input_type -> cerc.auction.v1.MsgCommitBid - 4, // 11: cerc.auction.v1.Msg.RevealBid:input_type -> cerc.auction.v1.MsgRevealBid - 6, // 12: cerc.auction.v1.Msg.UpdateParams:input_type -> cerc.auction.v1.MsgUpdateParams - 1, // 13: cerc.auction.v1.Msg.CreateAuction:output_type -> cerc.auction.v1.MsgCreateAuctionResponse - 3, // 14: cerc.auction.v1.Msg.CommitBid:output_type -> cerc.auction.v1.MsgCommitBidResponse - 5, // 15: cerc.auction.v1.Msg.RevealBid:output_type -> cerc.auction.v1.MsgRevealBidResponse - 7, // 16: cerc.auction.v1.Msg.UpdateParams:output_type -> cerc.auction.v1.MsgUpdateParamsResponse - 13, // [13:17] is the sub-list for method output_type - 9, // [9:13] is the sub-list for method input_type - 9, // [9:9] is the sub-list for extension type_name - 9, // [9:9] is the sub-list for extension extendee - 0, // [0:9] is the sub-list for field type_name + 9, // 5: cerc.auction.v1.MsgCreateAuction.max_price:type_name -> cosmos.base.v1beta1.Coin + 10, // 6: cerc.auction.v1.MsgCreateAuctionResponse.auction:type_name -> cerc.auction.v1.Auction + 11, // 7: cerc.auction.v1.MsgCommitBidResponse.bid:type_name -> cerc.auction.v1.Bid + 10, // 8: cerc.auction.v1.MsgRevealBidResponse.auction:type_name -> cerc.auction.v1.Auction + 12, // 9: cerc.auction.v1.MsgUpdateParams.params:type_name -> cerc.auction.v1.Params + 0, // 10: cerc.auction.v1.Msg.CreateAuction:input_type -> cerc.auction.v1.MsgCreateAuction + 2, // 11: cerc.auction.v1.Msg.CommitBid:input_type -> cerc.auction.v1.MsgCommitBid + 4, // 12: cerc.auction.v1.Msg.RevealBid:input_type -> cerc.auction.v1.MsgRevealBid + 6, // 13: cerc.auction.v1.Msg.UpdateParams:input_type -> cerc.auction.v1.MsgUpdateParams + 1, // 14: cerc.auction.v1.Msg.CreateAuction:output_type -> cerc.auction.v1.MsgCreateAuctionResponse + 3, // 15: cerc.auction.v1.Msg.CommitBid:output_type -> cerc.auction.v1.MsgCommitBidResponse + 5, // 16: cerc.auction.v1.Msg.RevealBid:output_type -> cerc.auction.v1.MsgRevealBidResponse + 7, // 17: cerc.auction.v1.Msg.UpdateParams:output_type -> cerc.auction.v1.MsgUpdateParamsResponse + 14, // [14:18] is the sub-list for method output_type + 10, // [10:14] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name } func init() { file_cerc_auction_v1_tx_proto_init() } diff --git a/proto/cerc/auction/v1/auction.proto b/proto/cerc/auction/v1/auction.proto index f80c9d6f..d7d6301f 100644 --- a/proto/cerc/auction/v1/auction.proto +++ b/proto/cerc/auction/v1/auction.proto @@ -95,20 +95,34 @@ message Auction { (gogoproto.moretags) = "json:\"minimum_bid\" yaml:\"minimum_bid\"" ]; - // Address of the winner - string winner_address = 10; + // Addresses of the winners + repeated string winner_addresses = 10; - // Winning bid, i.e., the highest bid - cosmos.base.v1beta1.Coin winning_bid = 11 [ + // Winning bids, i.e., the best bids + repeated cosmos.base.v1beta1.Coin winning_bids = 11 [ (gogoproto.nullable) = false, - (gogoproto.moretags) = "json:\"winning_bid\" yaml:\"winning_bid\"" + (gogoproto.moretags) = "json:\"winning_bids\" yaml:\"winning_bids\"" ]; - // Amount the winner pays, i.e. the second highest auction + // Amount the winner pays, i.e. the second best bid cosmos.base.v1beta1.Coin winning_price = 12 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"winning_price\" yaml:\"winning_price\"" ]; + + // Maximum acceptable bid amount for a valid commit for reverse auctions + cosmos.base.v1beta1.Coin max_price = 13 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"max_price\" yaml:\"max_price\"" + ]; + + // Auction kind can be vickrey or service_provider + string kind = 14 [ + (gogoproto.moretags) = "json:\"kind\" yaml:\"kind\"" + ]; + + // Number of providers to be selected + int32 num_providers = 15; } // Auctions represent all the auctions in the module diff --git a/proto/cerc/auction/v1/tx.proto b/proto/cerc/auction/v1/tx.proto index a89481ef..a469dcdf 100644 --- a/proto/cerc/auction/v1/tx.proto +++ b/proto/cerc/auction/v1/tx.proto @@ -76,6 +76,20 @@ message MsgCreateAuction { // Address of the signer string signer = 6 [ (gogoproto.moretags) = "json:\"signer\" yaml:\"signer\"" ]; + + // Maximum acceptable bid amount (for reverse auctions) + cosmos.base.v1beta1.Coin max_price = 7 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"max_price\" yaml:\"max_price\"" + ]; + + // Auction kind can be vickrey or service_provider + string kind = 8 [ + (gogoproto.moretags) = "json:\"kind\" yaml:\"kind\"" + ]; + + // Number of providers to be selected + int32 num_providers = 9; } // MsgCreateAuctionResponse returns the details of the created auction diff --git a/x/auction/auction.pb.go b/x/auction/auction.pb.go index 98d7d482..1612dede 100644 --- a/x/auction/auction.pb.go +++ b/x/auction/auction.pb.go @@ -128,12 +128,18 @@ type Auction struct { RevealFee types.Coin `protobuf:"bytes,8,opt,name=reveal_fee,json=revealFee,proto3" json:"reveal_fee" json:"reveal_fee" yaml:"reveal_fee"` // Minimum acceptable bid amount for a valid commit MinimumBid types.Coin `protobuf:"bytes,9,opt,name=minimum_bid,json=minimumBid,proto3" json:"minimum_bid" json:"minimum_bid" yaml:"minimum_bid"` - // Address of the winner - WinnerAddress string `protobuf:"bytes,10,opt,name=winner_address,json=winnerAddress,proto3" json:"winner_address,omitempty"` - // Winning bid, i.e., the highest bid - WinningBid types.Coin `protobuf:"bytes,11,opt,name=winning_bid,json=winningBid,proto3" json:"winning_bid" json:"winning_bid" yaml:"winning_bid"` - // Amount the winner pays, i.e. the second highest auction + // Addresses of the winners + WinnerAddresses []string `protobuf:"bytes,10,rep,name=winner_addresses,json=winnerAddresses,proto3" json:"winner_addresses,omitempty"` + // Winning bids, i.e., the best bids + WinningBids []types.Coin `protobuf:"bytes,11,rep,name=winning_bids,json=winningBids,proto3" json:"winning_bids" json:"winning_bids" yaml:"winning_bids"` + // Amount the winner pays, i.e. the second best bid WinningPrice types.Coin `protobuf:"bytes,12,opt,name=winning_price,json=winningPrice,proto3" json:"winning_price" json:"winning_price" yaml:"winning_price"` + // Maximum acceptable bid amount for a valid commit for reverse auctions + MaxPrice types.Coin `protobuf:"bytes,13,opt,name=max_price,json=maxPrice,proto3" json:"max_price" json:"max_price" yaml:"max_price"` + // Auction kind can be vickrey or service_provider + Kind string `protobuf:"bytes,14,opt,name=kind,proto3" json:"kind,omitempty" json:"kind" yaml:"kind"` + // Number of providers to be selected + NumProviders int32 `protobuf:"varint,15,opt,name=num_providers,json=numProviders,proto3" json:"num_providers,omitempty"` } func (m *Auction) Reset() { *m = Auction{} } @@ -263,57 +269,63 @@ func init() { func init() { proto.RegisterFile("cerc/auction/v1/auction.proto", fileDescriptor_34b162eb5b365523) } var fileDescriptor_34b162eb5b365523 = []byte{ - // 798 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x4d, 0x4f, 0xdb, 0x4a, - 0x14, 0x8d, 0x49, 0x08, 0xf1, 0x98, 0xc0, 0x93, 0xf5, 0xf4, 0x94, 0x17, 0x89, 0x04, 0x05, 0x21, - 0xf1, 0xf4, 0x84, 0xad, 0xd0, 0x5d, 0xba, 0xa8, 0x48, 0x3f, 0xd4, 0x4a, 0x5d, 0x20, 0xab, 0xab, - 0x6e, 0xa2, 0xb1, 0x67, 0x08, 0x53, 0xc5, 0x1e, 0xea, 0x71, 0x42, 0xbb, 0xec, 0xae, 0x4b, 0xd4, - 0x15, 0xbb, 0xf6, 0xe7, 0xb0, 0x2b, 0xcb, 0xae, 0x68, 0x05, 0xff, 0xa0, 0xbf, 0xa0, 0x9a, 0xaf, - 0x64, 0x6c, 0xa8, 0xd2, 0x2c, 0x60, 0xe7, 0x39, 0x33, 0xf7, 0x9e, 0x73, 0x2f, 0xf7, 0xdc, 0x00, - 0x36, 0x22, 0x9c, 0x46, 0x3e, 0x1c, 0x47, 0x19, 0xa1, 0x89, 0x3f, 0xe9, 0xea, 0x4f, 0xef, 0x38, - 0xa5, 0x19, 0x75, 0xd7, 0xf9, 0xb5, 0xa7, 0xb1, 0x49, 0xb7, 0xf9, 0xf7, 0x90, 0x0e, 0xa9, 0xb8, - 0xf3, 0xf9, 0x97, 0x7c, 0xd6, 0x6c, 0x0d, 0x29, 0x1d, 0x8e, 0xb0, 0x2f, 0x4e, 0xe1, 0xf8, 0xd0, - 0x47, 0xe3, 0x14, 0xce, 0xd2, 0x34, 0xdb, 0xc5, 0xfb, 0x8c, 0xc4, 0x98, 0x65, 0x30, 0x3e, 0xd6, - 0x09, 0x22, 0xca, 0x62, 0xca, 0xfc, 0x10, 0x32, 0xec, 0x4f, 0xba, 0x21, 0xce, 0x60, 0xd7, 0x8f, - 0x28, 0x51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 0xed, 0x8b, 0x6f, 0x39, 0xa1, 0xfd, 0x47, 0xe7, 0x57, 0x2d, 0xeb, 0xe2, - 0xaa, 0x65, 0xfd, 0xb8, 0x6a, 0x59, 0xa7, 0xd7, 0xad, 0xd2, 0xc5, 0x75, 0xab, 0xf4, 0xed, 0xba, - 0x55, 0x7a, 0xbd, 0x3d, 0x24, 0x99, 0x37, 0x41, 0xa1, 0x97, 0x51, 0x9f, 0x4f, 0xfd, 0x2e, 0xa1, - 0xfe, 0x08, 0x46, 0x34, 0x21, 0x11, 0xf2, 0xdf, 0xe9, 0xff, 0x12, 0xc3, 0xaa, 0xe8, 0xf3, 0x83, - 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x61, 0xbb, 0x15, 0xc2, 0x47, 0x0a, 0x00, 0x00, + // 892 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xcf, 0x6f, 0xe3, 0x44, + 0x14, 0x8e, 0x9b, 0x34, 0xad, 0x27, 0xfd, 0xb1, 0xb2, 0x10, 0x98, 0xa2, 0x4d, 0x42, 0x57, 0x15, + 0xad, 0xd0, 0xda, 0x0a, 0xdc, 0xca, 0x01, 0xc5, 0xfc, 0x10, 0x48, 0x1c, 0x2a, 0x8b, 0x13, 0x17, + 0x6b, 0xec, 0x99, 0x4d, 0x07, 0x32, 0x33, 0xc1, 0x63, 0x67, 0xcb, 0x91, 0x1b, 0xc7, 0x3d, 0xee, + 0x0d, 0xfe, 0x9c, 0xbd, 0xb1, 0x12, 0x17, 0x4e, 0x05, 0xb5, 0xff, 0xc1, 0xfe, 0x05, 0x68, 0x7e, + 0x39, 0xb6, 0x77, 0x21, 0xe4, 0xd0, 0xde, 0x3c, 0x9f, 0xe7, 0xbd, 0xef, 0x7b, 0xcf, 0xef, 0x7d, + 0x09, 0x78, 0x98, 0xe1, 0x3c, 0x0b, 0x61, 0x99, 0x15, 0x84, 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x19, 0x3a, 0xcf, 0x6e, 0x87, 0x9d, 0x97, 0xb7, 0xc3, 0xce, 0x9f, 0xb7, 0xc3, 0xce, + 0x77, 0x27, 0x33, 0x52, 0x04, 0x4b, 0x94, 0x06, 0x05, 0x0f, 0xe5, 0xd4, 0x3f, 0x26, 0x3c, 0x9c, + 0xc3, 0x8c, 0x33, 0x92, 0xa1, 0xf0, 0xca, 0xfe, 0xcd, 0x4d, 0xfb, 0xaa, 0xcf, 0x1f, 0xff, 0x13, + 0x00, 0x00, 0xff, 0xff, 0xac, 0x9f, 0x65, 0x0b, 0x08, 0x0b, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -405,6 +417,28 @@ func (m *Auction) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.NumProviders != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.NumProviders)) + i-- + dAtA[i] = 0x78 + } + if len(m.Kind) > 0 { + i -= len(m.Kind) + copy(dAtA[i:], m.Kind) + i = encodeVarintAuction(dAtA, i, uint64(len(m.Kind))) + i-- + dAtA[i] = 0x72 + } + { + size, err := m.MaxPrice.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x6a { size, err := m.WinningPrice.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -415,22 +449,28 @@ func (m *Auction) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x62 - { - size, err := m.WinningBid.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if len(m.WinningBids) > 0 { + for iNdEx := len(m.WinningBids) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.WinningBids[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a } - i -= size - i = encodeVarintAuction(dAtA, i, uint64(size)) } - i-- - dAtA[i] = 0x5a - if len(m.WinnerAddress) > 0 { - i -= len(m.WinnerAddress) - copy(dAtA[i:], m.WinnerAddress) - i = encodeVarintAuction(dAtA, i, uint64(len(m.WinnerAddress))) - i-- - dAtA[i] = 0x52 + if len(m.WinnerAddresses) > 0 { + for iNdEx := len(m.WinnerAddresses) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.WinnerAddresses[iNdEx]) + copy(dAtA[i:], m.WinnerAddresses[iNdEx]) + i = encodeVarintAuction(dAtA, i, uint64(len(m.WinnerAddresses[iNdEx]))) + i-- + dAtA[i] = 0x52 + } } { size, err := m.MinimumBid.MarshalToSizedBuffer(dAtA[:i]) @@ -704,14 +744,29 @@ func (m *Auction) Size() (n int) { n += 1 + l + sovAuction(uint64(l)) l = m.MinimumBid.Size() n += 1 + l + sovAuction(uint64(l)) - l = len(m.WinnerAddress) + if len(m.WinnerAddresses) > 0 { + for _, s := range m.WinnerAddresses { + l = len(s) + n += 1 + l + sovAuction(uint64(l)) + } + } + if len(m.WinningBids) > 0 { + for _, e := range m.WinningBids { + l = e.Size() + n += 1 + l + sovAuction(uint64(l)) + } + } + l = m.WinningPrice.Size() + n += 1 + l + sovAuction(uint64(l)) + l = m.MaxPrice.Size() + n += 1 + l + sovAuction(uint64(l)) + l = len(m.Kind) if l > 0 { n += 1 + l + sovAuction(uint64(l)) } - l = m.WinningBid.Size() - n += 1 + l + sovAuction(uint64(l)) - l = m.WinningPrice.Size() - n += 1 + l + sovAuction(uint64(l)) + if m.NumProviders != 0 { + n += 1 + sovAuction(uint64(m.NumProviders)) + } return n } @@ -1311,7 +1366,7 @@ func (m *Auction) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 10: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field WinnerAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field WinnerAddresses", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1339,11 +1394,11 @@ func (m *Auction) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.WinnerAddress = string(dAtA[iNdEx:postIndex]) + m.WinnerAddresses = append(m.WinnerAddresses, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 11: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field WinningBid", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field WinningBids", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1370,7 +1425,8 @@ func (m *Auction) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.WinningBid.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.WinningBids = append(m.WinningBids, types.Coin{}) + if err := m.WinningBids[len(m.WinningBids)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1407,6 +1463,90 @@ func (m *Auction) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxPrice", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MaxPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Kind = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 15: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumProviders", wireType) + } + m.NumProviders = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumProviders |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipAuction(dAtA[iNdEx:]) diff --git a/x/auction/tx.pb.go b/x/auction/tx.pb.go index a1171bd7..14ef381c 100644 --- a/x/auction/tx.pb.go +++ b/x/auction/tx.pb.go @@ -50,6 +50,12 @@ type MsgCreateAuction struct { MinimumBid types.Coin `protobuf:"bytes,5,opt,name=minimum_bid,json=minimumBid,proto3" json:"minimum_bid" json:"minimum_bid" yaml:"minimum_bid"` // Address of the signer Signer string `protobuf:"bytes,6,opt,name=signer,proto3" json:"signer,omitempty" json:"signer" yaml:"signer"` + // Maximum acceptable bid amount (for reverse auctions) + MaxPrice types.Coin `protobuf:"bytes,7,opt,name=max_price,json=maxPrice,proto3" json:"max_price" json:"max_price" yaml:"max_price"` + // Auction kind can be vickrey or service_provider + Kind string `protobuf:"bytes,8,opt,name=kind,proto3" json:"kind,omitempty" json:"kind" yaml:"kind"` + // Number of providers to be selected + NumProviders int32 `protobuf:"varint,9,opt,name=num_providers,json=numProviders,proto3" json:"num_providers,omitempty"` } func (m *MsgCreateAuction) Reset() { *m = MsgCreateAuction{} } @@ -398,63 +404,68 @@ func init() { func init() { proto.RegisterFile("cerc/auction/v1/tx.proto", fileDescriptor_70947cda59e835fd) } var fileDescriptor_70947cda59e835fd = []byte{ - // 881 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x41, 0x6f, 0xdc, 0x44, - 0x14, 0x5e, 0x77, 0x93, 0x45, 0x3b, 0x29, 0xa4, 0xb2, 0x82, 0xe2, 0x6c, 0xc9, 0x3a, 0x71, 0x15, - 0x35, 0x2d, 0x8a, 0xad, 0x04, 0x41, 0xa5, 0x70, 0x40, 0x71, 0x51, 0x05, 0x48, 0x91, 0x90, 0x51, - 0x2f, 0xbd, 0xac, 0xc6, 0xf6, 0xd4, 0x3b, 0x68, 0xed, 0x59, 0x79, 0xbc, 0x4b, 0x7b, 0x83, 0x1e, - 0x10, 0xc7, 0x4a, 0x5c, 0xb8, 0x20, 0xf1, 0x13, 0x7a, 0xe0, 0x47, 0xf4, 0x58, 0xc1, 0x05, 0x2e, - 0x0b, 0x24, 0x48, 0xbd, 0x70, 0xda, 0x5f, 0x80, 0x66, 0xe6, 0xcd, 0xda, 0xeb, 0x5d, 0x35, 0xaa, - 0x88, 0xb8, 0xed, 0x7b, 0xdf, 0x9b, 0xf7, 0x7d, 0xef, 0xf3, 0x1b, 0x7b, 0x91, 0x15, 0x91, 0x3c, - 0xf2, 0xf0, 0x28, 0x2a, 0x28, 0xcb, 0xbc, 0xf1, 0xa1, 0x57, 0x3c, 0x72, 0x87, 0x39, 0x2b, 0x98, - 0xb9, 0x2e, 0x10, 0x17, 0x10, 0x77, 0x7c, 0xd8, 0xd9, 0x8c, 0x18, 0x4f, 0x19, 0xf7, 0x52, 0x9e, - 0x88, 0xc2, 0x94, 0x27, 0xaa, 0xb2, 0xb3, 0x91, 0xb0, 0x84, 0xc9, 0x9f, 0x9e, 0xf8, 0x05, 0xd9, - 0x77, 0x12, 0xc6, 0x92, 0x01, 0xf1, 0xf0, 0x90, 0x7a, 0x38, 0xcb, 0x58, 0x81, 0x45, 0x23, 0x0e, - 0x68, 0x17, 0x50, 0x19, 0x85, 0xa3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xfe, 0xfe, 0xca, 0xae, 0x63, 0x7b, 0xf5, 0xef, 0x5e, - 0x24, 0xeb, 0x7b, 0x90, 0x31, 0xc7, 0xa8, 0x5d, 0xde, 0xed, 0xed, 0xa5, 0x04, 0x1a, 0xee, 0xec, - 0xbd, 0x12, 0x9e, 0x71, 0xdf, 0x90, 0xdc, 0xdb, 0xce, 0xf5, 0x45, 0x6e, 0x75, 0x81, 0x43, 0x1a, - 0x0b, 0xde, 0xf2, 0x0e, 0x2c, 0xe5, 0x9d, 0xc1, 0xcb, 0x79, 0x17, 0xd6, 0xec, 0x15, 0xbc, 0xf0, - 0x25, 0x10, 0xbc, 0x0f, 0xd0, 0xd5, 0xb9, 0x55, 0xd9, 0x59, 0xd6, 0xbb, 0x5a, 0xd1, 0xd9, 0xbf, - 0xa8, 0x42, 0x0b, 0xe8, 0xac, 0x7e, 0xfd, 0xf2, 0xd9, 0x6d, 0xc3, 0xff, 0xe8, 0xf9, 0x59, 0xd7, - 0x78, 0x71, 0xd6, 0x35, 0xfe, 0x3c, 0xeb, 0x1a, 0x4f, 0xcf, 0xbb, 0x8d, 0x17, 0xe7, 0xdd, 0xc6, - 0x6f, 0xe7, 0xdd, 0xc6, 0x83, 0xbd, 0x84, 0x16, 0xee, 0x38, 0x0e, 0x5d, 0xf1, 0xef, 0x84, 0xe4, - 0xd1, 0x01, 0x65, 0xde, 0x00, 0x47, 0x2c, 0xa3, 0x51, 0xec, 0x3d, 0xd2, 0x8a, 0xc3, 0x96, 0xfc, - 0xa0, 0xbf, 0xf7, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xca, 0x2e, 0x75, 0x29, 0x87, 0x09, 0x00, - 0x00, + // 964 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xc1, 0x6e, 0xdb, 0x46, + 0x10, 0x15, 0x23, 0x5b, 0x89, 0xd6, 0x4e, 0x1d, 0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2b, + 0x5a, 0x65, 0x00, 0xb4, 0x5e, 0x6e, 0x49, 0xf7, 0x20, 0x61, 0xe7, 0xf7, 0x1a, 0xba, 0x73, 0xc4, + 0xe3, 0x07, 0x19, 0xc1, 0x39, 0x39, 0x54, 0x90, 0xf9, 0x9d, 0x81, 0xee, 0x84, 0x2c, 0x49, 0x68, + 0xce, 0xdb, 0x5a, 0x89, 0x65, 0xb4, 0x8c, 0xed, 0x85, 0xfd, 0x55, 0x57, 0x49, 0x75, 0xb5, 0x54, + 0xf7, 0x53, 0x08, 0xf0, 0x3f, 0x7e, 0x39, 0xb0, 0x2b, 0xc3, 0x81, 0xed, 0x7d, 0xc5, 0x59, 0x7a, + 0xe0, 0x94, 0x0b, 0x38, 0xad, 0xa7, 0x38, 0x39, 0x9d, 0xe1, 0xff, 0xe9, 0x2f, 0xdb, 0x08, 0x96, + 0xc0, 0xad, 0xab, 0x49, 0x0d, 0x19, 0xe9, 0x13, 0x7c, 0x5a, 0xd0, 0x70, 0xe3, 0x8a, 0x1a, 0xca, + 0x05, 0xb4, 0x86, 0x29, 0xbf, 0xd2, 0x00, 0xee, 0x91, 0x06, 0x82, 0x90, 0x92, 0xd5, 0x7e, 0x42, + 0x88, 0x55, 0x05, 0x72, 0x18, 0xaf, 0x78, 0x17, 0x2e, 0xbc, 0x0b, 0xf7, 0x01, 0xa3, 0xa9, 0xff, + 0x3e, 0x90, 0x6f, 0x16, 0x07, 0x20, 0x52, 0x27, 0x5b, 0x97, 0x9e, 0xa0, 0xae, 0x8c, 0x87, 0x84, + 0x08, 0x1a, 0xc5, 0x2c, 0x69, 0xe6, 0xae, 0x48, 0x33, 0x4e, 0x9d, 0xec, 0x0e, 0x68, 0x94, 0x21, + 0x68, 0x28, 0x5a, 0x48, 0x68, 0x4a, 0x93, 0x5e, 0xd2, 0xee, 0xd0, 0xc8, 0x9a, 0xbf, 0x8c, 0x67, + 0x17, 0x78, 0xb6, 0x14, 0x4f, 0x21, 0x57, 0x13, 0x15, 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64, 0x29, 0x0d, 0x23, 0xef, 0x4c, 0x2b, + 0xee, 0xd4, 0xe4, 0x3f, 0x91, 0x0f, 0xfe, 0x0f, 0x00, 0x00, 0xff, 0xff, 0x19, 0xc5, 0xcc, 0xe1, + 0x40, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -675,6 +686,28 @@ func (m *MsgCreateAuction) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.NumProviders != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.NumProviders)) + i-- + dAtA[i] = 0x48 + } + if len(m.Kind) > 0 { + i -= len(m.Kind) + copy(dAtA[i:], m.Kind) + i = encodeVarintTx(dAtA, i, uint64(len(m.Kind))) + i-- + dAtA[i] = 0x42 + } + { + size, err := m.MaxPrice.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a if len(m.Signer) > 0 { i -= len(m.Signer) copy(dAtA[i:], m.Signer) @@ -712,21 +745,21 @@ func (m *MsgCreateAuction) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x1a - n4, err4 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.RevealsDuration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.RevealsDuration):]) - if err4 != nil { - return 0, err4 - } - i -= n4 - i = encodeVarintTx(dAtA, i, uint64(n4)) - i-- - dAtA[i] = 0x12 - n5, err5 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.CommitsDuration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.CommitsDuration):]) + n5, err5 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.RevealsDuration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.RevealsDuration):]) if err5 != nil { return 0, err5 } i -= n5 i = encodeVarintTx(dAtA, i, uint64(n5)) i-- + dAtA[i] = 0x12 + n6, err6 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.CommitsDuration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.CommitsDuration):]) + if err6 != nil { + return 0, err6 + } + i -= n6 + i = encodeVarintTx(dAtA, i, uint64(n6)) + i-- dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -1018,6 +1051,15 @@ func (m *MsgCreateAuction) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } + l = m.MaxPrice.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.Kind) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.NumProviders != 0 { + n += 1 + sovTx(uint64(m.NumProviders)) + } return n } @@ -1358,6 +1400,90 @@ func (m *MsgCreateAuction) Unmarshal(dAtA []byte) error { } m.Signer = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxPrice", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MaxPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Kind = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumProviders", wireType) + } + m.NumProviders = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumProviders |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) -- 2.45.2 From 5a1546a7c91ba87e047e3665fa377eab297a9ae6 Mon Sep 17 00:00:00 2001 From: IshaVenikar Date: Fri, 13 Sep 2024 13:00:10 +0530 Subject: [PATCH 02/29] Update method to pick auction winner --- x/auction/keeper/keeper.go | 40 +++++++++++++++++++++++++++++--------- x/auction/types.go | 6 ++++++ 2 files changed, 37 insertions(+), 9 deletions(-) diff --git a/x/auction/keeper/keeper.go b/x/auction/keeper/keeper.go index 019b4be0..4b506d53 100644 --- a/x/auction/keeper/keeper.go +++ b/x/auction/keeper/keeper.go @@ -5,6 +5,7 @@ import ( "encoding/json" "errors" "fmt" + "slices" "time" "cosmossdk.io/collections" @@ -12,8 +13,10 @@ import ( storetypes "cosmossdk.io/core/store" errorsmod "cosmossdk.io/errors" "cosmossdk.io/log" + "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" auth "github.com/cosmos/cosmos-sdk/x/auth/keeper" @@ -339,6 +342,16 @@ func (k Keeper) CreateAuction(ctx sdk.Context, msg auctiontypes.MsgCreateAuction commitsEndTime := now.Add(msg.CommitsDuration) revealsEndTime := now.Add(msg.CommitsDuration + msg.RevealsDuration) + if msg.Kind == auctiontypes.AuctionKindServiceProvider { + totalMaxBidAmount := sdk.NewCoin(msg.MaxPrice.Denom, msg.MaxPrice.Amount.MulRaw(int64(msg.NumProviders))) + + sdkErr := k.bankKeeper.SendCoinsFromAccountToModule(ctx, signerAddress, auctiontypes.ModuleName, sdk.NewCoins(totalMaxBidAmount)) + if sdkErr != nil { + k.Logger(ctx).Error(fmt.Sprintf("Auction error transferring maximum_bid amount: %v", sdkErr)) + panic(sdkErr) + } + } + auction := auctiontypes.Auction{ Id: auctionId, Status: auctiontypes.AuctionStatusCommitPhase, @@ -349,6 +362,9 @@ func (k Keeper) CreateAuction(ctx sdk.Context, msg auctiontypes.MsgCreateAuction CommitFee: msg.CommitFee, RevealFee: msg.RevealFee, MinimumBid: msg.MinimumBid, + MaxPrice: msg.MaxPrice, + Kind: msg.Kind, + NumProviders: msg.NumProviders, } // Save auction in store. @@ -606,8 +622,14 @@ func (k Keeper) processAuctionPhases(ctx sdk.Context) error { // If auction has expired, pick a winner from revealed bids. if auction.Status == auctiontypes.AuctionStatusExpired { - if err = k.pickAuctionWinner(ctx, auction); err != nil { - return err + if auction.Kind == auctiontypes.AuctionKindVickrey { + if err = k.pickAuctionWinner(ctx, auction); err != nil { + return err + } + } else { + if err = k.pickServiceProviderAuctionWinner(ctx, auction); err != nil { + return err + } } } } @@ -635,6 +657,7 @@ func (k Keeper) deleteCompletedAuctions(ctx sdk.Context) error { return nil } +// Pick winner for vickrey auction func (k Keeper) pickAuctionWinner(ctx sdk.Context, auction *auctiontypes.Auction) error { k.Logger(ctx).Info(fmt.Sprintf("Picking auction %s winner.", auction.Id)) @@ -686,16 +709,15 @@ func (k Keeper) pickAuctionWinner(ctx sdk.Context, auction *auctiontypes.Auction auction.Status = auctiontypes.AuctionStatusCompleted if highestBid != nil { - auction.WinnerAddress = highestBid.BidderAddress - auction.WinningBid = highestBid.BidAmount - + winnerAddresses := make([]string, 1) + auction.WinnerAddresses = winnerAddresses // Winner pays 2nd price, if a 2nd price exists. auction.WinningPrice = highestBid.BidAmount if secondHighestBid != nil { auction.WinningPrice = secondHighestBid.BidAmount } - k.Logger(ctx).Info(fmt.Sprintf("Auction %s winner %s.", auction.Id, auction.WinnerAddress)) - k.Logger(ctx).Info(fmt.Sprintf("Auction %s winner bid %s.", auction.Id, auction.WinningBid.String())) + k.Logger(ctx).Info(fmt.Sprintf("Auction %s winner %s.", auction.Id, auction.WinnerAddresses[0])) + k.Logger(ctx).Info(fmt.Sprintf("Auction %s winner bid %s.", auction.Id, auction.WinningBids[0].String())) k.Logger(ctx).Info(fmt.Sprintf("Auction %s winner price %s.", auction.Id, auction.WinningPrice.String())) } else { k.Logger(ctx).Info(fmt.Sprintf("Auction %s has no valid revealed bids (no winner).", auction.Id)) @@ -730,8 +752,8 @@ func (k Keeper) pickAuctionWinner(ctx sdk.Context, auction *auctiontypes.Auction } // Process winner account (if nobody bids, there won't be a winner). - if auction.WinnerAddress != "" { - winnerAddress, err := sdk.AccAddressFromBech32(auction.WinnerAddress) + if len(auction.WinnerAddresses) == 0 { + winnerAddress, err := sdk.AccAddressFromBech32(auction.WinnerAddresses[0]) if err != nil { k.Logger(ctx).Error(fmt.Sprintf("Invalid winner address. %v", err)) panic("Invalid winner address.") diff --git a/x/auction/types.go b/x/auction/types.go index 4dc53e06..02ac8b38 100644 --- a/x/auction/types.go +++ b/x/auction/types.go @@ -29,6 +29,12 @@ const ( BidStatusRevealed = "reveal" ) +// Auction kinds +const ( + AuctionKindVickrey = "vickrey" + AuctionKindServiceProvider = "service_provider" +) + // AuctionId simplifies generation of auction ids. type AuctionId struct { Address sdk.Address -- 2.45.2 From 94e4d9459b74cb45bcb6fb0f22df48da79c92063 Mon Sep 17 00:00:00 2001 From: IshaVenikar Date: Fri, 13 Sep 2024 13:00:34 +0530 Subject: [PATCH 03/29] Add method to pick service provider auction winner --- x/auction/keeper/keeper.go | 136 +++++++++++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) diff --git a/x/auction/keeper/keeper.go b/x/auction/keeper/keeper.go index 4b506d53..f7d04017 100644 --- a/x/auction/keeper/keeper.go +++ b/x/auction/keeper/keeper.go @@ -795,3 +795,139 @@ func (k Keeper) pickAuctionWinner(ctx sdk.Context, auction *auctiontypes.Auction return nil } + +// Pick winner for service_provider auction +func (k Keeper) pickServiceProviderAuctionWinner(ctx sdk.Context, auction *auctiontypes.Auction) error { + k.Logger(ctx).Info(fmt.Sprintf("Picking auction %s winners.", auction.Id)) + + bids, err := k.GetBids(ctx, auction.Id) + if err != nil { + return err + } + + var revealedBids []*auctiontypes.Bid + for _, bid := range bids { + k.Logger(ctx).Info(fmt.Sprintf("Processing bid %s %s", bid.BidderAddress, bid.BidAmount.String())) + + // Only consider revealed bids. + if bid.Status != auctiontypes.BidStatusRevealed { + k.Logger(ctx).Info(fmt.Sprintf("Ignoring unrevealed bid %s %s", bid.BidderAddress, bid.BidAmount.String())) + continue + } + + revealedBids = append(revealedBids, bid) + } + + // Sort the valid bids + slices.SortFunc(revealedBids, func(a, b *auctiontypes.Bid) int { + if a.BidAmount.Amount.LT(b.BidAmount.Amount) { + return -1 + } else if a.BidAmount.Amount.GT(b.BidAmount.Amount) { + return 1 + } + return 0 + }) + + numWinners := int(auction.NumProviders) + if len(revealedBids) < numWinners { + numWinners = (len(revealedBids)) + } + winnerBids := revealedBids[:numWinners] + + auction.Status = auctiontypes.AuctionStatusCompleted + + if len(winnerBids) > 0 { + winnerAddresses := make([]string, len(winnerBids)) + winningBids := make([]types.Coin, len(winnerBids)) + for i, bid := range winnerBids { + winnerAddresses[i] = bid.BidderAddress + winningBids[i] = bid.BidAmount + } + auction.WinnerAddresses = winnerAddresses + auction.WinningBids = winningBids + auction.WinningPrice = winnerBids[0].BidAmount + + if len(winnerBids) > 0 { + // The last best bid is the winning price + auction.WinningPrice = winnerBids[len(winnerBids)-1].BidAmount + } + for _, bid := range winnerBids { + k.Logger(ctx).Info(fmt.Sprintf("Auction %s winner address: %s, bid amount: %s.", auction.Id, bid.BidderAddress, bid.BidAmount.String())) + } + k.Logger(ctx).Info(fmt.Sprintf("Auction %s winner price %s.", auction.Id, auction.WinningPrice.String())) + } else { + k.Logger(ctx).Info(fmt.Sprintf("Auction %s has no valid revealed bids (no winner).", auction.Id)) + } + + if err := k.SaveAuction(ctx, auction); err != nil { + return err + } + + for _, bid := range bids { + bidderAddress, err := sdk.AccAddressFromBech32(bid.BidderAddress) + if err != nil { + k.Logger(ctx).Error(fmt.Sprintf("Invalid bidderAddress address. %v", err)) + panic("Invalid bidder address.") + } + + if bid.Status == auctiontypes.BidStatusRevealed { + // Send reveal fee back to bidders that've revealed the bid. + sdkErr := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctiontypes.ModuleName, bidderAddress, sdk.NewCoins(bid.RevealFee)) + if sdkErr != nil { + k.Logger(ctx).Error(fmt.Sprintf("Auction error returning reveal fee: %v", sdkErr)) + panic(sdkErr) + } + } + } + + // Process winner account (if nobody bids, there won't be a winner). + if len(winnerBids) > 0 { + winnerAddresses := make([]string, len(winnerBids)) + for i, bid := range winnerBids { + winnerAddresses[i] = bid.BidderAddress + winnerAddress, err := sdk.AccAddressFromBech32(bid.BidderAddress) + if err != nil { + k.Logger(ctx).Error(fmt.Sprintf("Invalid winner address. %v", err)) + panic("Invalid winner address.") + } + + // Send winning price to bidders + sdkErrWinner := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctiontypes.ModuleName, winnerAddress, sdk.NewCoins(auction.WinningPrice)) + if sdkErrWinner != nil { + k.Logger(ctx).Error(fmt.Sprintf("Auction error sending funds to winner: %v", sdkErrWinner)) + panic(sdkErrWinner) + } + + // Send back extra amount to auction creator + totalMaxBidAmount := auction.MaxPrice.Amount.MulRaw(int64(auction.NumProviders)) + totalAmountPaid := auction.WinningPrice.Amount.Mul(math.NewInt(int64(auction.NumProviders))) + + extraAmountCoin := sdk.NewCoin(auction.MaxPrice.Denom, totalMaxBidAmount.Sub(totalAmountPaid)) + + sdkErrCreator := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctiontypes.ModuleName, sdk.AccAddress(auction.OwnerAddress), sdk.NewCoins(extraAmountCoin)) + if sdkErrCreator != nil { + k.Logger(ctx).Error(fmt.Sprintf("Auction error returning bid amount: %v", sdkErrCreator)) + panic(sdkErrCreator) + } + } + } else { + sdkErr := k.bankKeeper.SendCoinsFromModuleToAccount( + ctx, + auctiontypes.ModuleName, + sdk.AccAddress(auction.OwnerAddress), + sdk.NewCoins(auction.MaxPrice)) + if sdkErr != nil { + k.Logger(ctx).Error(fmt.Sprintf("Auction error returning bid amount: %v", sdkErr)) + panic(sdkErr) + } + } + + // Notify other modules (hook). + k.Logger(ctx).Info(fmt.Sprintf("Auction %s notifying %d modules.", auction.Id, len(k.usageKeepers))) + for _, keeper := range k.usageKeepers { + k.Logger(ctx).Info(fmt.Sprintf("Auction %s notifying module %s.", auction.Id, keeper.ModuleName())) + keeper.OnAuctionWinnerSelected(ctx, auction.Id) + } + + return nil +} -- 2.45.2 From 0defde75ee41f775cfc9786c7874dc4cdd874c7a Mon Sep 17 00:00:00 2001 From: IshaVenikar Date: Fri, 13 Sep 2024 13:03:09 +0530 Subject: [PATCH 04/29] Update authority auction in registry module --- x/registry/keeper/keeper.go | 16 ++++++++++------ x/registry/keeper/record_keeper.go | 4 ++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/x/registry/keeper/keeper.go b/x/registry/keeper/keeper.go index 89540541..e71c9f4d 100644 --- a/x/registry/keeper/keeper.go +++ b/x/registry/keeper/keeper.go @@ -224,13 +224,17 @@ func (k Keeper) PaginatedListRecords(ctx sdk.Context, pagination *query.PageRequ } } else { var err error - records, pageResp, err = query.CollectionPaginate(ctx, k.Records, pagination, func(key string, value registrytypes.Record) (registrytypes.Record, error) { - if err := k.populateRecordNames(ctx, &value); err != nil { - return registrytypes.Record{}, err - } + records, pageResp, err = query.CollectionPaginate( + ctx, + k.Records, + pagination, + func(key string, value registrytypes.Record) (registrytypes.Record, error) { + if err := k.populateRecordNames(ctx, &value); err != nil { + return registrytypes.Record{}, err + } - return value, nil - }) + return value, nil + }) if err != nil { return nil, nil, err } diff --git a/x/registry/keeper/record_keeper.go b/x/registry/keeper/record_keeper.go index db5d71c9..0179fe2c 100644 --- a/x/registry/keeper/record_keeper.go +++ b/x/registry/keeper/record_keeper.go @@ -94,9 +94,9 @@ func (rk RecordKeeper) OnAuctionWinnerSelected(ctx sdk.Context, auctionId string } if auctionObj.Status == auctiontypes.AuctionStatusCompleted { - if auctionObj.WinnerAddress != "" { + if len(auctionObj.WinnerAddresses) == 1 { // Mark authority owner and change status to active. - authority.OwnerAddress = auctionObj.WinnerAddress + authority.OwnerAddress = auctionObj.WinnerAddresses[0] authority.Status = registrytypes.AuthorityActive // Reset bond id if required, as owner has changed. -- 2.45.2 From 3d237f6447c18d49ed087dc791f6d90a1f6d0f2a Mon Sep 17 00:00:00 2001 From: IshaVenikar Date: Fri, 13 Sep 2024 13:10:15 +0530 Subject: [PATCH 05/29] Update create auction CLI command --- .../auction/keeper/query_server_test.go | 15 ++++++++- x/auction/client/cli/tx.go | 27 ++++++++++----- x/auction/msgs.go | 33 +++++++++++++++---- x/registry/keeper/naming_keeper.go | 21 +++++++----- 4 files changed, 70 insertions(+), 26 deletions(-) diff --git a/tests/integration/auction/keeper/query_server_test.go b/tests/integration/auction/keeper/query_server_test.go index 2ed1ec27..2980722d 100644 --- a/tests/integration/auction/keeper/query_server_test.go +++ b/tests/integration/auction/keeper/query_server_test.go @@ -6,6 +6,7 @@ import ( "cosmossdk.io/math" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" + sdk "github.com/cosmos/cosmos-sdk/types" integrationTest "git.vdb.to/cerc-io/laconicd/tests/integration" types "git.vdb.to/cerc-io/laconicd/x/auction" @@ -331,7 +332,19 @@ func (kts *KeeperTestSuite) createAuctionAndCommitBid(commitBid bool) (*types.Au return nil, nil, err } - auction, err := k.CreateAuction(ctx, types.NewMsgCreateAuction(*params, accounts[0])) + auction, err := k.CreateAuction( + ctx, + types.NewMsgCreateAuction( + params.CommitsDuration, + params.RevealsDuration, + params.CommitFee, + params.RevealFee, + params.MinimumBid, + sdk.Coin{}, + types.AuctionKindVickrey, + accounts[0], + ), + ) if err != nil { return nil, nil, err } diff --git a/x/auction/client/cli/tx.go b/x/auction/client/cli/tx.go index eaf2282d..3f044556 100644 --- a/x/auction/client/cli/tx.go +++ b/x/auction/client/cli/tx.go @@ -132,9 +132,9 @@ func GetCmdRevealBid() *cobra.Command { func GetCmdCreateAuction() *cobra.Command { cmd := &cobra.Command{ - Use: "create [commits-duration] [reveals-duration] [commit-fee] [reveal-fee] [minimum-bid]", + Use: "create [commits-duration] [reveals-duration] [commit-fee] [reveal-fee] [minimum-bid] [maximum-bid] [reverse]", Short: "Create auction.", - Args: cobra.ExactArgs(5), + Args: cobra.ExactArgs(7), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { @@ -166,14 +166,23 @@ func GetCmdCreateAuction() *cobra.Command { return err } - params := auctiontypes.Params{ - CommitsDuration: commitsDuration, - RevealsDuration: revealsDuration, - CommitFee: commitFee, - RevealFee: revealFee, - MinimumBid: minimumBid, + maximumBid, err := sdk.ParseCoinNormalized(args[5]) + if err != nil { + return err } - msg := auctiontypes.NewMsgCreateAuction(params, clientCtx.GetFromAddress()) + + kind := args[6] + + msg := auctiontypes.NewMsgCreateAuction( + commitsDuration, + revealsDuration, + commitFee, + revealFee, + minimumBid, + maximumBid, + kind, + clientCtx.GetFromAddress(), + ) err = msg.ValidateBasic() if err != nil { return err diff --git a/x/auction/msgs.go b/x/auction/msgs.go index a21427fc..22522a01 100644 --- a/x/auction/msgs.go +++ b/x/auction/msgs.go @@ -1,6 +1,9 @@ package auction import ( + "fmt" + time "time" + errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -13,13 +16,25 @@ var ( ) // NewMsgCreateAuction is the constructor function for MsgCreateAuction. -func NewMsgCreateAuction(params Params, signer sdk.AccAddress) MsgCreateAuction { +func NewMsgCreateAuction( + commitsDuration time.Duration, + revealsDuration time.Duration, + commitFee sdk.Coin, + revealFee sdk.Coin, + minimumBid sdk.Coin, + maxPrice sdk.Coin, + kind string, + signer sdk.AccAddress, +) MsgCreateAuction { + fmt.Print(signer.String()) return MsgCreateAuction{ - CommitsDuration: params.CommitsDuration, - RevealsDuration: params.RevealsDuration, - CommitFee: params.CommitFee, - RevealFee: params.RevealFee, - MinimumBid: params.MinimumBid, + CommitsDuration: commitsDuration, + RevealsDuration: revealsDuration, + CommitFee: commitFee, + RevealFee: revealFee, + MinimumBid: minimumBid, + MaxPrice: maxPrice, + Kind: kind, Signer: signer.String(), } } @@ -47,10 +62,14 @@ func (msg MsgCreateAuction) ValidateBasic() error { return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "reveal phase duration invalid.") } - if !msg.MinimumBid.IsPositive() { + if msg.Kind == AuctionKindVickrey && !msg.MinimumBid.IsPositive() { return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "minimum bid should be greater than zero.") } + if msg.Kind == AuctionKindServiceProvider && !msg.MaxPrice.IsPositive() { + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "maximum price should be greater than zero.") + } + return nil } diff --git a/x/registry/keeper/naming_keeper.go b/x/registry/keeper/naming_keeper.go index 31e0cc4d..d0c9c7ca 100644 --- a/x/registry/keeper/naming_keeper.go +++ b/x/registry/keeper/naming_keeper.go @@ -7,6 +7,8 @@ import ( "strings" "time" + "cosmossdk.io/math" + "cosmossdk.io/collections" errorsmod "cosmossdk.io/errors" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" @@ -285,16 +287,17 @@ func (k Keeper) createAuthority(ctx sdk.Context, name string, owner string, isRo // Reset bond ID if required. authority.BondId = "" - params := auctiontypes.Params{ - CommitsDuration: moduleParams.AuthorityAuctionCommitsDuration, - RevealsDuration: moduleParams.AuthorityAuctionRevealsDuration, - CommitFee: moduleParams.AuthorityAuctionCommitFee, - RevealFee: moduleParams.AuthorityAuctionRevealFee, - MinimumBid: moduleParams.AuthorityAuctionMinimumBid, - } - // Create an auction. - msg := auctiontypes.NewMsgCreateAuction(params, ownerAddress) + msg := auctiontypes.NewMsgCreateAuction( + moduleParams.AuthorityAuctionCommitsDuration, + moduleParams.AuthorityAuctionRevealsDuration, + moduleParams.AuthorityAuctionCommitFee, + moduleParams.AuthorityAuctionRevealFee, + moduleParams.AuthorityAuctionMinimumBid, + sdk.NewCoin("alnt", math.NewInt(0)), + auctiontypes.AuctionKindVickrey, + ownerAddress, + ) auction, sdkErr := k.auctionKeeper.CreateAuction(ctx, msg) if sdkErr != nil { -- 2.45.2 From 3cd46106bd6cffef88a937932bc172aa22c159dd Mon Sep 17 00:00:00 2001 From: IshaVenikar Date: Fri, 13 Sep 2024 14:33:31 +0530 Subject: [PATCH 06/29] Update Auction type in GraphQL schema --- gql/cerc-io/laconicd/schema.graphql | 7 +- gql/generated.go | 346 ++++++++++++++++++++++++---- gql/models_gen.go | 29 +-- gql/util.go | 34 ++- 4 files changed, 346 insertions(+), 70 deletions(-) diff --git a/gql/cerc-io/laconicd/schema.graphql b/gql/cerc-io/laconicd/schema.graphql index 288ebe37..44502aab 100644 --- a/gql/cerc-io/laconicd/schema.graphql +++ b/gql/cerc-io/laconicd/schema.graphql @@ -168,9 +168,12 @@ type Auction { commitFee: Coin! # Fee required to bid/participate in the auction. revealFee: Coin! # Reveal fee (paid back to bidders only if they unseal/reveal the bid). minimumBid: Coin! # Minimum bid amount. - winnerAddress: String! # Winner address. - winnerBid: Coin! # The winning bid amount. + winnerAddresses: [String]! # Winner address. + winnerBids: [Coin]! # The winning bid amount. winnerPrice: Coin! # The price that the winner actually pays (2nd highest bid). + maxPrice: Coin! # Max bid amount for service provider auction. + kind: String! # Auction kind. + numProviders: Int # Number of service providers bids: [AuctionBid] # Bids make in the auction. } diff --git a/gql/generated.go b/gql/generated.go index a21c18a3..46aebfa5 100644 --- a/gql/generated.go +++ b/gql/generated.go @@ -61,19 +61,22 @@ type ComplexityRoot struct { } Auction struct { - Bids func(childComplexity int) int - CommitFee func(childComplexity int) int - CommitsEndTime func(childComplexity int) int - CreateTime func(childComplexity int) int - ID func(childComplexity int) int - MinimumBid func(childComplexity int) int - OwnerAddress func(childComplexity int) int - RevealFee func(childComplexity int) int - RevealsEndTime func(childComplexity int) int - Status func(childComplexity int) int - WinnerAddress func(childComplexity int) int - WinnerBid func(childComplexity int) int - WinnerPrice func(childComplexity int) int + Bids func(childComplexity int) int + CommitFee func(childComplexity int) int + CommitsEndTime func(childComplexity int) int + CreateTime func(childComplexity int) int + ID func(childComplexity int) int + Kind func(childComplexity int) int + MaxPrice func(childComplexity int) int + MinimumBid func(childComplexity int) int + NumProviders func(childComplexity int) int + OwnerAddress func(childComplexity int) int + RevealFee func(childComplexity int) int + RevealsEndTime func(childComplexity int) int + Status func(childComplexity int) int + WinnerAddresses func(childComplexity int) int + WinnerBids func(childComplexity int) int + WinnerPrice func(childComplexity int) int } AuctionBid struct { @@ -353,6 +356,20 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Auction.ID(childComplexity), true + case "Auction.kind": + if e.complexity.Auction.Kind == nil { + break + } + + return e.complexity.Auction.Kind(childComplexity), true + + case "Auction.maxPrice": + if e.complexity.Auction.MaxPrice == nil { + break + } + + return e.complexity.Auction.MaxPrice(childComplexity), true + case "Auction.minimumBid": if e.complexity.Auction.MinimumBid == nil { break @@ -360,6 +377,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Auction.MinimumBid(childComplexity), true + case "Auction.numProviders": + if e.complexity.Auction.NumProviders == nil { + break + } + + return e.complexity.Auction.NumProviders(childComplexity), true + case "Auction.ownerAddress": if e.complexity.Auction.OwnerAddress == nil { break @@ -388,19 +412,19 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Auction.Status(childComplexity), true - case "Auction.winnerAddress": - if e.complexity.Auction.WinnerAddress == nil { + case "Auction.winnerAddresses": + if e.complexity.Auction.WinnerAddresses == nil { break } - return e.complexity.Auction.WinnerAddress(childComplexity), true + return e.complexity.Auction.WinnerAddresses(childComplexity), true - case "Auction.winnerBid": - if e.complexity.Auction.WinnerBid == nil { + case "Auction.winnerBids": + if e.complexity.Auction.WinnerBids == nil { break } - return e.complexity.Auction.WinnerBid(childComplexity), true + return e.complexity.Auction.WinnerBids(childComplexity), true case "Auction.winnerPrice": if e.complexity.Auction.WinnerPrice == nil { @@ -2147,8 +2171,8 @@ func (ec *executionContext) fieldContext_Auction_minimumBid(ctx context.Context, return fc, nil } -func (ec *executionContext) _Auction_winnerAddress(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Auction_winnerAddress(ctx, field) +func (ec *executionContext) _Auction_winnerAddresses(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Auction_winnerAddresses(ctx, field) if err != nil { return graphql.Null } @@ -2161,7 +2185,7 @@ func (ec *executionContext) _Auction_winnerAddress(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.WinnerAddress, nil + return obj.WinnerAddresses, nil }) if err != nil { ec.Error(ctx, err) @@ -2173,12 +2197,12 @@ func (ec *executionContext) _Auction_winnerAddress(ctx context.Context, field gr } return graphql.Null } - res := resTmp.(string) + res := resTmp.([]*string) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNString2ᚕᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Auction_winnerAddress(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Auction_winnerAddresses(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Auction", Field: field, @@ -2191,8 +2215,8 @@ func (ec *executionContext) fieldContext_Auction_winnerAddress(ctx context.Conte return fc, nil } -func (ec *executionContext) _Auction_winnerBid(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Auction_winnerBid(ctx, field) +func (ec *executionContext) _Auction_winnerBids(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Auction_winnerBids(ctx, field) if err != nil { return graphql.Null } @@ -2205,7 +2229,7 @@ func (ec *executionContext) _Auction_winnerBid(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.WinnerBid, nil + return obj.WinnerBids, nil }) if err != nil { ec.Error(ctx, err) @@ -2217,12 +2241,12 @@ func (ec *executionContext) _Auction_winnerBid(ctx context.Context, field graphq } return graphql.Null } - res := resTmp.(*Coin) + res := resTmp.([]*Coin) fc.Result = res - return ec.marshalNCoin2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐCoin(ctx, field.Selections, res) + return ec.marshalNCoin2ᚕᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐCoin(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Auction_winnerBid(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Auction_winnerBids(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Auction", Field: field, @@ -2291,6 +2315,141 @@ func (ec *executionContext) fieldContext_Auction_winnerPrice(ctx context.Context return fc, nil } +func (ec *executionContext) _Auction_maxPrice(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Auction_maxPrice(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MaxPrice, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*Coin) + fc.Result = res + return ec.marshalNCoin2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐCoin(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Auction_maxPrice(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Auction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "type": + return ec.fieldContext_Coin_type(ctx, field) + case "quantity": + return ec.fieldContext_Coin_quantity(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Coin", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Auction_kind(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Auction_kind(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Kind, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Auction_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Auction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Auction_numProviders(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Auction_numProviders(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.NumProviders, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*int) + fc.Result = res + return ec.marshalOInt2ᚖint(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Auction_numProviders(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Auction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Int does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _Auction_bids(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Auction_bids(ctx, field) if err != nil { @@ -3142,12 +3301,18 @@ func (ec *executionContext) fieldContext_AuthorityRecord_auction(ctx context.Con return ec.fieldContext_Auction_revealFee(ctx, field) case "minimumBid": return ec.fieldContext_Auction_minimumBid(ctx, field) - case "winnerAddress": - return ec.fieldContext_Auction_winnerAddress(ctx, field) - case "winnerBid": - return ec.fieldContext_Auction_winnerBid(ctx, field) + case "winnerAddresses": + return ec.fieldContext_Auction_winnerAddresses(ctx, field) + case "winnerBids": + return ec.fieldContext_Auction_winnerBids(ctx, field) case "winnerPrice": return ec.fieldContext_Auction_winnerPrice(ctx, field) + case "maxPrice": + return ec.fieldContext_Auction_maxPrice(ctx, field) + case "kind": + return ec.fieldContext_Auction_kind(ctx, field) + case "numProviders": + return ec.fieldContext_Auction_numProviders(ctx, field) case "bids": return ec.fieldContext_Auction_bids(ctx, field) } @@ -5129,12 +5294,18 @@ func (ec *executionContext) fieldContext_Query_getAuctionsByIds(ctx context.Cont return ec.fieldContext_Auction_revealFee(ctx, field) case "minimumBid": return ec.fieldContext_Auction_minimumBid(ctx, field) - case "winnerAddress": - return ec.fieldContext_Auction_winnerAddress(ctx, field) - case "winnerBid": - return ec.fieldContext_Auction_winnerBid(ctx, field) + case "winnerAddresses": + return ec.fieldContext_Auction_winnerAddresses(ctx, field) + case "winnerBids": + return ec.fieldContext_Auction_winnerBids(ctx, field) case "winnerPrice": return ec.fieldContext_Auction_winnerPrice(ctx, field) + case "maxPrice": + return ec.fieldContext_Auction_maxPrice(ctx, field) + case "kind": + return ec.fieldContext_Auction_kind(ctx, field) + case "numProviders": + return ec.fieldContext_Auction_numProviders(ctx, field) case "bids": return ec.fieldContext_Auction_bids(ctx, field) } @@ -8710,16 +8881,16 @@ func (ec *executionContext) _Auction(ctx context.Context, sel ast.SelectionSet, if out.Values[i] == graphql.Null { invalids++ } - case "winnerAddress": + case "winnerAddresses": - out.Values[i] = ec._Auction_winnerAddress(ctx, field, obj) + out.Values[i] = ec._Auction_winnerAddresses(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "winnerBid": + case "winnerBids": - out.Values[i] = ec._Auction_winnerBid(ctx, field, obj) + out.Values[i] = ec._Auction_winnerBids(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ @@ -8731,6 +8902,24 @@ func (ec *executionContext) _Auction(ctx context.Context, sel ast.SelectionSet, if out.Values[i] == graphql.Null { invalids++ } + case "maxPrice": + + out.Values[i] = ec._Auction_maxPrice(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "kind": + + out.Values[i] = ec._Auction_kind(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "numProviders": + + out.Values[i] = ec._Auction_numProviders(ctx, field, obj) + case "bids": out.Values[i] = ec._Auction_bids(ctx, field, obj) @@ -10500,6 +10689,44 @@ func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.Se return res } +func (ec *executionContext) marshalNCoin2ᚕᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐCoin(ctx context.Context, sel ast.SelectionSet, v []*Coin) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOCoin2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐCoin(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + func (ec *executionContext) marshalNCoin2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐCoin(ctx context.Context, sel ast.SelectionSet, v *Coin) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { @@ -10732,6 +10959,32 @@ func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.S return res } +func (ec *executionContext) unmarshalNString2ᚕᚖstring(ctx context.Context, v interface{}) ([]*string, error) { + var vSlice []interface{} + if v != nil { + vSlice = graphql.CoerceList(v) + } + var err error + res := make([]*string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalOString2ᚖstring(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNString2ᚕᚖstring(ctx context.Context, sel ast.SelectionSet, v []*string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalOString2ᚖstring(ctx, sel, v[i]) + } + + return ret +} + func (ec *executionContext) marshalNSyncInfo2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐSyncInfo(ctx context.Context, sel ast.SelectionSet, v *SyncInfo) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { @@ -11444,6 +11697,13 @@ func (ec *executionContext) marshalOCoin2ᚕᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaco return ret } +func (ec *executionContext) marshalOCoin2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐCoin(ctx context.Context, sel ast.SelectionSet, v *Coin) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Coin(ctx, sel, v) +} + func (ec *executionContext) unmarshalOFloat2ᚖfloat64(ctx context.Context, v interface{}) (*float64, error) { if v == nil { return nil, nil diff --git a/gql/models_gen.go b/gql/models_gen.go index 9fe30448..79585977 100644 --- a/gql/models_gen.go +++ b/gql/models_gen.go @@ -26,19 +26,22 @@ type Attribute struct { } type Auction struct { - ID string `json:"id"` - Status string `json:"status"` - OwnerAddress string `json:"ownerAddress"` - CreateTime string `json:"createTime"` - CommitsEndTime string `json:"commitsEndTime"` - RevealsEndTime string `json:"revealsEndTime"` - CommitFee *Coin `json:"commitFee"` - RevealFee *Coin `json:"revealFee"` - MinimumBid *Coin `json:"minimumBid"` - WinnerAddress string `json:"winnerAddress"` - WinnerBid *Coin `json:"winnerBid"` - WinnerPrice *Coin `json:"winnerPrice"` - Bids []*AuctionBid `json:"bids"` + ID string `json:"id"` + Status string `json:"status"` + OwnerAddress string `json:"ownerAddress"` + CreateTime string `json:"createTime"` + CommitsEndTime string `json:"commitsEndTime"` + RevealsEndTime string `json:"revealsEndTime"` + CommitFee *Coin `json:"commitFee"` + RevealFee *Coin `json:"revealFee"` + MinimumBid *Coin `json:"minimumBid"` + WinnerAddresses []*string `json:"winnerAddresses"` + WinnerBids []*Coin `json:"winnerBids"` + WinnerPrice *Coin `json:"winnerPrice"` + MaxPrice *Coin `json:"maxPrice"` + Kind string `json:"kind"` + NumProviders *int `json:"numProviders"` + Bids []*AuctionBid `json:"bids"` } type AuctionBid struct { diff --git a/gql/util.go b/gql/util.go index b978264f..ba66c018 100644 --- a/gql/util.go +++ b/gql/util.go @@ -232,19 +232,29 @@ func GetGQLAuction(auction *auctiontypes.Auction, bids []*auctiontypes.Bid) (*Au return nil, nil } + winnerAddresses := make([]*string, len(auction.WinnerAddresses)) + for i, addr := range auction.WinnerAddresses { + winnerAddresses[i] = &addr + } + + numProviders := int(auction.NumProviders) + gqlAuction := Auction{ - ID: auction.Id, - Status: auction.Status, - OwnerAddress: auction.OwnerAddress, - CreateTime: auction.GetCreateTime(), - CommitsEndTime: auction.GetCommitsEndTime(), - RevealsEndTime: auction.GetRevealsEndTime(), - CommitFee: getGQLCoin(auction.CommitFee), - RevealFee: getGQLCoin(auction.RevealFee), - MinimumBid: getGQLCoin(auction.MinimumBid), - WinnerAddress: auction.WinnerAddress, - WinnerBid: getGQLCoin(auction.WinningBid), - WinnerPrice: getGQLCoin(auction.WinningPrice), + ID: auction.Id, + Status: auction.Status, + OwnerAddress: auction.OwnerAddress, + CreateTime: auction.GetCreateTime(), + CommitsEndTime: auction.GetCommitsEndTime(), + RevealsEndTime: auction.GetRevealsEndTime(), + CommitFee: getGQLCoin(auction.CommitFee), + RevealFee: getGQLCoin(auction.RevealFee), + MinimumBid: getGQLCoin(auction.MinimumBid), + WinnerAddresses: winnerAddresses, + WinnerBids: getGQLCoins(auction.WinningBids), + WinnerPrice: getGQLCoin(auction.WinningPrice), + MaxPrice: getGQLCoin(auction.MaxPrice), + Kind: auction.Kind, + NumProviders: &numProviders, } auctionBids := make([]*AuctionBid, len(bids)) -- 2.45.2 From fb66b9aed5aba7ee842f00b426215d0623478dfd Mon Sep 17 00:00:00 2001 From: IshaVenikar Date: Fri, 13 Sep 2024 14:49:38 +0530 Subject: [PATCH 07/29] Fix lint issues --- gql/util.go | 3 ++- x/auction/keeper/keeper.go | 12 ++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/gql/util.go b/gql/util.go index ba66c018..f230f18e 100644 --- a/gql/util.go +++ b/gql/util.go @@ -233,7 +233,8 @@ func GetGQLAuction(auction *auctiontypes.Auction, bids []*auctiontypes.Bid) (*Au } winnerAddresses := make([]*string, len(auction.WinnerAddresses)) - for i, addr := range auction.WinnerAddresses { + for i := range auction.WinnerAddresses { + addr := auction.WinnerAddresses[i] winnerAddresses[i] = &addr } diff --git a/x/auction/keeper/keeper.go b/x/auction/keeper/keeper.go index f7d04017..a523f637 100644 --- a/x/auction/keeper/keeper.go +++ b/x/auction/keeper/keeper.go @@ -16,7 +16,6 @@ import ( "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" auth "github.com/cosmos/cosmos-sdk/x/auth/keeper" @@ -805,7 +804,7 @@ func (k Keeper) pickServiceProviderAuctionWinner(ctx sdk.Context, auction *aucti return err } - var revealedBids []*auctiontypes.Bid + revealedBids := make([]*auctiontypes.Bid, 0, len(bids)) for _, bid := range bids { k.Logger(ctx).Info(fmt.Sprintf("Processing bid %s %s", bid.BidderAddress, bid.BidAmount.String())) @@ -838,7 +837,7 @@ func (k Keeper) pickServiceProviderAuctionWinner(ctx sdk.Context, auction *aucti if len(winnerBids) > 0 { winnerAddresses := make([]string, len(winnerBids)) - winningBids := make([]types.Coin, len(winnerBids)) + winningBids := make([]sdk.Coin, len(winnerBids)) for i, bid := range winnerBids { winnerAddresses[i] = bid.BidderAddress winningBids[i] = bid.BidAmount @@ -904,7 +903,12 @@ func (k Keeper) pickServiceProviderAuctionWinner(ctx sdk.Context, auction *aucti extraAmountCoin := sdk.NewCoin(auction.MaxPrice.Denom, totalMaxBidAmount.Sub(totalAmountPaid)) - sdkErrCreator := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctiontypes.ModuleName, sdk.AccAddress(auction.OwnerAddress), sdk.NewCoins(extraAmountCoin)) + sdkErrCreator := k.bankKeeper.SendCoinsFromModuleToAccount( + ctx, + auctiontypes.ModuleName, + sdk.AccAddress(auction.OwnerAddress), + sdk.NewCoins(extraAmountCoin), + ) if sdkErrCreator != nil { k.Logger(ctx).Error(fmt.Sprintf("Auction error returning bid amount: %v", sdkErrCreator)) panic(sdkErrCreator) -- 2.45.2 From 70f0d050fa31898d791c4367e254a1397bbc90e4 Mon Sep 17 00:00:00 2001 From: IshaVenikar Date: Fri, 13 Sep 2024 16:02:46 +0530 Subject: [PATCH 08/29] Return total locked amount to the service provider auction creator --- api/cerc/auction/v1/auction.pulsar.go | 504 +++++++++++++------------- api/cerc/auction/v1/tx.pulsar.go | 166 ++++----- proto/cerc/auction/v1/auction.proto | 39 +- proto/cerc/auction/v1/tx.proto | 14 +- x/auction/auction.pb.go | 272 +++++++------- x/auction/client/cli/tx.go | 11 +- x/auction/keeper/keeper.go | 40 +- x/auction/msgs.go | 2 + x/auction/tx.pb.go | 160 ++++---- x/registry/keeper/record_keeper.go | 2 +- 10 files changed, 608 insertions(+), 602 deletions(-) diff --git a/api/cerc/auction/v1/auction.pulsar.go b/api/cerc/auction/v1/auction.pulsar.go index dc9a22e9..43b54561 100644 --- a/api/cerc/auction/v1/auction.pulsar.go +++ b/api/cerc/auction/v1/auction.pulsar.go @@ -767,56 +767,10 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { } } -var _ protoreflect.List = (*_Auction_10_list)(nil) - -type _Auction_10_list struct { - list *[]string -} - -func (x *_Auction_10_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_Auction_10_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfString((*x.list)[i]) -} - -func (x *_Auction_10_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - (*x.list)[i] = concreteValue -} - -func (x *_Auction_10_list) Append(value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - *x.list = append(*x.list, concreteValue) -} - -func (x *_Auction_10_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message Auction at list field WinnerAddresses as it is not of Message kind")) -} - -func (x *_Auction_10_list) Truncate(n int) { - *x.list = (*x.list)[:n] -} - -func (x *_Auction_10_list) NewElement() protoreflect.Value { - v := "" - return protoreflect.ValueOfString(v) -} - -func (x *_Auction_10_list) IsValid() bool { - return x.list != nil -} - var _ protoreflect.List = (*_Auction_11_list)(nil) type _Auction_11_list struct { - list *[]*v1beta1.Coin + list *[]string } func (x *_Auction_11_list) Len() int { @@ -827,46 +781,93 @@ func (x *_Auction_11_list) Len() int { } func (x *_Auction_11_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) + return protoreflect.ValueOfString((*x.list)[i]) } func (x *_Auction_11_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + valueUnwrapped := value.String() + concreteValue := valueUnwrapped (*x.list)[i] = concreteValue } func (x *_Auction_11_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + valueUnwrapped := value.String() + concreteValue := valueUnwrapped *x.list = append(*x.list, concreteValue) } func (x *_Auction_11_list) AppendMutable() protoreflect.Value { - v := new(v1beta1.Coin) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) + panic(fmt.Errorf("AppendMutable can not be called on message Auction at list field WinnerAddresses as it is not of Message kind")) } func (x *_Auction_11_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } *x.list = (*x.list)[:n] } func (x *_Auction_11_list) NewElement() protoreflect.Value { - v := new(v1beta1.Coin) - return protoreflect.ValueOfMessage(v.ProtoReflect()) + v := "" + return protoreflect.ValueOfString(v) } func (x *_Auction_11_list) IsValid() bool { return x.list != nil } +var _ protoreflect.List = (*_Auction_12_list)(nil) + +type _Auction_12_list struct { + list *[]*v1beta1.Coin +} + +func (x *_Auction_12_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Auction_12_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_Auction_12_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + (*x.list)[i] = concreteValue +} + +func (x *_Auction_12_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + *x.list = append(*x.list, concreteValue) +} + +func (x *_Auction_12_list) AppendMutable() protoreflect.Value { + v := new(v1beta1.Coin) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Auction_12_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_Auction_12_list) NewElement() protoreflect.Value { + v := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_Auction_12_list) IsValid() bool { + return x.list != nil +} + var ( md_Auction protoreflect.MessageDescriptor fd_Auction_id protoreflect.FieldDescriptor + fd_Auction_kind protoreflect.FieldDescriptor fd_Auction_status protoreflect.FieldDescriptor fd_Auction_owner_address protoreflect.FieldDescriptor fd_Auction_create_time protoreflect.FieldDescriptor @@ -879,7 +880,6 @@ var ( fd_Auction_winning_bids protoreflect.FieldDescriptor fd_Auction_winning_price protoreflect.FieldDescriptor fd_Auction_max_price protoreflect.FieldDescriptor - fd_Auction_kind protoreflect.FieldDescriptor fd_Auction_num_providers protoreflect.FieldDescriptor ) @@ -887,6 +887,7 @@ func init() { file_cerc_auction_v1_auction_proto_init() md_Auction = File_cerc_auction_v1_auction_proto.Messages().ByName("Auction") fd_Auction_id = md_Auction.Fields().ByName("id") + fd_Auction_kind = md_Auction.Fields().ByName("kind") fd_Auction_status = md_Auction.Fields().ByName("status") fd_Auction_owner_address = md_Auction.Fields().ByName("owner_address") fd_Auction_create_time = md_Auction.Fields().ByName("create_time") @@ -899,7 +900,6 @@ func init() { fd_Auction_winning_bids = md_Auction.Fields().ByName("winning_bids") fd_Auction_winning_price = md_Auction.Fields().ByName("winning_price") fd_Auction_max_price = md_Auction.Fields().ByName("max_price") - fd_Auction_kind = md_Auction.Fields().ByName("kind") fd_Auction_num_providers = md_Auction.Fields().ByName("num_providers") } @@ -974,6 +974,12 @@ func (x *fastReflection_Auction) Range(f func(protoreflect.FieldDescriptor, prot return } } + if x.Kind != "" { + value := protoreflect.ValueOfString(x.Kind) + if !f(fd_Auction_kind, value) { + return + } + } if x.Status != "" { value := protoreflect.ValueOfString(x.Status) if !f(fd_Auction_status, value) { @@ -1023,13 +1029,13 @@ func (x *fastReflection_Auction) Range(f func(protoreflect.FieldDescriptor, prot } } if len(x.WinnerAddresses) != 0 { - value := protoreflect.ValueOfList(&_Auction_10_list{list: &x.WinnerAddresses}) + value := protoreflect.ValueOfList(&_Auction_11_list{list: &x.WinnerAddresses}) if !f(fd_Auction_winner_addresses, value) { return } } if len(x.WinningBids) != 0 { - value := protoreflect.ValueOfList(&_Auction_11_list{list: &x.WinningBids}) + value := protoreflect.ValueOfList(&_Auction_12_list{list: &x.WinningBids}) if !f(fd_Auction_winning_bids, value) { return } @@ -1046,12 +1052,6 @@ func (x *fastReflection_Auction) Range(f func(protoreflect.FieldDescriptor, prot return } } - if x.Kind != "" { - value := protoreflect.ValueOfString(x.Kind) - if !f(fd_Auction_kind, value) { - return - } - } if x.NumProviders != int32(0) { value := protoreflect.ValueOfInt32(x.NumProviders) if !f(fd_Auction_num_providers, value) { @@ -1075,6 +1075,8 @@ func (x *fastReflection_Auction) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { case "cerc.auction.v1.Auction.id": return x.Id != "" + case "cerc.auction.v1.Auction.kind": + return x.Kind != "" case "cerc.auction.v1.Auction.status": return x.Status != "" case "cerc.auction.v1.Auction.owner_address": @@ -1099,8 +1101,6 @@ func (x *fastReflection_Auction) Has(fd protoreflect.FieldDescriptor) bool { return x.WinningPrice != nil case "cerc.auction.v1.Auction.max_price": return x.MaxPrice != nil - case "cerc.auction.v1.Auction.kind": - return x.Kind != "" case "cerc.auction.v1.Auction.num_providers": return x.NumProviders != int32(0) default: @@ -1121,6 +1121,8 @@ func (x *fastReflection_Auction) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { case "cerc.auction.v1.Auction.id": x.Id = "" + case "cerc.auction.v1.Auction.kind": + x.Kind = "" case "cerc.auction.v1.Auction.status": x.Status = "" case "cerc.auction.v1.Auction.owner_address": @@ -1145,8 +1147,6 @@ func (x *fastReflection_Auction) Clear(fd protoreflect.FieldDescriptor) { x.WinningPrice = nil case "cerc.auction.v1.Auction.max_price": x.MaxPrice = nil - case "cerc.auction.v1.Auction.kind": - x.Kind = "" case "cerc.auction.v1.Auction.num_providers": x.NumProviders = int32(0) default: @@ -1168,6 +1168,9 @@ func (x *fastReflection_Auction) Get(descriptor protoreflect.FieldDescriptor) pr case "cerc.auction.v1.Auction.id": value := x.Id return protoreflect.ValueOfString(value) + case "cerc.auction.v1.Auction.kind": + value := x.Kind + return protoreflect.ValueOfString(value) case "cerc.auction.v1.Auction.status": value := x.Status return protoreflect.ValueOfString(value) @@ -1194,15 +1197,15 @@ func (x *fastReflection_Auction) Get(descriptor protoreflect.FieldDescriptor) pr return protoreflect.ValueOfMessage(value.ProtoReflect()) case "cerc.auction.v1.Auction.winner_addresses": if len(x.WinnerAddresses) == 0 { - return protoreflect.ValueOfList(&_Auction_10_list{}) + return protoreflect.ValueOfList(&_Auction_11_list{}) } - listValue := &_Auction_10_list{list: &x.WinnerAddresses} + listValue := &_Auction_11_list{list: &x.WinnerAddresses} return protoreflect.ValueOfList(listValue) case "cerc.auction.v1.Auction.winning_bids": if len(x.WinningBids) == 0 { - return protoreflect.ValueOfList(&_Auction_11_list{}) + return protoreflect.ValueOfList(&_Auction_12_list{}) } - listValue := &_Auction_11_list{list: &x.WinningBids} + listValue := &_Auction_12_list{list: &x.WinningBids} return protoreflect.ValueOfList(listValue) case "cerc.auction.v1.Auction.winning_price": value := x.WinningPrice @@ -1210,9 +1213,6 @@ func (x *fastReflection_Auction) Get(descriptor protoreflect.FieldDescriptor) pr case "cerc.auction.v1.Auction.max_price": value := x.MaxPrice return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "cerc.auction.v1.Auction.kind": - value := x.Kind - return protoreflect.ValueOfString(value) case "cerc.auction.v1.Auction.num_providers": value := x.NumProviders return protoreflect.ValueOfInt32(value) @@ -1238,6 +1238,8 @@ func (x *fastReflection_Auction) Set(fd protoreflect.FieldDescriptor, value prot switch fd.FullName() { case "cerc.auction.v1.Auction.id": x.Id = value.Interface().(string) + case "cerc.auction.v1.Auction.kind": + x.Kind = value.Interface().(string) case "cerc.auction.v1.Auction.status": x.Status = value.Interface().(string) case "cerc.auction.v1.Auction.owner_address": @@ -1256,18 +1258,16 @@ func (x *fastReflection_Auction) Set(fd protoreflect.FieldDescriptor, value prot x.MinimumBid = value.Message().Interface().(*v1beta1.Coin) case "cerc.auction.v1.Auction.winner_addresses": lv := value.List() - clv := lv.(*_Auction_10_list) + clv := lv.(*_Auction_11_list) x.WinnerAddresses = *clv.list case "cerc.auction.v1.Auction.winning_bids": lv := value.List() - clv := lv.(*_Auction_11_list) + clv := lv.(*_Auction_12_list) x.WinningBids = *clv.list case "cerc.auction.v1.Auction.winning_price": x.WinningPrice = value.Message().Interface().(*v1beta1.Coin) case "cerc.auction.v1.Auction.max_price": x.MaxPrice = value.Message().Interface().(*v1beta1.Coin) - case "cerc.auction.v1.Auction.kind": - x.Kind = value.Interface().(string) case "cerc.auction.v1.Auction.num_providers": x.NumProviders = int32(value.Int()) default: @@ -1324,13 +1324,13 @@ func (x *fastReflection_Auction) Mutable(fd protoreflect.FieldDescriptor) protor if x.WinnerAddresses == nil { x.WinnerAddresses = []string{} } - value := &_Auction_10_list{list: &x.WinnerAddresses} + value := &_Auction_11_list{list: &x.WinnerAddresses} return protoreflect.ValueOfList(value) case "cerc.auction.v1.Auction.winning_bids": if x.WinningBids == nil { x.WinningBids = []*v1beta1.Coin{} } - value := &_Auction_11_list{list: &x.WinningBids} + value := &_Auction_12_list{list: &x.WinningBids} return protoreflect.ValueOfList(value) case "cerc.auction.v1.Auction.winning_price": if x.WinningPrice == nil { @@ -1344,12 +1344,12 @@ func (x *fastReflection_Auction) Mutable(fd protoreflect.FieldDescriptor) protor return protoreflect.ValueOfMessage(x.MaxPrice.ProtoReflect()) case "cerc.auction.v1.Auction.id": panic(fmt.Errorf("field id of message cerc.auction.v1.Auction is not mutable")) + case "cerc.auction.v1.Auction.kind": + panic(fmt.Errorf("field kind of message cerc.auction.v1.Auction is not mutable")) case "cerc.auction.v1.Auction.status": panic(fmt.Errorf("field status of message cerc.auction.v1.Auction is not mutable")) case "cerc.auction.v1.Auction.owner_address": panic(fmt.Errorf("field owner_address of message cerc.auction.v1.Auction is not mutable")) - case "cerc.auction.v1.Auction.kind": - panic(fmt.Errorf("field kind of message cerc.auction.v1.Auction is not mutable")) case "cerc.auction.v1.Auction.num_providers": panic(fmt.Errorf("field num_providers of message cerc.auction.v1.Auction is not mutable")) default: @@ -1367,6 +1367,8 @@ func (x *fastReflection_Auction) NewField(fd protoreflect.FieldDescriptor) proto switch fd.FullName() { case "cerc.auction.v1.Auction.id": return protoreflect.ValueOfString("") + case "cerc.auction.v1.Auction.kind": + return protoreflect.ValueOfString("") case "cerc.auction.v1.Auction.status": return protoreflect.ValueOfString("") case "cerc.auction.v1.Auction.owner_address": @@ -1391,18 +1393,16 @@ func (x *fastReflection_Auction) NewField(fd protoreflect.FieldDescriptor) proto return protoreflect.ValueOfMessage(m.ProtoReflect()) case "cerc.auction.v1.Auction.winner_addresses": list := []string{} - return protoreflect.ValueOfList(&_Auction_10_list{list: &list}) + return protoreflect.ValueOfList(&_Auction_11_list{list: &list}) case "cerc.auction.v1.Auction.winning_bids": list := []*v1beta1.Coin{} - return protoreflect.ValueOfList(&_Auction_11_list{list: &list}) + return protoreflect.ValueOfList(&_Auction_12_list{list: &list}) case "cerc.auction.v1.Auction.winning_price": m := new(v1beta1.Coin) return protoreflect.ValueOfMessage(m.ProtoReflect()) case "cerc.auction.v1.Auction.max_price": m := new(v1beta1.Coin) return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "cerc.auction.v1.Auction.kind": - return protoreflect.ValueOfString("") case "cerc.auction.v1.Auction.num_providers": return protoreflect.ValueOfInt32(int32(0)) default: @@ -1478,6 +1478,10 @@ func (x *fastReflection_Auction) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } + l = len(x.Kind) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } l = len(x.Status) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) @@ -1530,10 +1534,6 @@ func (x *fastReflection_Auction) ProtoMethods() *protoiface.Methods { l = options.Size(x.MaxPrice) n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.Kind) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } if x.NumProviders != 0 { n += 1 + runtime.Sov(uint64(x.NumProviders)) } @@ -1571,13 +1571,6 @@ func (x *fastReflection_Auction) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x78 } - if len(x.Kind) > 0 { - i -= len(x.Kind) - copy(dAtA[i:], x.Kind) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Kind))) - i-- - dAtA[i] = 0x72 - } if x.MaxPrice != nil { encoded, err := options.Marshal(x.MaxPrice) if err != nil { @@ -1590,7 +1583,7 @@ func (x *fastReflection_Auction) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x6a + dAtA[i] = 0x72 } if x.WinningPrice != nil { encoded, err := options.Marshal(x.WinningPrice) @@ -1604,7 +1597,7 @@ func (x *fastReflection_Auction) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x62 + dAtA[i] = 0x6a } if len(x.WinningBids) > 0 { for iNdEx := len(x.WinningBids) - 1; iNdEx >= 0; iNdEx-- { @@ -1619,7 +1612,7 @@ func (x *fastReflection_Auction) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x5a + dAtA[i] = 0x62 } } if len(x.WinnerAddresses) > 0 { @@ -1628,7 +1621,7 @@ func (x *fastReflection_Auction) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], x.WinnerAddresses[iNdEx]) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.WinnerAddresses[iNdEx]))) i-- - dAtA[i] = 0x52 + dAtA[i] = 0x5a } } if x.MinimumBid != nil { @@ -1643,7 +1636,7 @@ func (x *fastReflection_Auction) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x4a + dAtA[i] = 0x52 } if x.RevealFee != nil { encoded, err := options.Marshal(x.RevealFee) @@ -1657,7 +1650,7 @@ func (x *fastReflection_Auction) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x42 + dAtA[i] = 0x4a } if x.CommitFee != nil { encoded, err := options.Marshal(x.CommitFee) @@ -1671,7 +1664,7 @@ func (x *fastReflection_Auction) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x3a + dAtA[i] = 0x42 } if x.RevealsEndTime != nil { encoded, err := options.Marshal(x.RevealsEndTime) @@ -1685,7 +1678,7 @@ func (x *fastReflection_Auction) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x32 + dAtA[i] = 0x3a } if x.CommitsEndTime != nil { encoded, err := options.Marshal(x.CommitsEndTime) @@ -1699,7 +1692,7 @@ func (x *fastReflection_Auction) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x2a + dAtA[i] = 0x32 } if x.CreateTime != nil { encoded, err := options.Marshal(x.CreateTime) @@ -1713,20 +1706,27 @@ func (x *fastReflection_Auction) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x22 + dAtA[i] = 0x2a } if len(x.OwnerAddress) > 0 { i -= len(x.OwnerAddress) copy(dAtA[i:], x.OwnerAddress) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.OwnerAddress))) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x22 } if len(x.Status) > 0 { i -= len(x.Status) copy(dAtA[i:], x.Status) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Status))) i-- + dAtA[i] = 0x1a + } + if len(x.Kind) > 0 { + i -= len(x.Kind) + copy(dAtA[i:], x.Kind) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Kind))) + i-- dAtA[i] = 0x12 } if len(x.Id) > 0 { @@ -1818,6 +1818,38 @@ func (x *fastReflection_Auction) ProtoMethods() *protoiface.Methods { x.Id = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Kind = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) } @@ -1849,7 +1881,7 @@ func (x *fastReflection_Auction) ProtoMethods() *protoiface.Methods { } x.Status = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 4: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field OwnerAddress", wireType) } @@ -1881,7 +1913,7 @@ func (x *fastReflection_Auction) ProtoMethods() *protoiface.Methods { } x.OwnerAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 5: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CreateTime", wireType) } @@ -1917,7 +1949,7 @@ func (x *fastReflection_Auction) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 5: + case 6: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CommitsEndTime", wireType) } @@ -1953,7 +1985,7 @@ func (x *fastReflection_Auction) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 6: + case 7: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RevealsEndTime", wireType) } @@ -1989,7 +2021,7 @@ func (x *fastReflection_Auction) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 7: + case 8: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CommitFee", wireType) } @@ -2025,7 +2057,7 @@ func (x *fastReflection_Auction) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 8: + case 9: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RevealFee", wireType) } @@ -2061,7 +2093,7 @@ func (x *fastReflection_Auction) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 9: + case 10: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MinimumBid", wireType) } @@ -2097,7 +2129,7 @@ func (x *fastReflection_Auction) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 10: + case 11: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field WinnerAddresses", wireType) } @@ -2129,7 +2161,7 @@ func (x *fastReflection_Auction) ProtoMethods() *protoiface.Methods { } x.WinnerAddresses = append(x.WinnerAddresses, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 11: + case 12: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field WinningBids", wireType) } @@ -2163,7 +2195,7 @@ func (x *fastReflection_Auction) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 12: + case 13: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field WinningPrice", wireType) } @@ -2199,7 +2231,7 @@ func (x *fastReflection_Auction) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 13: + case 14: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MaxPrice", wireType) } @@ -2235,38 +2267,6 @@ func (x *fastReflection_Auction) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 14: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Kind = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex case 15: if wireType != 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NumProviders", wireType) @@ -3914,32 +3914,32 @@ type Auction struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // Auction's kind (vickrey | service_provider) + Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty"` + Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` // Address of the creator of the auction - OwnerAddress string `protobuf:"bytes,3,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"` + OwnerAddress string `protobuf:"bytes,4,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"` // Timestamp at which the auction was created - CreateTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` + CreateTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` // Timestamp at which the commits phase concluded - CommitsEndTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=commits_end_time,json=commitsEndTime,proto3" json:"commits_end_time,omitempty"` + CommitsEndTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=commits_end_time,json=commitsEndTime,proto3" json:"commits_end_time,omitempty"` // Timestamp at which the reveals phase concluded - RevealsEndTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=reveals_end_time,json=revealsEndTime,proto3" json:"reveals_end_time,omitempty"` + RevealsEndTime *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=reveals_end_time,json=revealsEndTime,proto3" json:"reveals_end_time,omitempty"` // Commit and reveal fees must both be paid when committing a bid // Reveal fee is returned only if the bid is revealed - CommitFee *v1beta1.Coin `protobuf:"bytes,7,opt,name=commit_fee,json=commitFee,proto3" json:"commit_fee,omitempty"` - RevealFee *v1beta1.Coin `protobuf:"bytes,8,opt,name=reveal_fee,json=revealFee,proto3" json:"reveal_fee,omitempty"` + CommitFee *v1beta1.Coin `protobuf:"bytes,8,opt,name=commit_fee,json=commitFee,proto3" json:"commit_fee,omitempty"` + RevealFee *v1beta1.Coin `protobuf:"bytes,9,opt,name=reveal_fee,json=revealFee,proto3" json:"reveal_fee,omitempty"` // Minimum acceptable bid amount for a valid commit - MinimumBid *v1beta1.Coin `protobuf:"bytes,9,opt,name=minimum_bid,json=minimumBid,proto3" json:"minimum_bid,omitempty"` - // Addresses of the winners - WinnerAddresses []string `protobuf:"bytes,10,rep,name=winner_addresses,json=winnerAddresses,proto3" json:"winner_addresses,omitempty"` + MinimumBid *v1beta1.Coin `protobuf:"bytes,10,opt,name=minimum_bid,json=minimumBid,proto3" json:"minimum_bid,omitempty"` + // Addresses of the winners (one for vickrey and can be multiple for service_provider) + WinnerAddresses []string `protobuf:"bytes,11,rep,name=winner_addresses,json=winnerAddresses,proto3" json:"winner_addresses,omitempty"` // Winning bids, i.e., the best bids - WinningBids []*v1beta1.Coin `protobuf:"bytes,11,rep,name=winning_bids,json=winningBids,proto3" json:"winning_bids,omitempty"` + WinningBids []*v1beta1.Coin `protobuf:"bytes,12,rep,name=winning_bids,json=winningBids,proto3" json:"winning_bids,omitempty"` // Amount the winner pays, i.e. the second best bid - WinningPrice *v1beta1.Coin `protobuf:"bytes,12,opt,name=winning_price,json=winningPrice,proto3" json:"winning_price,omitempty"` - // Maximum acceptable bid amount for a valid commit for reverse auctions - MaxPrice *v1beta1.Coin `protobuf:"bytes,13,opt,name=max_price,json=maxPrice,proto3" json:"max_price,omitempty"` - // Auction kind can be vickrey or service_provider - Kind string `protobuf:"bytes,14,opt,name=kind,proto3" json:"kind,omitempty"` + WinningPrice *v1beta1.Coin `protobuf:"bytes,13,opt,name=winning_price,json=winningPrice,proto3" json:"winning_price,omitempty"` + // Maximum acceptable bid amount for a valid commit for service provider auctions + MaxPrice *v1beta1.Coin `protobuf:"bytes,14,opt,name=max_price,json=maxPrice,proto3" json:"max_price,omitempty"` // Number of providers to be selected NumProviders int32 `protobuf:"varint,15,opt,name=num_providers,json=numProviders,proto3" json:"num_providers,omitempty"` } @@ -3971,6 +3971,13 @@ func (x *Auction) GetId() string { return "" } +func (x *Auction) GetKind() string { + if x != nil { + return x.Kind + } + return "" +} + func (x *Auction) GetStatus() string { if x != nil { return x.Status @@ -4055,13 +4062,6 @@ func (x *Auction) GetMaxPrice() *v1beta1.Coin { return nil } -func (x *Auction) GetKind() string { - if x != nil { - return x.Kind - } - return "" -} - func (x *Auction) GetNumProviders() int32 { if x != nil { return x.NumProviders @@ -4257,80 +4257,80 @@ var file_cerc_auction_v1_auction_proto_rawDesc = []byte{ 0x75, 0x6d, 0x5f, 0x62, 0x69, 0x64, 0x22, 0x52, 0x0a, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x42, 0x69, 0x64, 0x3a, 0x04, 0x98, 0xa0, 0x1f, 0x00, 0x22, 0xd3, 0x09, 0x0a, 0x07, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x23, 0x0a, - 0x0d, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x12, 0x6e, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, - 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x25, 0x6a, 0x73, 0x6f, - 0x6e, 0x3a, 0x22, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x20, - 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, - 0x65, 0x22, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, - 0x6d, 0x65, 0x12, 0x81, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x5f, 0x65, - 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x3b, 0xc8, 0xde, 0x1f, 0x00, 0xf2, - 0xde, 0x1f, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, - 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, - 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, - 0x65, 0x22, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x45, - 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x81, 0x01, 0x0a, 0x10, 0x72, 0x65, 0x76, 0x65, 0x61, - 0x6c, 0x73, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x3b, 0xc8, - 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x72, 0x65, 0x76, - 0x65, 0x61, 0x6c, 0x73, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x20, 0x79, - 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x73, 0x5f, 0x65, 0x6e, 0x64, - 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0e, 0x72, 0x65, 0x76, 0x65, - 0x61, 0x6c, 0x73, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x65, 0x0a, 0x0a, 0x63, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, + 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2f, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x1b, 0xf2, 0xde, 0x1f, 0x17, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6b, + 0x69, 0x6e, 0x64, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6b, 0x69, 0x6e, 0x64, 0x22, + 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x23, + 0x0a, 0x0d, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x12, 0x6e, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, + 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x25, 0x6a, 0x73, + 0x6f, 0x6e, 0x3a, 0x22, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, + 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, + 0x6d, 0x65, 0x22, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, + 0x69, 0x6d, 0x65, 0x12, 0x81, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x5f, + 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x3b, 0xc8, 0xde, 0x1f, 0x00, + 0xf2, 0xde, 0x1f, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x73, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, + 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, + 0x6d, 0x65, 0x22, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, + 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x81, 0x01, 0x0a, 0x10, 0x72, 0x65, 0x76, 0x65, + 0x61, 0x6c, 0x73, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x3b, + 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x72, 0x65, + 0x76, 0x65, 0x61, 0x6c, 0x73, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x20, + 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x73, 0x5f, 0x65, 0x6e, + 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0e, 0x72, 0x65, 0x76, + 0x65, 0x61, 0x6c, 0x73, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x65, 0x0a, 0x0a, 0x63, + 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, + 0xf2, 0xde, 0x1f, 0x23, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x5f, 0x66, 0x65, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x5f, 0x66, 0x65, 0x65, 0x22, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x46, + 0x65, 0x65, 0x12, 0x65, 0x0a, 0x0a, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x66, 0x65, 0x65, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, + 0x6e, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x23, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, + 0x22, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x66, 0x65, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d, + 0x6c, 0x3a, 0x22, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x66, 0x65, 0x65, 0x22, 0x52, 0x09, + 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x46, 0x65, 0x65, 0x12, 0x69, 0x0a, 0x0b, 0x6d, 0x69, 0x6e, + 0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x62, 0x69, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xf2, - 0xde, 0x1f, 0x23, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, - 0x66, 0x65, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x5f, 0x66, 0x65, 0x65, 0x22, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x46, 0x65, - 0x65, 0x12, 0x65, 0x0a, 0x0a, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x66, 0x65, 0x65, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x2d, 0xc8, 0xde, 0x1f, 0x00, 0xf2, + 0xde, 0x1f, 0x25, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, + 0x5f, 0x62, 0x69, 0x64, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6d, 0x69, 0x6e, 0x69, + 0x6d, 0x75, 0x6d, 0x5f, 0x62, 0x69, 0x64, 0x22, 0x52, 0x0a, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, + 0x6d, 0x42, 0x69, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x77, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, + 0x77, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x12, + 0x6d, 0x0a, 0x0c, 0x77, 0x69, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x69, 0x64, 0x73, 0x18, + 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, - 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x23, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, - 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x66, 0x65, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, - 0x3a, 0x22, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x66, 0x65, 0x65, 0x22, 0x52, 0x09, 0x72, - 0x65, 0x76, 0x65, 0x61, 0x6c, 0x46, 0x65, 0x65, 0x12, 0x69, 0x0a, 0x0b, 0x6d, 0x69, 0x6e, 0x69, - 0x6d, 0x75, 0x6d, 0x5f, 0x62, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x2d, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, - 0x1f, 0x25, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x5f, - 0x62, 0x69, 0x64, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6d, 0x69, 0x6e, 0x69, 0x6d, - 0x75, 0x6d, 0x5f, 0x62, 0x69, 0x64, 0x22, 0x52, 0x0a, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, - 0x42, 0x69, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x77, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x77, - 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x12, 0x6d, - 0x0a, 0x0c, 0x77, 0x69, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x69, 0x64, 0x73, 0x18, 0x0b, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, - 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, - 0x2f, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x27, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x77, - 0x69, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x69, 0x64, 0x73, 0x22, 0x20, 0x79, 0x61, 0x6d, - 0x6c, 0x3a, 0x22, 0x77, 0x69, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x69, 0x64, 0x73, 0x22, - 0x52, 0x0b, 0x77, 0x69, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x42, 0x69, 0x64, 0x73, 0x12, 0x71, 0x0a, - 0x0d, 0x77, 0x69, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x0c, + 0x42, 0x2f, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x27, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, + 0x77, 0x69, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x69, 0x64, 0x73, 0x22, 0x20, 0x79, 0x61, + 0x6d, 0x6c, 0x3a, 0x22, 0x77, 0x69, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x69, 0x64, 0x73, + 0x22, 0x52, 0x0b, 0x77, 0x69, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x42, 0x69, 0x64, 0x73, 0x12, 0x71, + 0x0a, 0x0d, 0x77, 0x69, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, + 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, + 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, + 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x29, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, + 0x77, 0x69, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x22, 0x20, 0x79, + 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x77, 0x69, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x72, 0x69, + 0x63, 0x65, 0x22, 0x52, 0x0c, 0x77, 0x69, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x69, 0x63, + 0x65, 0x12, 0x61, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, - 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x29, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x77, - 0x69, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x22, 0x20, 0x79, 0x61, - 0x6d, 0x6c, 0x3a, 0x22, 0x77, 0x69, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x72, 0x69, 0x63, - 0x65, 0x22, 0x52, 0x0c, 0x77, 0x69, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x69, 0x63, 0x65, - 0x12, 0x61, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x0d, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, - 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x29, - 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x21, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6d, 0x61, - 0x78, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6d, - 0x61, 0x78, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x22, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x50, 0x72, - 0x69, 0x63, 0x65, 0x12, 0x2f, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x0e, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x1b, 0xf2, 0xde, 0x1f, 0x17, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6b, 0x69, 0x6e, - 0x64, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6b, 0x69, 0x6e, 0x64, 0x22, 0x52, 0x04, - 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x6e, 0x75, 0x6d, 0x5f, 0x70, 0x72, 0x6f, 0x76, + 0x29, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x21, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6d, + 0x61, 0x78, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, + 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x22, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x50, + 0x72, 0x69, 0x63, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x6e, 0x75, 0x6d, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6e, 0x75, 0x6d, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x22, 0x4c, 0x0a, 0x08, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3a, 0x0a, 0x08, 0x61, diff --git a/api/cerc/auction/v1/tx.pulsar.go b/api/cerc/auction/v1/tx.pulsar.go index 28177724..0d4bb11e 100644 --- a/api/cerc/auction/v1/tx.pulsar.go +++ b/api/cerc/auction/v1/tx.pulsar.go @@ -26,8 +26,8 @@ var ( fd_MsgCreateAuction_reveal_fee protoreflect.FieldDescriptor fd_MsgCreateAuction_minimum_bid protoreflect.FieldDescriptor fd_MsgCreateAuction_signer protoreflect.FieldDescriptor - fd_MsgCreateAuction_max_price protoreflect.FieldDescriptor fd_MsgCreateAuction_kind protoreflect.FieldDescriptor + fd_MsgCreateAuction_max_price protoreflect.FieldDescriptor fd_MsgCreateAuction_num_providers protoreflect.FieldDescriptor ) @@ -40,8 +40,8 @@ func init() { fd_MsgCreateAuction_reveal_fee = md_MsgCreateAuction.Fields().ByName("reveal_fee") fd_MsgCreateAuction_minimum_bid = md_MsgCreateAuction.Fields().ByName("minimum_bid") fd_MsgCreateAuction_signer = md_MsgCreateAuction.Fields().ByName("signer") - fd_MsgCreateAuction_max_price = md_MsgCreateAuction.Fields().ByName("max_price") fd_MsgCreateAuction_kind = md_MsgCreateAuction.Fields().ByName("kind") + fd_MsgCreateAuction_max_price = md_MsgCreateAuction.Fields().ByName("max_price") fd_MsgCreateAuction_num_providers = md_MsgCreateAuction.Fields().ByName("num_providers") } @@ -146,18 +146,18 @@ func (x *fastReflection_MsgCreateAuction) Range(f func(protoreflect.FieldDescrip return } } - if x.MaxPrice != nil { - value := protoreflect.ValueOfMessage(x.MaxPrice.ProtoReflect()) - if !f(fd_MsgCreateAuction_max_price, value) { - return - } - } if x.Kind != "" { value := protoreflect.ValueOfString(x.Kind) if !f(fd_MsgCreateAuction_kind, value) { return } } + if x.MaxPrice != nil { + value := protoreflect.ValueOfMessage(x.MaxPrice.ProtoReflect()) + if !f(fd_MsgCreateAuction_max_price, value) { + return + } + } if x.NumProviders != int32(0) { value := protoreflect.ValueOfInt32(x.NumProviders) if !f(fd_MsgCreateAuction_num_providers, value) { @@ -191,10 +191,10 @@ func (x *fastReflection_MsgCreateAuction) Has(fd protoreflect.FieldDescriptor) b return x.MinimumBid != nil case "cerc.auction.v1.MsgCreateAuction.signer": return x.Signer != "" - case "cerc.auction.v1.MsgCreateAuction.max_price": - return x.MaxPrice != nil case "cerc.auction.v1.MsgCreateAuction.kind": return x.Kind != "" + case "cerc.auction.v1.MsgCreateAuction.max_price": + return x.MaxPrice != nil case "cerc.auction.v1.MsgCreateAuction.num_providers": return x.NumProviders != int32(0) default: @@ -225,10 +225,10 @@ func (x *fastReflection_MsgCreateAuction) Clear(fd protoreflect.FieldDescriptor) x.MinimumBid = nil case "cerc.auction.v1.MsgCreateAuction.signer": x.Signer = "" - case "cerc.auction.v1.MsgCreateAuction.max_price": - x.MaxPrice = nil case "cerc.auction.v1.MsgCreateAuction.kind": x.Kind = "" + case "cerc.auction.v1.MsgCreateAuction.max_price": + x.MaxPrice = nil case "cerc.auction.v1.MsgCreateAuction.num_providers": x.NumProviders = int32(0) default: @@ -265,12 +265,12 @@ func (x *fastReflection_MsgCreateAuction) Get(descriptor protoreflect.FieldDescr case "cerc.auction.v1.MsgCreateAuction.signer": value := x.Signer return protoreflect.ValueOfString(value) - case "cerc.auction.v1.MsgCreateAuction.max_price": - value := x.MaxPrice - return protoreflect.ValueOfMessage(value.ProtoReflect()) case "cerc.auction.v1.MsgCreateAuction.kind": value := x.Kind return protoreflect.ValueOfString(value) + case "cerc.auction.v1.MsgCreateAuction.max_price": + value := x.MaxPrice + return protoreflect.ValueOfMessage(value.ProtoReflect()) case "cerc.auction.v1.MsgCreateAuction.num_providers": value := x.NumProviders return protoreflect.ValueOfInt32(value) @@ -306,10 +306,10 @@ func (x *fastReflection_MsgCreateAuction) Set(fd protoreflect.FieldDescriptor, v x.MinimumBid = value.Message().Interface().(*v1beta1.Coin) case "cerc.auction.v1.MsgCreateAuction.signer": x.Signer = value.Interface().(string) - case "cerc.auction.v1.MsgCreateAuction.max_price": - x.MaxPrice = value.Message().Interface().(*v1beta1.Coin) case "cerc.auction.v1.MsgCreateAuction.kind": x.Kind = value.Interface().(string) + case "cerc.auction.v1.MsgCreateAuction.max_price": + x.MaxPrice = value.Message().Interface().(*v1beta1.Coin) case "cerc.auction.v1.MsgCreateAuction.num_providers": x.NumProviders = int32(value.Int()) default: @@ -398,11 +398,11 @@ func (x *fastReflection_MsgCreateAuction) NewField(fd protoreflect.FieldDescript return protoreflect.ValueOfMessage(m.ProtoReflect()) case "cerc.auction.v1.MsgCreateAuction.signer": return protoreflect.ValueOfString("") + case "cerc.auction.v1.MsgCreateAuction.kind": + return protoreflect.ValueOfString("") case "cerc.auction.v1.MsgCreateAuction.max_price": m := new(v1beta1.Coin) return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "cerc.auction.v1.MsgCreateAuction.kind": - return protoreflect.ValueOfString("") case "cerc.auction.v1.MsgCreateAuction.num_providers": return protoreflect.ValueOfInt32(int32(0)) default: @@ -498,14 +498,14 @@ func (x *fastReflection_MsgCreateAuction) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - if x.MaxPrice != nil { - l = options.Size(x.MaxPrice) - n += 1 + l + runtime.Sov(uint64(l)) - } l = len(x.Kind) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } + if x.MaxPrice != nil { + l = options.Size(x.MaxPrice) + n += 1 + l + runtime.Sov(uint64(l)) + } if x.NumProviders != 0 { n += 1 + runtime.Sov(uint64(x.NumProviders)) } @@ -543,13 +543,6 @@ func (x *fastReflection_MsgCreateAuction) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x48 } - if len(x.Kind) > 0 { - i -= len(x.Kind) - copy(dAtA[i:], x.Kind) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Kind))) - i-- - dAtA[i] = 0x42 - } if x.MaxPrice != nil { encoded, err := options.Marshal(x.MaxPrice) if err != nil { @@ -562,6 +555,13 @@ func (x *fastReflection_MsgCreateAuction) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- + dAtA[i] = 0x42 + } + if len(x.Kind) > 0 { + i -= len(x.Kind) + copy(dAtA[i:], x.Kind) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Kind))) + i-- dAtA[i] = 0x3a } if len(x.Signer) > 0 { @@ -903,6 +903,38 @@ func (x *fastReflection_MsgCreateAuction) ProtoMethods() *protoiface.Methods { x.Signer = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 7: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Kind = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MaxPrice", wireType) } @@ -938,38 +970,6 @@ func (x *fastReflection_MsgCreateAuction) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 8: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Kind = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex case 9: if wireType != 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field NumProviders", wireType) @@ -4311,10 +4311,10 @@ type MsgCreateAuction struct { MinimumBid *v1beta1.Coin `protobuf:"bytes,5,opt,name=minimum_bid,json=minimumBid,proto3" json:"minimum_bid,omitempty"` // Address of the signer Signer string `protobuf:"bytes,6,opt,name=signer,proto3" json:"signer,omitempty"` - // Maximum acceptable bid amount (for reverse auctions) - MaxPrice *v1beta1.Coin `protobuf:"bytes,7,opt,name=max_price,json=maxPrice,proto3" json:"max_price,omitempty"` - // Auction kind can be vickrey or service_provider - Kind string `protobuf:"bytes,8,opt,name=kind,proto3" json:"kind,omitempty"` + // Auction's kind (vickrey | service_provider) + Kind string `protobuf:"bytes,7,opt,name=kind,proto3" json:"kind,omitempty"` + // Maximum acceptable bid amount (for service provider auctions) + MaxPrice *v1beta1.Coin `protobuf:"bytes,8,opt,name=max_price,json=maxPrice,proto3" json:"max_price,omitempty"` // Number of providers to be selected NumProviders int32 `protobuf:"varint,9,opt,name=num_providers,json=numProviders,proto3" json:"num_providers,omitempty"` } @@ -4381,13 +4381,6 @@ func (x *MsgCreateAuction) GetSigner() string { return "" } -func (x *MsgCreateAuction) GetMaxPrice() *v1beta1.Coin { - if x != nil { - return x.MaxPrice - } - return nil -} - func (x *MsgCreateAuction) GetKind() string { if x != nil { return x.Kind @@ -4395,6 +4388,13 @@ func (x *MsgCreateAuction) GetKind() string { return "" } +func (x *MsgCreateAuction) GetMaxPrice() *v1beta1.Coin { + if x != nil { + return x.MaxPrice + } + return nil +} + func (x *MsgCreateAuction) GetNumProviders() int32 { if x != nil { return x.NumProviders @@ -4759,16 +4759,16 @@ var file_cerc_auction_v1_tx_proto_rawDesc = []byte{ 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1f, 0xf2, 0xde, 0x1f, 0x1b, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, - 0x72, 0x12, 0x61, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, - 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, - 0x29, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x21, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6d, - 0x61, 0x78, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, - 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x22, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x50, - 0x72, 0x69, 0x63, 0x65, 0x12, 0x2f, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x08, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x1b, 0xf2, 0xde, 0x1f, 0x17, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6b, 0x69, - 0x6e, 0x64, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6b, 0x69, 0x6e, 0x64, 0x22, 0x52, - 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x6e, 0x75, 0x6d, 0x5f, 0x70, 0x72, 0x6f, + 0x72, 0x12, 0x2f, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x1b, 0xf2, 0xde, 0x1f, 0x17, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6b, 0x69, 0x6e, 0x64, 0x22, + 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6b, 0x69, 0x6e, 0x64, 0x22, 0x52, 0x04, 0x6b, 0x69, + 0x6e, 0x64, 0x12, 0x61, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, + 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, + 0x42, 0x29, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x21, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, + 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, + 0x22, 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x22, 0x52, 0x08, 0x6d, 0x61, 0x78, + 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x6e, 0x75, 0x6d, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6e, 0x75, 0x6d, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x3a, 0x0f, 0x88, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, 0x77, 0x0a, 0x18, 0x4d, diff --git a/proto/cerc/auction/v1/auction.proto b/proto/cerc/auction/v1/auction.proto index d7d6301f..7de86476 100644 --- a/proto/cerc/auction/v1/auction.proto +++ b/proto/cerc/auction/v1/auction.proto @@ -52,27 +52,33 @@ message Auction { option (gogoproto.goproto_getters) = false; string id = 1; - string status = 2; + + // Auction's kind (vickrey | service_provider) + string kind = 2 [ + (gogoproto.moretags) = "json:\"kind\" yaml:\"kind\"" + ]; + + string status = 3; // Address of the creator of the auction - string owner_address = 3; + string owner_address = 4; // Timestamp at which the auction was created - google.protobuf.Timestamp create_time = 4 [ + google.protobuf.Timestamp create_time = 5 [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"create_time\" yaml:\"create_time\"" ]; // Timestamp at which the commits phase concluded - google.protobuf.Timestamp commits_end_time = 5 [ + google.protobuf.Timestamp commits_end_time = 6 [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"commits_end_time\" yaml:\"commits_end_time\"" ]; // Timestamp at which the reveals phase concluded - google.protobuf.Timestamp reveals_end_time = 6 [ + google.protobuf.Timestamp reveals_end_time = 7 [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"reveals_end_time\" yaml:\"reveals_end_time\"" @@ -80,47 +86,42 @@ message Auction { // Commit and reveal fees must both be paid when committing a bid // Reveal fee is returned only if the bid is revealed - cosmos.base.v1beta1.Coin commit_fee = 7 [ + cosmos.base.v1beta1.Coin commit_fee = 8 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"commit_fee\" yaml:\"commit_fee\"" ]; - cosmos.base.v1beta1.Coin reveal_fee = 8 [ + cosmos.base.v1beta1.Coin reveal_fee = 9 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"reveal_fee\" yaml:\"reveal_fee\"" ]; // Minimum acceptable bid amount for a valid commit - cosmos.base.v1beta1.Coin minimum_bid = 9 [ + cosmos.base.v1beta1.Coin minimum_bid = 10 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"minimum_bid\" yaml:\"minimum_bid\"" ]; - // Addresses of the winners - repeated string winner_addresses = 10; + // Addresses of the winners (one for vickrey and can be multiple for service_provider) + repeated string winner_addresses = 11; // Winning bids, i.e., the best bids - repeated cosmos.base.v1beta1.Coin winning_bids = 11 [ + repeated cosmos.base.v1beta1.Coin winning_bids = 12 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"winning_bids\" yaml:\"winning_bids\"" ]; // Amount the winner pays, i.e. the second best bid - cosmos.base.v1beta1.Coin winning_price = 12 [ + cosmos.base.v1beta1.Coin winning_price = 13 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"winning_price\" yaml:\"winning_price\"" ]; - // Maximum acceptable bid amount for a valid commit for reverse auctions - cosmos.base.v1beta1.Coin max_price = 13 [ + // Maximum acceptable bid amount for a valid commit for service provider auctions + cosmos.base.v1beta1.Coin max_price = 14 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"max_price\" yaml:\"max_price\"" ]; - // Auction kind can be vickrey or service_provider - string kind = 14 [ - (gogoproto.moretags) = "json:\"kind\" yaml:\"kind\"" - ]; - // Number of providers to be selected int32 num_providers = 15; } diff --git a/proto/cerc/auction/v1/tx.proto b/proto/cerc/auction/v1/tx.proto index a469dcdf..ec02f771 100644 --- a/proto/cerc/auction/v1/tx.proto +++ b/proto/cerc/auction/v1/tx.proto @@ -77,15 +77,15 @@ message MsgCreateAuction { string signer = 6 [ (gogoproto.moretags) = "json:\"signer\" yaml:\"signer\"" ]; - // Maximum acceptable bid amount (for reverse auctions) - cosmos.base.v1beta1.Coin max_price = 7 [ - (gogoproto.nullable) = false, - (gogoproto.moretags) = "json:\"max_price\" yaml:\"max_price\"" + // Auction's kind (vickrey | service_provider) + string kind = 7 [ + (gogoproto.moretags) = "json:\"kind\" yaml:\"kind\"" ]; - // Auction kind can be vickrey or service_provider - string kind = 8 [ - (gogoproto.moretags) = "json:\"kind\" yaml:\"kind\"" + // Maximum acceptable bid amount (for service provider auctions) + cosmos.base.v1beta1.Coin max_price = 8 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"max_price\" yaml:\"max_price\"" ]; // Number of providers to be selected diff --git a/x/auction/auction.pb.go b/x/auction/auction.pb.go index 1612dede..5f93c3c5 100644 --- a/x/auction/auction.pb.go +++ b/x/auction/auction.pb.go @@ -112,32 +112,32 @@ func (m *Params) GetMinimumBid() types.Coin { // Auction represents a sealed-bid on-chain auction type Auction struct { - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // Auction's kind (vickrey | service_provider) + Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty" json:"kind" yaml:"kind"` + Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` // Address of the creator of the auction - OwnerAddress string `protobuf:"bytes,3,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"` + OwnerAddress string `protobuf:"bytes,4,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"` // Timestamp at which the auction was created - CreateTime time.Time `protobuf:"bytes,4,opt,name=create_time,json=createTime,proto3,stdtime" json:"create_time" json:"create_time" yaml:"create_time"` + CreateTime time.Time `protobuf:"bytes,5,opt,name=create_time,json=createTime,proto3,stdtime" json:"create_time" json:"create_time" yaml:"create_time"` // Timestamp at which the commits phase concluded - CommitsEndTime time.Time `protobuf:"bytes,5,opt,name=commits_end_time,json=commitsEndTime,proto3,stdtime" json:"commits_end_time" json:"commits_end_time" yaml:"commits_end_time"` + CommitsEndTime time.Time `protobuf:"bytes,6,opt,name=commits_end_time,json=commitsEndTime,proto3,stdtime" json:"commits_end_time" json:"commits_end_time" yaml:"commits_end_time"` // Timestamp at which the reveals phase concluded - RevealsEndTime time.Time `protobuf:"bytes,6,opt,name=reveals_end_time,json=revealsEndTime,proto3,stdtime" json:"reveals_end_time" json:"reveals_end_time" yaml:"reveals_end_time"` + RevealsEndTime time.Time `protobuf:"bytes,7,opt,name=reveals_end_time,json=revealsEndTime,proto3,stdtime" json:"reveals_end_time" json:"reveals_end_time" yaml:"reveals_end_time"` // Commit and reveal fees must both be paid when committing a bid // Reveal fee is returned only if the bid is revealed - CommitFee types.Coin `protobuf:"bytes,7,opt,name=commit_fee,json=commitFee,proto3" json:"commit_fee" json:"commit_fee" yaml:"commit_fee"` - RevealFee types.Coin `protobuf:"bytes,8,opt,name=reveal_fee,json=revealFee,proto3" json:"reveal_fee" json:"reveal_fee" yaml:"reveal_fee"` + CommitFee types.Coin `protobuf:"bytes,8,opt,name=commit_fee,json=commitFee,proto3" json:"commit_fee" json:"commit_fee" yaml:"commit_fee"` + RevealFee types.Coin `protobuf:"bytes,9,opt,name=reveal_fee,json=revealFee,proto3" json:"reveal_fee" json:"reveal_fee" yaml:"reveal_fee"` // Minimum acceptable bid amount for a valid commit - MinimumBid types.Coin `protobuf:"bytes,9,opt,name=minimum_bid,json=minimumBid,proto3" json:"minimum_bid" json:"minimum_bid" yaml:"minimum_bid"` - // Addresses of the winners - WinnerAddresses []string `protobuf:"bytes,10,rep,name=winner_addresses,json=winnerAddresses,proto3" json:"winner_addresses,omitempty"` + MinimumBid types.Coin `protobuf:"bytes,10,opt,name=minimum_bid,json=minimumBid,proto3" json:"minimum_bid" json:"minimum_bid" yaml:"minimum_bid"` + // Addresses of the winners (one for vickrey and can be multiple for service_provider) + WinnerAddresses []string `protobuf:"bytes,11,rep,name=winner_addresses,json=winnerAddresses,proto3" json:"winner_addresses,omitempty"` // Winning bids, i.e., the best bids - WinningBids []types.Coin `protobuf:"bytes,11,rep,name=winning_bids,json=winningBids,proto3" json:"winning_bids" json:"winning_bids" yaml:"winning_bids"` + WinningBids []types.Coin `protobuf:"bytes,12,rep,name=winning_bids,json=winningBids,proto3" json:"winning_bids" json:"winning_bids" yaml:"winning_bids"` // Amount the winner pays, i.e. the second best bid - WinningPrice types.Coin `protobuf:"bytes,12,opt,name=winning_price,json=winningPrice,proto3" json:"winning_price" json:"winning_price" yaml:"winning_price"` - // Maximum acceptable bid amount for a valid commit for reverse auctions - MaxPrice types.Coin `protobuf:"bytes,13,opt,name=max_price,json=maxPrice,proto3" json:"max_price" json:"max_price" yaml:"max_price"` - // Auction kind can be vickrey or service_provider - Kind string `protobuf:"bytes,14,opt,name=kind,proto3" json:"kind,omitempty" json:"kind" yaml:"kind"` + WinningPrice types.Coin `protobuf:"bytes,13,opt,name=winning_price,json=winningPrice,proto3" json:"winning_price" json:"winning_price" yaml:"winning_price"` + // Maximum acceptable bid amount for a valid commit for service provider auctions + MaxPrice types.Coin `protobuf:"bytes,14,opt,name=max_price,json=maxPrice,proto3" json:"max_price" json:"max_price" yaml:"max_price"` // Number of providers to be selected NumProviders int32 `protobuf:"varint,15,opt,name=num_providers,json=numProviders,proto3" json:"num_providers,omitempty"` } @@ -269,63 +269,63 @@ func init() { func init() { proto.RegisterFile("cerc/auction/v1/auction.proto", fileDescriptor_34b162eb5b365523) } var fileDescriptor_34b162eb5b365523 = []byte{ - // 892 bytes of a gzipped FileDescriptorProto + // 888 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xcf, 0x6f, 0xe3, 0x44, - 0x14, 0x8e, 0x9b, 0x34, 0xad, 0x27, 0xfd, 0xb1, 0xb2, 0x10, 0x98, 0xa2, 0x4d, 0x42, 0x57, 0x15, - 0xad, 0xd0, 0xda, 0x0a, 0xdc, 0xca, 0x01, 0xc5, 0xfc, 0x10, 0x48, 0x1c, 0x2a, 0x8b, 0x13, 0x17, + 0x14, 0x8e, 0xdb, 0x34, 0x1b, 0x4f, 0x9a, 0x76, 0x65, 0x21, 0x30, 0x45, 0x9b, 0x84, 0x56, 0x15, + 0xad, 0xd0, 0xda, 0x0a, 0xdc, 0xc2, 0x01, 0xc5, 0xfc, 0x10, 0x48, 0x1c, 0x2a, 0x8b, 0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, 0x00, 0x00, 0xff, 0xff, + 0x92, 0xcd, 0xec, 0xad, 0x08, 0x0b, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -422,13 +422,6 @@ func (m *Auction) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x78 } - if len(m.Kind) > 0 { - i -= len(m.Kind) - copy(dAtA[i:], m.Kind) - i = encodeVarintAuction(dAtA, i, uint64(len(m.Kind))) - i-- - dAtA[i] = 0x72 - } { size, err := m.MaxPrice.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -438,7 +431,7 @@ func (m *Auction) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintAuction(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x6a + dAtA[i] = 0x72 { size, err := m.WinningPrice.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -448,7 +441,7 @@ func (m *Auction) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintAuction(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x62 + dAtA[i] = 0x6a if len(m.WinningBids) > 0 { for iNdEx := len(m.WinningBids) - 1; iNdEx >= 0; iNdEx-- { { @@ -460,7 +453,7 @@ func (m *Auction) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintAuction(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x5a + dAtA[i] = 0x62 } } if len(m.WinnerAddresses) > 0 { @@ -469,7 +462,7 @@ func (m *Auction) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.WinnerAddresses[iNdEx]) i = encodeVarintAuction(dAtA, i, uint64(len(m.WinnerAddresses[iNdEx]))) i-- - dAtA[i] = 0x52 + dAtA[i] = 0x5a } } { @@ -481,7 +474,7 @@ func (m *Auction) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintAuction(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x4a + dAtA[i] = 0x52 { size, err := m.RevealFee.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -491,7 +484,7 @@ func (m *Auction) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintAuction(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x42 + dAtA[i] = 0x4a { size, err := m.CommitFee.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -501,7 +494,7 @@ func (m *Auction) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintAuction(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x3a + dAtA[i] = 0x42 n11, err11 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.RevealsEndTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.RevealsEndTime):]) if err11 != nil { return 0, err11 @@ -509,7 +502,7 @@ func (m *Auction) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= n11 i = encodeVarintAuction(dAtA, i, uint64(n11)) i-- - dAtA[i] = 0x32 + dAtA[i] = 0x3a n12, err12 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.CommitsEndTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.CommitsEndTime):]) if err12 != nil { return 0, err12 @@ -517,7 +510,7 @@ func (m *Auction) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= n12 i = encodeVarintAuction(dAtA, i, uint64(n12)) i-- - dAtA[i] = 0x2a + dAtA[i] = 0x32 n13, err13 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.CreateTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.CreateTime):]) if err13 != nil { return 0, err13 @@ -525,19 +518,26 @@ func (m *Auction) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= n13 i = encodeVarintAuction(dAtA, i, uint64(n13)) i-- - dAtA[i] = 0x22 + dAtA[i] = 0x2a if len(m.OwnerAddress) > 0 { i -= len(m.OwnerAddress) copy(dAtA[i:], m.OwnerAddress) i = encodeVarintAuction(dAtA, i, uint64(len(m.OwnerAddress))) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x22 } if len(m.Status) > 0 { i -= len(m.Status) copy(dAtA[i:], m.Status) i = encodeVarintAuction(dAtA, i, uint64(len(m.Status))) i-- + dAtA[i] = 0x1a + } + if len(m.Kind) > 0 { + i -= len(m.Kind) + copy(dAtA[i:], m.Kind) + i = encodeVarintAuction(dAtA, i, uint64(len(m.Kind))) + i-- dAtA[i] = 0x12 } if len(m.Id) > 0 { @@ -724,6 +724,10 @@ func (m *Auction) Size() (n int) { if l > 0 { n += 1 + l + sovAuction(uint64(l)) } + l = len(m.Kind) + if l > 0 { + n += 1 + l + sovAuction(uint64(l)) + } l = len(m.Status) if l > 0 { n += 1 + l + sovAuction(uint64(l)) @@ -760,10 +764,6 @@ func (m *Auction) Size() (n int) { n += 1 + l + sovAuction(uint64(l)) l = m.MaxPrice.Size() n += 1 + l + sovAuction(uint64(l)) - l = len(m.Kind) - if l > 0 { - n += 1 + l + sovAuction(uint64(l)) - } if m.NumProviders != 0 { n += 1 + sovAuction(uint64(m.NumProviders)) } @@ -1103,6 +1103,38 @@ func (m *Auction) Unmarshal(dAtA []byte) error { m.Id = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAuction + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Kind = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) } @@ -1134,7 +1166,7 @@ func (m *Auction) Unmarshal(dAtA []byte) error { } m.Status = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field OwnerAddress", wireType) } @@ -1166,7 +1198,7 @@ func (m *Auction) Unmarshal(dAtA []byte) error { } m.OwnerAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field CreateTime", wireType) } @@ -1199,7 +1231,7 @@ func (m *Auction) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 5: + case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field CommitsEndTime", wireType) } @@ -1232,7 +1264,7 @@ func (m *Auction) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 6: + case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RevealsEndTime", wireType) } @@ -1265,7 +1297,7 @@ func (m *Auction) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 7: + case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field CommitFee", wireType) } @@ -1298,7 +1330,7 @@ func (m *Auction) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 8: + case 9: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RevealFee", wireType) } @@ -1331,7 +1363,7 @@ func (m *Auction) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 9: + case 10: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field MinimumBid", wireType) } @@ -1364,7 +1396,7 @@ func (m *Auction) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 10: + case 11: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field WinnerAddresses", wireType) } @@ -1396,7 +1428,7 @@ func (m *Auction) Unmarshal(dAtA []byte) error { } m.WinnerAddresses = append(m.WinnerAddresses, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 11: + case 12: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field WinningBids", wireType) } @@ -1430,7 +1462,7 @@ func (m *Auction) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 12: + case 13: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field WinningPrice", wireType) } @@ -1463,7 +1495,7 @@ func (m *Auction) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 13: + case 14: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field MaxPrice", wireType) } @@ -1496,38 +1528,6 @@ func (m *Auction) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 14: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAuction - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Kind = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex case 15: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field NumProviders", wireType) diff --git a/x/auction/client/cli/tx.go b/x/auction/client/cli/tx.go index 3f044556..a170b287 100644 --- a/x/auction/client/cli/tx.go +++ b/x/auction/client/cli/tx.go @@ -132,9 +132,9 @@ func GetCmdRevealBid() *cobra.Command { func GetCmdCreateAuction() *cobra.Command { cmd := &cobra.Command{ - Use: "create [commits-duration] [reveals-duration] [commit-fee] [reveal-fee] [minimum-bid] [maximum-bid] [reverse]", + Use: "create [commits-duration] [reveals-duration] [commit-fee] [reveal-fee] [minimum-bid] [max-price] [kind] [num-providers]", Short: "Create auction.", - Args: cobra.ExactArgs(7), + Args: cobra.ExactArgs(8), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { @@ -166,20 +166,23 @@ func GetCmdCreateAuction() *cobra.Command { return err } - maximumBid, err := sdk.ParseCoinNormalized(args[5]) + maxPrice, err := sdk.ParseCoinNormalized(args[5]) if err != nil { return err } kind := args[6] + numProviders := args[7] + msg := auctiontypes.NewMsgCreateAuction( commitsDuration, revealsDuration, commitFee, revealFee, minimumBid, - maximumBid, + maxPrice, + numProviders, kind, clientCtx.GetFromAddress(), ) diff --git a/x/auction/keeper/keeper.go b/x/auction/keeper/keeper.go index a523f637..13498505 100644 --- a/x/auction/keeper/keeper.go +++ b/x/auction/keeper/keeper.go @@ -342,9 +342,9 @@ func (k Keeper) CreateAuction(ctx sdk.Context, msg auctiontypes.MsgCreateAuction revealsEndTime := now.Add(msg.CommitsDuration + msg.RevealsDuration) if msg.Kind == auctiontypes.AuctionKindServiceProvider { - totalMaxBidAmount := sdk.NewCoin(msg.MaxPrice.Denom, msg.MaxPrice.Amount.MulRaw(int64(msg.NumProviders))) + totalLockedAmount := sdk.NewCoin(msg.MaxPrice.Denom, msg.MaxPrice.Amount.MulRaw(int64(msg.NumProviders))) - sdkErr := k.bankKeeper.SendCoinsFromAccountToModule(ctx, signerAddress, auctiontypes.ModuleName, sdk.NewCoins(totalMaxBidAmount)) + sdkErr := k.bankKeeper.SendCoinsFromAccountToModule(ctx, signerAddress, auctiontypes.ModuleName, sdk.NewCoins(totalLockedAmount)) if sdkErr != nil { k.Logger(ctx).Error(fmt.Sprintf("Auction error transferring maximum_bid amount: %v", sdkErr)) panic(sdkErr) @@ -626,7 +626,7 @@ func (k Keeper) processAuctionPhases(ctx sdk.Context) error { return err } } else { - if err = k.pickServiceProviderAuctionWinner(ctx, auction); err != nil { + if err = k.pickServiceProviderAuctionWinners(ctx, auction); err != nil { return err } } @@ -750,7 +750,7 @@ func (k Keeper) pickAuctionWinner(ctx sdk.Context, auction *auctiontypes.Auction } } - // Process winner account (if nobody bids, there won't be a winner). + // Process winner accounts (if nobody bids, there won't be a winner). if len(auction.WinnerAddresses) == 0 { winnerAddress, err := sdk.AccAddressFromBech32(auction.WinnerAddresses[0]) if err != nil { @@ -796,7 +796,7 @@ func (k Keeper) pickAuctionWinner(ctx sdk.Context, auction *auctiontypes.Auction } // Pick winner for service_provider auction -func (k Keeper) pickServiceProviderAuctionWinner(ctx sdk.Context, auction *auctiontypes.Auction) error { +func (k Keeper) pickServiceProviderAuctionWinners(ctx sdk.Context, auction *auctiontypes.Auction) error { k.Logger(ctx).Info(fmt.Sprintf("Picking auction %s winners.", auction.Id)) bids, err := k.GetBids(ctx, auction.Id) @@ -879,11 +879,9 @@ func (k Keeper) pickServiceProviderAuctionWinner(ctx sdk.Context, auction *aucti } } - // Process winner account (if nobody bids, there won't be a winner). + // Process winner accounts (if nobody bids, there won't be a winner). if len(winnerBids) > 0 { - winnerAddresses := make([]string, len(winnerBids)) - for i, bid := range winnerBids { - winnerAddresses[i] = bid.BidderAddress + for _, bid := range winnerBids { winnerAddress, err := sdk.AccAddressFromBech32(bid.BidderAddress) if err != nil { k.Logger(ctx).Error(fmt.Sprintf("Invalid winner address. %v", err)) @@ -891,35 +889,37 @@ func (k Keeper) pickServiceProviderAuctionWinner(ctx sdk.Context, auction *aucti } // Send winning price to bidders - sdkErrWinner := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctiontypes.ModuleName, winnerAddress, sdk.NewCoins(auction.WinningPrice)) - if sdkErrWinner != nil { - k.Logger(ctx).Error(fmt.Sprintf("Auction error sending funds to winner: %v", sdkErrWinner)) - panic(sdkErrWinner) + sdkErr := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctiontypes.ModuleName, winnerAddress, sdk.NewCoins(auction.WinningPrice)) + if sdkErr != nil { + k.Logger(ctx).Error(fmt.Sprintf("Auction error sending funds to winner: %v", sdkErr)) + panic(sdkErr) } // Send back extra amount to auction creator - totalMaxBidAmount := auction.MaxPrice.Amount.MulRaw(int64(auction.NumProviders)) + totalLockedAmount := auction.MaxPrice.Amount.Mul(math.NewInt(int64(auction.NumProviders))) totalAmountPaid := auction.WinningPrice.Amount.Mul(math.NewInt(int64(auction.NumProviders))) - extraAmountCoin := sdk.NewCoin(auction.MaxPrice.Denom, totalMaxBidAmount.Sub(totalAmountPaid)) + extraAmountCoin := sdk.NewCoin(auction.MaxPrice.Denom, totalLockedAmount.Sub(totalAmountPaid)) - sdkErrCreator := k.bankKeeper.SendCoinsFromModuleToAccount( + sdkErr = k.bankKeeper.SendCoinsFromModuleToAccount( ctx, auctiontypes.ModuleName, sdk.AccAddress(auction.OwnerAddress), sdk.NewCoins(extraAmountCoin), ) - if sdkErrCreator != nil { - k.Logger(ctx).Error(fmt.Sprintf("Auction error returning bid amount: %v", sdkErrCreator)) - panic(sdkErrCreator) + if sdkErr != nil { + k.Logger(ctx).Error(fmt.Sprintf("Auction error returning extra locked amount: %v", sdkErr)) + panic(sdkErr) } } } else { + totalLockedAmount := sdk.NewCoin(auction.MaxPrice.Denom, auction.MaxPrice.Amount.Mul(math.NewInt(int64(auction.NumProviders)))) + sdkErr := k.bankKeeper.SendCoinsFromModuleToAccount( ctx, auctiontypes.ModuleName, sdk.AccAddress(auction.OwnerAddress), - sdk.NewCoins(auction.MaxPrice)) + sdk.NewCoins(totalLockedAmount)) if sdkErr != nil { k.Logger(ctx).Error(fmt.Sprintf("Auction error returning bid amount: %v", sdkErr)) panic(sdkErr) diff --git a/x/auction/msgs.go b/x/auction/msgs.go index 22522a01..db8888ea 100644 --- a/x/auction/msgs.go +++ b/x/auction/msgs.go @@ -23,6 +23,7 @@ func NewMsgCreateAuction( revealFee sdk.Coin, minimumBid sdk.Coin, maxPrice sdk.Coin, + numProviders int32, kind string, signer sdk.AccAddress, ) MsgCreateAuction { @@ -35,6 +36,7 @@ func NewMsgCreateAuction( MinimumBid: minimumBid, MaxPrice: maxPrice, Kind: kind, + NumProviders: numProviders, Signer: signer.String(), } } diff --git a/x/auction/tx.pb.go b/x/auction/tx.pb.go index 14ef381c..d5217415 100644 --- a/x/auction/tx.pb.go +++ b/x/auction/tx.pb.go @@ -50,10 +50,10 @@ type MsgCreateAuction struct { MinimumBid types.Coin `protobuf:"bytes,5,opt,name=minimum_bid,json=minimumBid,proto3" json:"minimum_bid" json:"minimum_bid" yaml:"minimum_bid"` // Address of the signer Signer string `protobuf:"bytes,6,opt,name=signer,proto3" json:"signer,omitempty" json:"signer" yaml:"signer"` - // Maximum acceptable bid amount (for reverse auctions) - MaxPrice types.Coin `protobuf:"bytes,7,opt,name=max_price,json=maxPrice,proto3" json:"max_price" json:"max_price" yaml:"max_price"` - // Auction kind can be vickrey or service_provider - Kind string `protobuf:"bytes,8,opt,name=kind,proto3" json:"kind,omitempty" json:"kind" yaml:"kind"` + // Auction's kind (vickrey | service_provider) + Kind string `protobuf:"bytes,7,opt,name=kind,proto3" json:"kind,omitempty" json:"kind" yaml:"kind"` + // Maximum acceptable bid amount (for service provider auctions) + MaxPrice types.Coin `protobuf:"bytes,8,opt,name=max_price,json=maxPrice,proto3" json:"max_price" json:"max_price" yaml:"max_price"` // Number of providers to be selected NumProviders int32 `protobuf:"varint,9,opt,name=num_providers,json=numProviders,proto3" json:"num_providers,omitempty"` } @@ -431,40 +431,40 @@ var fileDescriptor_70947cda59e835fd = []byte{ 0x68, 0x28, 0x5a, 0x48, 0x68, 0x4a, 0x93, 0x5e, 0xd2, 0xee, 0xd0, 0xc8, 0x9a, 0xbf, 0x8c, 0x67, 0x17, 0x78, 0xb6, 0x14, 0x4f, 0x21, 0x57, 0x13, 0x15, 0x5d, 0x01, 0x02, 0xcb, 0xa7, 0x91, 0x79, 0x1f, 0xd5, 0x38, 0x8d, 0x53, 0x92, 0x59, 0xb5, 0x96, 0xb1, 0x5d, 0xf7, 0xed, 0xe1, 0xc0, 0x5e, - 0x53, 0x65, 0x94, 0x5f, 0x57, 0x00, 0x2b, 0x80, 0x70,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 0xdd, 0x9e, 0xfc, 0x4a, 0x6e, 0x4c, 0x71, 0x95, 0x0f, 0xbe, + 0xb1, 0x73, 0x69, 0x88, 0xe6, 0x71, 0xee, 0x3e, 0xfb, 0xed, 0xdf, 0x1f, 0x6f, 0x6c, 0x38, 0xb6, + 0x57, 0xfe, 0x60, 0x87, 0x32, 0xbe, 0x0d, 0x1e, 0xb3, 0x8f, 0xea, 0xe3, 0xdb, 0x5e, 0x9f, 0x49, + 0xa0, 0xe1, 0xc6, 0xd6, 0x1b, 0xe1, 0x11, 0xf7, 0xa6, 0xe4, 0x5e, 0x77, 0xd6, 0xa6, 0xb9, 0xd5, + 0x01, 0x77, 0x68, 0x24, 0x78, 0xc7, 0x37, 0x30, 0x93, 0x77, 0x04, 0xcf, 0xe6, 0x9d, 0x5a, 0xb3, + 0x37, 0xf0, 0xc2, 0x27, 0x4c, 0xf0, 0x3e, 0x46, 0x8b, 0x13, 0xab, 0xd2, 0x9a, 0x55, 0xbb, 0x18, + 0xd1, 0xd8, 0xbe, 0x2c, 0x42, 0x0b, 0x68, 0xcc, 0x7f, 0xfb, 0xfa, 0xc5, 0x3d, 0xc3, 0xff, 0xe4, + 0xe5, 0x79, 0xd3, 0x78, 0x75, 0xde, 0x34, 0xfe, 0x3e, 0x6f, 0x1a, 0xcf, 0x2f, 0x9a, 0x95, 0x57, + 0x17, 0xcd, 0xca, 0x1f, 0x17, 0xcd, 0xca, 0xe3, 0xad, 0x98, 0xe6, 0x6e, 0x3f, 0xea, 0xb8, 0xe2, + 0x6f, 0x15, 0xc9, 0xc2, 0x5d, 0xca, 0xbc, 0x53, 0x1c, 0xb2, 0x94, 0x86, 0x91, 0x77, 0xa6, 0x15, + 0x77, 0x6a, 0xf2, 0x9f, 0xc8, 0x07, 0xff, 0x07, 0x00, 0x00, 0xff, 0xff, 0x91, 0xdf, 0x04, 0x3d, 0x40, 0x0a, 0x00, 0x00, } @@ -691,13 +691,6 @@ func (m *MsgCreateAuction) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x48 } - if len(m.Kind) > 0 { - i -= len(m.Kind) - copy(dAtA[i:], m.Kind) - i = encodeVarintTx(dAtA, i, uint64(len(m.Kind))) - i-- - dAtA[i] = 0x42 - } { size, err := m.MaxPrice.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -707,7 +700,14 @@ func (m *MsgCreateAuction) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintTx(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x3a + dAtA[i] = 0x42 + if len(m.Kind) > 0 { + i -= len(m.Kind) + copy(dAtA[i:], m.Kind) + i = encodeVarintTx(dAtA, i, uint64(len(m.Kind))) + i-- + dAtA[i] = 0x3a + } if len(m.Signer) > 0 { i -= len(m.Signer) copy(dAtA[i:], m.Signer) @@ -1051,12 +1051,12 @@ func (m *MsgCreateAuction) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = m.MaxPrice.Size() - n += 1 + l + sovTx(uint64(l)) l = len(m.Kind) if l > 0 { n += 1 + l + sovTx(uint64(l)) } + l = m.MaxPrice.Size() + n += 1 + l + sovTx(uint64(l)) if m.NumProviders != 0 { n += 1 + sovTx(uint64(m.NumProviders)) } @@ -1401,6 +1401,38 @@ func (m *MsgCreateAuction) Unmarshal(dAtA []byte) error { m.Signer = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Kind = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field MaxPrice", wireType) } @@ -1433,38 +1465,6 @@ func (m *MsgCreateAuction) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Kind = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex case 9: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field NumProviders", wireType) diff --git a/x/registry/keeper/record_keeper.go b/x/registry/keeper/record_keeper.go index 0179fe2c..db197cf1 100644 --- a/x/registry/keeper/record_keeper.go +++ b/x/registry/keeper/record_keeper.go @@ -94,7 +94,7 @@ func (rk RecordKeeper) OnAuctionWinnerSelected(ctx sdk.Context, auctionId string } if auctionObj.Status == auctiontypes.AuctionStatusCompleted { - if len(auctionObj.WinnerAddresses) == 1 { + if len(auctionObj.WinnerAddresses) != 0 { // Mark authority owner and change status to active. authority.OwnerAddress = auctionObj.WinnerAddresses[0] authority.Status = registrytypes.AuthorityActive -- 2.45.2 From 9e3b2cc0dc21eae7bec90c51a7692c525ecfd267 Mon Sep 17 00:00:00 2001 From: IshaVenikar Date: Fri, 13 Sep 2024 16:12:52 +0530 Subject: [PATCH 09/29] Update create auction CLI --- gql/util.go | 6 +-- .../auction/keeper/query_server_test.go | 1 + x/auction/client/cli/tx.go | 7 +++- x/auction/keeper/keeper.go | 38 ++++++++++--------- x/registry/keeper/naming_keeper.go | 1 + 5 files changed, 32 insertions(+), 21 deletions(-) diff --git a/gql/util.go b/gql/util.go index f230f18e..3aa3d08b 100644 --- a/gql/util.go +++ b/gql/util.go @@ -233,9 +233,9 @@ func GetGQLAuction(auction *auctiontypes.Auction, bids []*auctiontypes.Bid) (*Au } winnerAddresses := make([]*string, len(auction.WinnerAddresses)) - for i := range auction.WinnerAddresses { - addr := auction.WinnerAddresses[i] - winnerAddresses[i] = &addr + for i, winnerAddress := range auction.WinnerAddresses { + address := winnerAddress + winnerAddresses[i] = &address } numProviders := int(auction.NumProviders) diff --git a/tests/integration/auction/keeper/query_server_test.go b/tests/integration/auction/keeper/query_server_test.go index 2980722d..1a8c8b53 100644 --- a/tests/integration/auction/keeper/query_server_test.go +++ b/tests/integration/auction/keeper/query_server_test.go @@ -341,6 +341,7 @@ func (kts *KeeperTestSuite) createAuctionAndCommitBid(commitBid bool) (*types.Au params.RevealFee, params.MinimumBid, sdk.Coin{}, + int32(1), types.AuctionKindVickrey, accounts[0], ), diff --git a/x/auction/client/cli/tx.go b/x/auction/client/cli/tx.go index a170b287..30423244 100644 --- a/x/auction/client/cli/tx.go +++ b/x/auction/client/cli/tx.go @@ -4,6 +4,7 @@ import ( "encoding/hex" "fmt" "os" + "strconv" "time" "github.com/cosmos/cosmos-sdk/client" @@ -173,7 +174,11 @@ func GetCmdCreateAuction() *cobra.Command { kind := args[6] - numProviders := args[7] + numProvidersInt, err := strconv.Atoi(args[7]) + if err != nil { + return fmt.Errorf("invalid num-providers value: %w", err) + } + numProviders := int32(numProvidersInt) msg := auctiontypes.NewMsgCreateAuction( commitsDuration, diff --git a/x/auction/keeper/keeper.go b/x/auction/keeper/keeper.go index 13498505..a884bfbe 100644 --- a/x/auction/keeper/keeper.go +++ b/x/auction/keeper/keeper.go @@ -531,7 +531,11 @@ func (k Keeper) RevealBid(ctx sdk.Context, msg auctiontypes.MsgRevealBid) (*auct return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Invalid reveal bid amount.") } - if bidAmount.IsLT(auction.MinimumBid) { + if auction.Kind == "vickrey" && bidAmount.IsLT(auction.MinimumBid) { + return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Bid is lower than minimum bid.") + } + + if auction.Kind == "service_provider" && bidAmount.IsGTE(auction.MaxPrice) { return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Bid is lower than minimum bid.") } @@ -708,8 +712,8 @@ func (k Keeper) pickAuctionWinner(ctx sdk.Context, auction *auctiontypes.Auction auction.Status = auctiontypes.AuctionStatusCompleted if highestBid != nil { - winnerAddresses := make([]string, 1) - auction.WinnerAddresses = winnerAddresses + auction.WinningBids = []sdk.Coin{highestBid.BidAmount} + auction.WinnerAddresses = []string{highestBid.BidderAddress} // Winner pays 2nd price, if a 2nd price exists. auction.WinningPrice = highestBid.BidAmount if secondHighestBid != nil { @@ -895,22 +899,22 @@ func (k Keeper) pickServiceProviderAuctionWinners(ctx sdk.Context, auction *auct panic(sdkErr) } - // Send back extra amount to auction creator - totalLockedAmount := auction.MaxPrice.Amount.Mul(math.NewInt(int64(auction.NumProviders))) - totalAmountPaid := auction.WinningPrice.Amount.Mul(math.NewInt(int64(auction.NumProviders))) + } + // Send back extra amount to auction creator + totalLockedAmount := auction.MaxPrice.Amount.Mul(math.NewInt(int64(auction.NumProviders))) + totalAmountPaid := auction.WinningPrice.Amount.Mul(math.NewInt(int64(auction.NumProviders))) - extraAmountCoin := sdk.NewCoin(auction.MaxPrice.Denom, totalLockedAmount.Sub(totalAmountPaid)) + extraAmountCoin := sdk.NewCoin(auction.MaxPrice.Denom, totalLockedAmount.Sub(totalAmountPaid)) - sdkErr = k.bankKeeper.SendCoinsFromModuleToAccount( - ctx, - auctiontypes.ModuleName, - sdk.AccAddress(auction.OwnerAddress), - sdk.NewCoins(extraAmountCoin), - ) - if sdkErr != nil { - k.Logger(ctx).Error(fmt.Sprintf("Auction error returning extra locked amount: %v", sdkErr)) - panic(sdkErr) - } + sdkErr := k.bankKeeper.SendCoinsFromModuleToAccount( + ctx, + auctiontypes.ModuleName, + sdk.AccAddress(auction.OwnerAddress), + sdk.NewCoins(extraAmountCoin), + ) + if sdkErr != nil { + k.Logger(ctx).Error(fmt.Sprintf("Auction error returning extra locked amount: %v", sdkErr)) + panic(sdkErr) } } else { totalLockedAmount := sdk.NewCoin(auction.MaxPrice.Denom, auction.MaxPrice.Amount.Mul(math.NewInt(int64(auction.NumProviders)))) diff --git a/x/registry/keeper/naming_keeper.go b/x/registry/keeper/naming_keeper.go index d0c9c7ca..4358d5ec 100644 --- a/x/registry/keeper/naming_keeper.go +++ b/x/registry/keeper/naming_keeper.go @@ -295,6 +295,7 @@ func (k Keeper) createAuthority(ctx sdk.Context, name string, owner string, isRo moduleParams.AuthorityAuctionRevealFee, moduleParams.AuthorityAuctionMinimumBid, sdk.NewCoin("alnt", math.NewInt(0)), + int32(1), auctiontypes.AuctionKindVickrey, ownerAddress, ) -- 2.45.2 From fd4fd0b2ca0030ddccce649adb084a43c5d7c437 Mon Sep 17 00:00:00 2001 From: IshaVenikar Date: Tue, 17 Sep 2024 12:48:48 +0530 Subject: [PATCH 10/29] Modify provider auction name --- api/cerc/auction/v1/auction.pulsar.go | 4 ++-- api/cerc/auction/v1/tx.pulsar.go | 2 +- proto/cerc/auction/v1/auction.proto | 6 +++--- proto/cerc/auction/v1/tx.proto | 2 +- x/auction/auction.pb.go | 4 ++-- x/auction/keeper/keeper.go | 21 ++++++++++----------- x/auction/msgs.go | 2 +- x/auction/tx.pb.go | 2 +- x/auction/types.go | 4 ++-- 9 files changed, 23 insertions(+), 24 deletions(-) diff --git a/api/cerc/auction/v1/auction.pulsar.go b/api/cerc/auction/v1/auction.pulsar.go index 43b54561..d18f396d 100644 --- a/api/cerc/auction/v1/auction.pulsar.go +++ b/api/cerc/auction/v1/auction.pulsar.go @@ -3915,7 +3915,7 @@ type Auction struct { unknownFields protoimpl.UnknownFields Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // Auction's kind (vickrey | service_provider) + // Auction's kind (vickrey | provider) Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty"` Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` // Address of the creator of the auction @@ -3932,7 +3932,7 @@ type Auction struct { RevealFee *v1beta1.Coin `protobuf:"bytes,9,opt,name=reveal_fee,json=revealFee,proto3" json:"reveal_fee,omitempty"` // Minimum acceptable bid amount for a valid commit MinimumBid *v1beta1.Coin `protobuf:"bytes,10,opt,name=minimum_bid,json=minimumBid,proto3" json:"minimum_bid,omitempty"` - // Addresses of the winners (one for vickrey and can be multiple for service_provider) + // Addresses of the winners (one for vickrey auctions and can be multiple for provider auctions) WinnerAddresses []string `protobuf:"bytes,11,rep,name=winner_addresses,json=winnerAddresses,proto3" json:"winner_addresses,omitempty"` // Winning bids, i.e., the best bids WinningBids []*v1beta1.Coin `protobuf:"bytes,12,rep,name=winning_bids,json=winningBids,proto3" json:"winning_bids,omitempty"` diff --git a/api/cerc/auction/v1/tx.pulsar.go b/api/cerc/auction/v1/tx.pulsar.go index 0d4bb11e..9db13ab4 100644 --- a/api/cerc/auction/v1/tx.pulsar.go +++ b/api/cerc/auction/v1/tx.pulsar.go @@ -4311,7 +4311,7 @@ type MsgCreateAuction struct { MinimumBid *v1beta1.Coin `protobuf:"bytes,5,opt,name=minimum_bid,json=minimumBid,proto3" json:"minimum_bid,omitempty"` // Address of the signer Signer string `protobuf:"bytes,6,opt,name=signer,proto3" json:"signer,omitempty"` - // Auction's kind (vickrey | service_provider) + // Auction's kind (vickrey | provider) Kind string `protobuf:"bytes,7,opt,name=kind,proto3" json:"kind,omitempty"` // Maximum acceptable bid amount (for service provider auctions) MaxPrice *v1beta1.Coin `protobuf:"bytes,8,opt,name=max_price,json=maxPrice,proto3" json:"max_price,omitempty"` diff --git a/proto/cerc/auction/v1/auction.proto b/proto/cerc/auction/v1/auction.proto index 7de86476..c4ad059a 100644 --- a/proto/cerc/auction/v1/auction.proto +++ b/proto/cerc/auction/v1/auction.proto @@ -53,7 +53,7 @@ message Auction { string id = 1; - // Auction's kind (vickrey | service_provider) + // Auction's kind (vickrey | provider) string kind = 2 [ (gogoproto.moretags) = "json:\"kind\" yaml:\"kind\"" ]; @@ -101,7 +101,7 @@ message Auction { (gogoproto.moretags) = "json:\"minimum_bid\" yaml:\"minimum_bid\"" ]; - // Addresses of the winners (one for vickrey and can be multiple for service_provider) + // Addresses of the winners (one for vickrey auctions and can be multiple for provider auctions) repeated string winner_addresses = 11; // Winning bids, i.e., the best bids @@ -110,7 +110,7 @@ message Auction { (gogoproto.moretags) = "json:\"winning_bids\" yaml:\"winning_bids\"" ]; - // Amount the winner pays, i.e. the second best bid + // Amount the winner pays (vickrey auction) or gets paid (provider auction), i.e. the second best bid cosmos.base.v1beta1.Coin winning_price = 13 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"winning_price\" yaml:\"winning_price\"" diff --git a/proto/cerc/auction/v1/tx.proto b/proto/cerc/auction/v1/tx.proto index ec02f771..b4545513 100644 --- a/proto/cerc/auction/v1/tx.proto +++ b/proto/cerc/auction/v1/tx.proto @@ -77,7 +77,7 @@ message MsgCreateAuction { string signer = 6 [ (gogoproto.moretags) = "json:\"signer\" yaml:\"signer\"" ]; - // Auction's kind (vickrey | service_provider) + // Auction's kind (vickrey | provider) string kind = 7 [ (gogoproto.moretags) = "json:\"kind\" yaml:\"kind\"" ]; diff --git a/x/auction/auction.pb.go b/x/auction/auction.pb.go index 5f93c3c5..fc50802a 100644 --- a/x/auction/auction.pb.go +++ b/x/auction/auction.pb.go @@ -113,7 +113,7 @@ func (m *Params) GetMinimumBid() types.Coin { // Auction represents a sealed-bid on-chain auction type Auction struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // Auction's kind (vickrey | service_provider) + // Auction's kind (vickrey | provider) Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty" json:"kind" yaml:"kind"` Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` // Address of the creator of the auction @@ -130,7 +130,7 @@ type Auction struct { RevealFee types.Coin `protobuf:"bytes,9,opt,name=reveal_fee,json=revealFee,proto3" json:"reveal_fee" json:"reveal_fee" yaml:"reveal_fee"` // Minimum acceptable bid amount for a valid commit MinimumBid types.Coin `protobuf:"bytes,10,opt,name=minimum_bid,json=minimumBid,proto3" json:"minimum_bid" json:"minimum_bid" yaml:"minimum_bid"` - // Addresses of the winners (one for vickrey and can be multiple for service_provider) + // Addresses of the winners (one for vickrey auctions and can be multiple for provider auctions) WinnerAddresses []string `protobuf:"bytes,11,rep,name=winner_addresses,json=winnerAddresses,proto3" json:"winner_addresses,omitempty"` // Winning bids, i.e., the best bids WinningBids []types.Coin `protobuf:"bytes,12,rep,name=winning_bids,json=winningBids,proto3" json:"winning_bids" json:"winning_bids" yaml:"winning_bids"` diff --git a/x/auction/keeper/keeper.go b/x/auction/keeper/keeper.go index a884bfbe..dfd0ecec 100644 --- a/x/auction/keeper/keeper.go +++ b/x/auction/keeper/keeper.go @@ -341,12 +341,12 @@ func (k Keeper) CreateAuction(ctx sdk.Context, msg auctiontypes.MsgCreateAuction commitsEndTime := now.Add(msg.CommitsDuration) revealsEndTime := now.Add(msg.CommitsDuration + msg.RevealsDuration) - if msg.Kind == auctiontypes.AuctionKindServiceProvider { + if msg.Kind == auctiontypes.AuctionKindProvider { totalLockedAmount := sdk.NewCoin(msg.MaxPrice.Denom, msg.MaxPrice.Amount.MulRaw(int64(msg.NumProviders))) sdkErr := k.bankKeeper.SendCoinsFromAccountToModule(ctx, signerAddress, auctiontypes.ModuleName, sdk.NewCoins(totalLockedAmount)) if sdkErr != nil { - k.Logger(ctx).Error(fmt.Sprintf("Auction error transferring maximum_bid amount: %v", sdkErr)) + k.Logger(ctx).Error(fmt.Sprintf("Auction error transferring maximum price amount: %v", sdkErr)) panic(sdkErr) } } @@ -531,12 +531,12 @@ func (k Keeper) RevealBid(ctx sdk.Context, msg auctiontypes.MsgRevealBid) (*auct return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Invalid reveal bid amount.") } - if auction.Kind == "vickrey" && bidAmount.IsLT(auction.MinimumBid) { + if auction.Kind == auctiontypes.AuctionKindVickrey && bidAmount.IsLT(auction.MinimumBid) { return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Bid is lower than minimum bid.") } - if auction.Kind == "service_provider" && bidAmount.IsGTE(auction.MaxPrice) { - return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Bid is lower than minimum bid.") + if auction.Kind == auctiontypes.AuctionKindProvider && bidAmount.IsGTE(auction.MaxPrice) { + return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Bid is higher than maximum price.") } // Lock bid amount. @@ -630,7 +630,7 @@ func (k Keeper) processAuctionPhases(ctx sdk.Context) error { return err } } else { - if err = k.pickServiceProviderAuctionWinners(ctx, auction); err != nil { + if err = k.pickProviderAuctionWinners(ctx, auction); err != nil { return err } } @@ -754,8 +754,8 @@ func (k Keeper) pickAuctionWinner(ctx sdk.Context, auction *auctiontypes.Auction } } - // Process winner accounts (if nobody bids, there won't be a winner). - if len(auction.WinnerAddresses) == 0 { + // Process winner account (if nobody bids, there won't be a winner). + if len(auction.WinnerAddresses) == 1 { winnerAddress, err := sdk.AccAddressFromBech32(auction.WinnerAddresses[0]) if err != nil { k.Logger(ctx).Error(fmt.Sprintf("Invalid winner address. %v", err)) @@ -799,8 +799,8 @@ func (k Keeper) pickAuctionWinner(ctx sdk.Context, auction *auctiontypes.Auction return nil } -// Pick winner for service_provider auction -func (k Keeper) pickServiceProviderAuctionWinners(ctx sdk.Context, auction *auctiontypes.Auction) error { +// Pick winner for provider auction +func (k Keeper) pickProviderAuctionWinners(ctx sdk.Context, auction *auctiontypes.Auction) error { k.Logger(ctx).Info(fmt.Sprintf("Picking auction %s winners.", auction.Id)) bids, err := k.GetBids(ctx, auction.Id) @@ -848,7 +848,6 @@ func (k Keeper) pickServiceProviderAuctionWinners(ctx sdk.Context, auction *auct } auction.WinnerAddresses = winnerAddresses auction.WinningBids = winningBids - auction.WinningPrice = winnerBids[0].BidAmount if len(winnerBids) > 0 { // The last best bid is the winning price diff --git a/x/auction/msgs.go b/x/auction/msgs.go index db8888ea..2ed0cc69 100644 --- a/x/auction/msgs.go +++ b/x/auction/msgs.go @@ -68,7 +68,7 @@ func (msg MsgCreateAuction) ValidateBasic() error { return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "minimum bid should be greater than zero.") } - if msg.Kind == AuctionKindServiceProvider && !msg.MaxPrice.IsPositive() { + if msg.Kind == AuctionKindProvider && !msg.MaxPrice.IsPositive() { return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "maximum price should be greater than zero.") } diff --git a/x/auction/tx.pb.go b/x/auction/tx.pb.go index d5217415..d7df6dda 100644 --- a/x/auction/tx.pb.go +++ b/x/auction/tx.pb.go @@ -50,7 +50,7 @@ type MsgCreateAuction struct { MinimumBid types.Coin `protobuf:"bytes,5,opt,name=minimum_bid,json=minimumBid,proto3" json:"minimum_bid" json:"minimum_bid" yaml:"minimum_bid"` // Address of the signer Signer string `protobuf:"bytes,6,opt,name=signer,proto3" json:"signer,omitempty" json:"signer" yaml:"signer"` - // Auction's kind (vickrey | service_provider) + // Auction's kind (vickrey | provider) Kind string `protobuf:"bytes,7,opt,name=kind,proto3" json:"kind,omitempty" json:"kind" yaml:"kind"` // Maximum acceptable bid amount (for service provider auctions) MaxPrice types.Coin `protobuf:"bytes,8,opt,name=max_price,json=maxPrice,proto3" json:"max_price" json:"max_price" yaml:"max_price"` diff --git a/x/auction/types.go b/x/auction/types.go index 02ac8b38..266f0c32 100644 --- a/x/auction/types.go +++ b/x/auction/types.go @@ -31,8 +31,8 @@ const ( // Auction kinds const ( - AuctionKindVickrey = "vickrey" - AuctionKindServiceProvider = "service_provider" + AuctionKindVickrey = "vickrey" + AuctionKindProvider = "provider" ) // AuctionId simplifies generation of auction ids. -- 2.45.2 From 9c29f694daecce8d1d932ecd750f6df5effec094 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Wed, 18 Sep 2024 11:56:00 +0530 Subject: [PATCH 11/29] Regenerate proto bindings --- api/cerc/auction/v1/auction.pulsar.go | 9 ++++++--- proto/cerc/auction/v1/auction.proto | 13 +++++++------ proto/cerc/auction/v1/tx.proto | 4 +--- x/auction/auction.pb.go | 9 ++++++--- 4 files changed, 20 insertions(+), 15 deletions(-) diff --git a/api/cerc/auction/v1/auction.pulsar.go b/api/cerc/auction/v1/auction.pulsar.go index d18f396d..4a0c3538 100644 --- a/api/cerc/auction/v1/auction.pulsar.go +++ b/api/cerc/auction/v1/auction.pulsar.go @@ -3932,13 +3932,16 @@ type Auction struct { RevealFee *v1beta1.Coin `protobuf:"bytes,9,opt,name=reveal_fee,json=revealFee,proto3" json:"reveal_fee,omitempty"` // Minimum acceptable bid amount for a valid commit MinimumBid *v1beta1.Coin `protobuf:"bytes,10,opt,name=minimum_bid,json=minimumBid,proto3" json:"minimum_bid,omitempty"` - // Addresses of the winners (one for vickrey auctions and can be multiple for provider auctions) + // Addresses of the winners (one for vickrey auctions and can be multiple for + // provider auctions) WinnerAddresses []string `protobuf:"bytes,11,rep,name=winner_addresses,json=winnerAddresses,proto3" json:"winner_addresses,omitempty"` // Winning bids, i.e., the best bids WinningBids []*v1beta1.Coin `protobuf:"bytes,12,rep,name=winning_bids,json=winningBids,proto3" json:"winning_bids,omitempty"` - // Amount the winner pays, i.e. the second best bid + // Amount the winner pays (vickrey auction) or gets paid (provider auction), + // i.e. the second best bid WinningPrice *v1beta1.Coin `protobuf:"bytes,13,opt,name=winning_price,json=winningPrice,proto3" json:"winning_price,omitempty"` - // Maximum acceptable bid amount for a valid commit for service provider auctions + // Maximum acceptable bid amount for a valid commit for service provider + // auctions MaxPrice *v1beta1.Coin `protobuf:"bytes,14,opt,name=max_price,json=maxPrice,proto3" json:"max_price,omitempty"` // Number of providers to be selected NumProviders int32 `protobuf:"varint,15,opt,name=num_providers,json=numProviders,proto3" json:"num_providers,omitempty"` diff --git a/proto/cerc/auction/v1/auction.proto b/proto/cerc/auction/v1/auction.proto index c4ad059a..3379fed9 100644 --- a/proto/cerc/auction/v1/auction.proto +++ b/proto/cerc/auction/v1/auction.proto @@ -54,9 +54,7 @@ message Auction { string id = 1; // Auction's kind (vickrey | provider) - string kind = 2 [ - (gogoproto.moretags) = "json:\"kind\" yaml:\"kind\"" - ]; + string kind = 2 [ (gogoproto.moretags) = "json:\"kind\" yaml:\"kind\"" ]; string status = 3; @@ -101,7 +99,8 @@ message Auction { (gogoproto.moretags) = "json:\"minimum_bid\" yaml:\"minimum_bid\"" ]; - // Addresses of the winners (one for vickrey auctions and can be multiple for provider auctions) + // Addresses of the winners (one for vickrey auctions and can be multiple for + // provider auctions) repeated string winner_addresses = 11; // Winning bids, i.e., the best bids @@ -110,13 +109,15 @@ message Auction { (gogoproto.moretags) = "json:\"winning_bids\" yaml:\"winning_bids\"" ]; - // Amount the winner pays (vickrey auction) or gets paid (provider auction), i.e. the second best bid + // Amount the winner pays (vickrey auction) or gets paid (provider auction), + // i.e. the second best bid cosmos.base.v1beta1.Coin winning_price = 13 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"winning_price\" yaml:\"winning_price\"" ]; - // Maximum acceptable bid amount for a valid commit for service provider auctions + // Maximum acceptable bid amount for a valid commit for service provider + // auctions cosmos.base.v1beta1.Coin max_price = 14 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"max_price\" yaml:\"max_price\"" diff --git a/proto/cerc/auction/v1/tx.proto b/proto/cerc/auction/v1/tx.proto index b4545513..2349a7c6 100644 --- a/proto/cerc/auction/v1/tx.proto +++ b/proto/cerc/auction/v1/tx.proto @@ -78,9 +78,7 @@ message MsgCreateAuction { [ (gogoproto.moretags) = "json:\"signer\" yaml:\"signer\"" ]; // Auction's kind (vickrey | provider) - string kind = 7 [ - (gogoproto.moretags) = "json:\"kind\" yaml:\"kind\"" - ]; + string kind = 7 [ (gogoproto.moretags) = "json:\"kind\" yaml:\"kind\"" ]; // Maximum acceptable bid amount (for service provider auctions) cosmos.base.v1beta1.Coin max_price = 8 [ diff --git a/x/auction/auction.pb.go b/x/auction/auction.pb.go index fc50802a..619052f1 100644 --- a/x/auction/auction.pb.go +++ b/x/auction/auction.pb.go @@ -130,13 +130,16 @@ type Auction struct { RevealFee types.Coin `protobuf:"bytes,9,opt,name=reveal_fee,json=revealFee,proto3" json:"reveal_fee" json:"reveal_fee" yaml:"reveal_fee"` // Minimum acceptable bid amount for a valid commit MinimumBid types.Coin `protobuf:"bytes,10,opt,name=minimum_bid,json=minimumBid,proto3" json:"minimum_bid" json:"minimum_bid" yaml:"minimum_bid"` - // Addresses of the winners (one for vickrey auctions and can be multiple for provider auctions) + // Addresses of the winners (one for vickrey auctions and can be multiple for + // provider auctions) WinnerAddresses []string `protobuf:"bytes,11,rep,name=winner_addresses,json=winnerAddresses,proto3" json:"winner_addresses,omitempty"` // Winning bids, i.e., the best bids WinningBids []types.Coin `protobuf:"bytes,12,rep,name=winning_bids,json=winningBids,proto3" json:"winning_bids" json:"winning_bids" yaml:"winning_bids"` - // Amount the winner pays, i.e. the second best bid + // Amount the winner pays (vickrey auction) or gets paid (provider auction), + // i.e. the second best bid WinningPrice types.Coin `protobuf:"bytes,13,opt,name=winning_price,json=winningPrice,proto3" json:"winning_price" json:"winning_price" yaml:"winning_price"` - // Maximum acceptable bid amount for a valid commit for service provider auctions + // Maximum acceptable bid amount for a valid commit for service provider + // auctions MaxPrice types.Coin `protobuf:"bytes,14,opt,name=max_price,json=maxPrice,proto3" json:"max_price" json:"max_price" yaml:"max_price"` // Number of providers to be selected NumProviders int32 `protobuf:"varint,15,opt,name=num_providers,json=numProviders,proto3" json:"num_providers,omitempty"` -- 2.45.2 From d44df364450270aa64fe09730f5e2f1ae361c591 Mon Sep 17 00:00:00 2001 From: Isha Venikar Date: Wed, 18 Sep 2024 15:11:38 +0530 Subject: [PATCH 12/29] Modify comments in proto files --- proto/cerc/auction/v1/auction.proto | 13 +++++-------- proto/cerc/auction/v1/tx.proto | 4 ++-- x/auction/keeper/keeper.go | 7 +++---- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/proto/cerc/auction/v1/auction.proto b/proto/cerc/auction/v1/auction.proto index 3379fed9..8f2b74ec 100644 --- a/proto/cerc/auction/v1/auction.proto +++ b/proto/cerc/auction/v1/auction.proto @@ -40,7 +40,7 @@ message Params { (gogoproto.moretags) = "json:\"reveal_fee\" yaml:\"reveal_fee\"" ]; - // Minimum acceptable bid amount + // Minimum acceptable bid amount (for vickrey auctions) cosmos.base.v1beta1.Coin minimum_bid = 5 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"minimum_bid\" yaml:\"minimum_bid\"" @@ -93,14 +93,13 @@ message Auction { (gogoproto.moretags) = "json:\"reveal_fee\" yaml:\"reveal_fee\"" ]; - // Minimum acceptable bid amount for a valid commit + // Minimum acceptable bid amount for a valid commit (for vickrey auctions) cosmos.base.v1beta1.Coin minimum_bid = 10 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"minimum_bid\" yaml:\"minimum_bid\"" ]; - // Addresses of the winners (one for vickrey auctions and can be multiple for - // provider auctions) + // Winner's address for Vickrey auctions, can be multiple for provider auctions repeated string winner_addresses = 11; // Winning bids, i.e., the best bids @@ -109,15 +108,13 @@ message Auction { (gogoproto.moretags) = "json:\"winning_bids\" yaml:\"winning_bids\"" ]; - // Amount the winner pays (vickrey auction) or gets paid (provider auction), - // i.e. the second best bid + // Amount the winner pays (vickrey auction) or is paid (provider auction) cosmos.base.v1beta1.Coin winning_price = 13 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"winning_price\" yaml:\"winning_price\"" ]; - // Maximum acceptable bid amount for a valid commit for service provider - // auctions + // Maximum acceptable bid amount (for provider auctions) cosmos.base.v1beta1.Coin max_price = 14 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"max_price\" yaml:\"max_price\"" diff --git a/proto/cerc/auction/v1/tx.proto b/proto/cerc/auction/v1/tx.proto index 2349a7c6..a1054d7f 100644 --- a/proto/cerc/auction/v1/tx.proto +++ b/proto/cerc/auction/v1/tx.proto @@ -67,7 +67,7 @@ message MsgCreateAuction { (gogoproto.moretags) = "json:\"reveal_fee\" yaml:\"reveal_fee\"" ]; - // Minimum acceptable bid amount + // Minimum acceptable bid amount (for vickrey auctions) cosmos.base.v1beta1.Coin minimum_bid = 5 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"minimum_bid\" yaml:\"minimum_bid\"" @@ -80,7 +80,7 @@ message MsgCreateAuction { // Auction's kind (vickrey | provider) string kind = 7 [ (gogoproto.moretags) = "json:\"kind\" yaml:\"kind\"" ]; - // Maximum acceptable bid amount (for service provider auctions) + // Maximum acceptable bid amount (for provider auctions) cosmos.base.v1beta1.Coin max_price = 8 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"max_price\" yaml:\"max_price\"" diff --git a/x/auction/keeper/keeper.go b/x/auction/keeper/keeper.go index dfd0ecec..543787a5 100644 --- a/x/auction/keeper/keeper.go +++ b/x/auction/keeper/keeper.go @@ -849,10 +849,9 @@ func (k Keeper) pickProviderAuctionWinners(ctx sdk.Context, auction *auctiontype auction.WinnerAddresses = winnerAddresses auction.WinningBids = winningBids - if len(winnerBids) > 0 { - // The last best bid is the winning price - auction.WinningPrice = winnerBids[len(winnerBids)-1].BidAmount - } + // The last best bid is the winning price + auction.WinningPrice = winnerBids[len(winnerBids)-1].BidAmount + for _, bid := range winnerBids { k.Logger(ctx).Info(fmt.Sprintf("Auction %s winner address: %s, bid amount: %s.", auction.Id, bid.BidderAddress, bid.BidAmount.String())) } -- 2.45.2 From 7bc108fd7f7e123c9b9e9e118a49e60ee1841a9f Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Wed, 18 Sep 2024 11:52:45 +0530 Subject: [PATCH 13/29] Update auction creator refund amount calculation --- api/cerc/auction/v1/auction.pulsar.go | 24 +- api/cerc/auction/v1/tx.pulsar.go | 413 +++++++++++++------------- proto/cerc/auction/v1/auction.proto | 25 +- proto/cerc/auction/v1/tx.proto | 33 +- x/auction/auction.pb.go | 24 +- x/auction/keeper/keeper.go | 33 +- x/auction/tx.pb.go | 347 +++++++++++----------- 7 files changed, 465 insertions(+), 434 deletions(-) diff --git a/api/cerc/auction/v1/auction.pulsar.go b/api/cerc/auction/v1/auction.pulsar.go index 4a0c3538..74085a45 100644 --- a/api/cerc/auction/v1/auction.pulsar.go +++ b/api/cerc/auction/v1/auction.pulsar.go @@ -3850,6 +3850,7 @@ type Params struct { // Reveal fees RevealFee *v1beta1.Coin `protobuf:"bytes,4,opt,name=reveal_fee,json=revealFee,proto3" json:"reveal_fee,omitempty"` // Minimum acceptable bid amount + // Only applicable in vickrey auctions MinimumBid *v1beta1.Coin `protobuf:"bytes,5,opt,name=minimum_bid,json=minimumBid,proto3" json:"minimum_bid,omitempty"` } @@ -3915,7 +3916,7 @@ type Auction struct { unknownFields protoimpl.UnknownFields Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // Auction's kind (vickrey | provider) + // Auction kind (vickrey | provider) Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty"` Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` // Address of the creator of the auction @@ -3931,19 +3932,24 @@ type Auction struct { CommitFee *v1beta1.Coin `protobuf:"bytes,8,opt,name=commit_fee,json=commitFee,proto3" json:"commit_fee,omitempty"` RevealFee *v1beta1.Coin `protobuf:"bytes,9,opt,name=reveal_fee,json=revealFee,proto3" json:"reveal_fee,omitempty"` // Minimum acceptable bid amount for a valid commit + // Only applicable in vickrey auctions MinimumBid *v1beta1.Coin `protobuf:"bytes,10,opt,name=minimum_bid,json=minimumBid,proto3" json:"minimum_bid,omitempty"` - // Addresses of the winners (one for vickrey auctions and can be multiple for - // provider auctions) + // Addresses of the winners + // (single winner for vickrey auction) + // (multiple winners for provider auctions) WinnerAddresses []string `protobuf:"bytes,11,rep,name=winner_addresses,json=winnerAddresses,proto3" json:"winner_addresses,omitempty"` - // Winning bids, i.e., the best bids + // Winning bids, i.e. the best bids WinningBids []*v1beta1.Coin `protobuf:"bytes,12,rep,name=winning_bids,json=winningBids,proto3" json:"winning_bids,omitempty"` - // Amount the winner pays (vickrey auction) or gets paid (provider auction), - // i.e. the second best bid + // Auction winning price + // vickrey auction: second highest bid, paid by the winner + // provider auction: higest bid amongst winning_bids, paid by auction creator + // to each winner WinningPrice *v1beta1.Coin `protobuf:"bytes,13,opt,name=winning_price,json=winningPrice,proto3" json:"winning_price,omitempty"` - // Maximum acceptable bid amount for a valid commit for service provider - // auctions + // Maximum acceptable bid amount for a valid commit + // Only applicable in provider auctions MaxPrice *v1beta1.Coin `protobuf:"bytes,14,opt,name=max_price,json=maxPrice,proto3" json:"max_price,omitempty"` - // Number of providers to be selected + // Number of desired providers (num of auction winners) + // Only applicable in provider auctions NumProviders int32 `protobuf:"varint,15,opt,name=num_providers,json=numProviders,proto3" json:"num_providers,omitempty"` } diff --git a/api/cerc/auction/v1/tx.pulsar.go b/api/cerc/auction/v1/tx.pulsar.go index 9db13ab4..e7ac7275 100644 --- a/api/cerc/auction/v1/tx.pulsar.go +++ b/api/cerc/auction/v1/tx.pulsar.go @@ -20,13 +20,13 @@ import ( var ( md_MsgCreateAuction protoreflect.MessageDescriptor + fd_MsgCreateAuction_signer protoreflect.FieldDescriptor + fd_MsgCreateAuction_kind protoreflect.FieldDescriptor fd_MsgCreateAuction_commits_duration protoreflect.FieldDescriptor fd_MsgCreateAuction_reveals_duration protoreflect.FieldDescriptor fd_MsgCreateAuction_commit_fee protoreflect.FieldDescriptor fd_MsgCreateAuction_reveal_fee protoreflect.FieldDescriptor fd_MsgCreateAuction_minimum_bid protoreflect.FieldDescriptor - fd_MsgCreateAuction_signer protoreflect.FieldDescriptor - fd_MsgCreateAuction_kind protoreflect.FieldDescriptor fd_MsgCreateAuction_max_price protoreflect.FieldDescriptor fd_MsgCreateAuction_num_providers protoreflect.FieldDescriptor ) @@ -34,13 +34,13 @@ var ( func init() { file_cerc_auction_v1_tx_proto_init() md_MsgCreateAuction = File_cerc_auction_v1_tx_proto.Messages().ByName("MsgCreateAuction") + fd_MsgCreateAuction_signer = md_MsgCreateAuction.Fields().ByName("signer") + fd_MsgCreateAuction_kind = md_MsgCreateAuction.Fields().ByName("kind") fd_MsgCreateAuction_commits_duration = md_MsgCreateAuction.Fields().ByName("commits_duration") fd_MsgCreateAuction_reveals_duration = md_MsgCreateAuction.Fields().ByName("reveals_duration") fd_MsgCreateAuction_commit_fee = md_MsgCreateAuction.Fields().ByName("commit_fee") fd_MsgCreateAuction_reveal_fee = md_MsgCreateAuction.Fields().ByName("reveal_fee") fd_MsgCreateAuction_minimum_bid = md_MsgCreateAuction.Fields().ByName("minimum_bid") - fd_MsgCreateAuction_signer = md_MsgCreateAuction.Fields().ByName("signer") - fd_MsgCreateAuction_kind = md_MsgCreateAuction.Fields().ByName("kind") fd_MsgCreateAuction_max_price = md_MsgCreateAuction.Fields().ByName("max_price") fd_MsgCreateAuction_num_providers = md_MsgCreateAuction.Fields().ByName("num_providers") } @@ -110,6 +110,18 @@ func (x *fastReflection_MsgCreateAuction) Interface() protoreflect.ProtoMessage // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_MsgCreateAuction) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Signer != "" { + value := protoreflect.ValueOfString(x.Signer) + if !f(fd_MsgCreateAuction_signer, value) { + return + } + } + if x.Kind != "" { + value := protoreflect.ValueOfString(x.Kind) + if !f(fd_MsgCreateAuction_kind, value) { + return + } + } if x.CommitsDuration != nil { value := protoreflect.ValueOfMessage(x.CommitsDuration.ProtoReflect()) if !f(fd_MsgCreateAuction_commits_duration, value) { @@ -140,18 +152,6 @@ func (x *fastReflection_MsgCreateAuction) Range(f func(protoreflect.FieldDescrip return } } - if x.Signer != "" { - value := protoreflect.ValueOfString(x.Signer) - if !f(fd_MsgCreateAuction_signer, value) { - return - } - } - if x.Kind != "" { - value := protoreflect.ValueOfString(x.Kind) - if !f(fd_MsgCreateAuction_kind, value) { - return - } - } if x.MaxPrice != nil { value := protoreflect.ValueOfMessage(x.MaxPrice.ProtoReflect()) if !f(fd_MsgCreateAuction_max_price, value) { @@ -179,6 +179,10 @@ func (x *fastReflection_MsgCreateAuction) Range(f func(protoreflect.FieldDescrip // a repeated field is populated if it is non-empty. func (x *fastReflection_MsgCreateAuction) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { + case "cerc.auction.v1.MsgCreateAuction.signer": + return x.Signer != "" + case "cerc.auction.v1.MsgCreateAuction.kind": + return x.Kind != "" case "cerc.auction.v1.MsgCreateAuction.commits_duration": return x.CommitsDuration != nil case "cerc.auction.v1.MsgCreateAuction.reveals_duration": @@ -189,10 +193,6 @@ func (x *fastReflection_MsgCreateAuction) Has(fd protoreflect.FieldDescriptor) b return x.RevealFee != nil case "cerc.auction.v1.MsgCreateAuction.minimum_bid": return x.MinimumBid != nil - case "cerc.auction.v1.MsgCreateAuction.signer": - return x.Signer != "" - case "cerc.auction.v1.MsgCreateAuction.kind": - return x.Kind != "" case "cerc.auction.v1.MsgCreateAuction.max_price": return x.MaxPrice != nil case "cerc.auction.v1.MsgCreateAuction.num_providers": @@ -213,6 +213,10 @@ func (x *fastReflection_MsgCreateAuction) Has(fd protoreflect.FieldDescriptor) b // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgCreateAuction) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { + case "cerc.auction.v1.MsgCreateAuction.signer": + x.Signer = "" + case "cerc.auction.v1.MsgCreateAuction.kind": + x.Kind = "" case "cerc.auction.v1.MsgCreateAuction.commits_duration": x.CommitsDuration = nil case "cerc.auction.v1.MsgCreateAuction.reveals_duration": @@ -223,10 +227,6 @@ func (x *fastReflection_MsgCreateAuction) Clear(fd protoreflect.FieldDescriptor) x.RevealFee = nil case "cerc.auction.v1.MsgCreateAuction.minimum_bid": x.MinimumBid = nil - case "cerc.auction.v1.MsgCreateAuction.signer": - x.Signer = "" - case "cerc.auction.v1.MsgCreateAuction.kind": - x.Kind = "" case "cerc.auction.v1.MsgCreateAuction.max_price": x.MaxPrice = nil case "cerc.auction.v1.MsgCreateAuction.num_providers": @@ -247,6 +247,12 @@ func (x *fastReflection_MsgCreateAuction) Clear(fd protoreflect.FieldDescriptor) // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_MsgCreateAuction) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { + case "cerc.auction.v1.MsgCreateAuction.signer": + value := x.Signer + return protoreflect.ValueOfString(value) + case "cerc.auction.v1.MsgCreateAuction.kind": + value := x.Kind + return protoreflect.ValueOfString(value) case "cerc.auction.v1.MsgCreateAuction.commits_duration": value := x.CommitsDuration return protoreflect.ValueOfMessage(value.ProtoReflect()) @@ -262,12 +268,6 @@ func (x *fastReflection_MsgCreateAuction) Get(descriptor protoreflect.FieldDescr case "cerc.auction.v1.MsgCreateAuction.minimum_bid": value := x.MinimumBid return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "cerc.auction.v1.MsgCreateAuction.signer": - value := x.Signer - return protoreflect.ValueOfString(value) - case "cerc.auction.v1.MsgCreateAuction.kind": - value := x.Kind - return protoreflect.ValueOfString(value) case "cerc.auction.v1.MsgCreateAuction.max_price": value := x.MaxPrice return protoreflect.ValueOfMessage(value.ProtoReflect()) @@ -294,6 +294,10 @@ func (x *fastReflection_MsgCreateAuction) Get(descriptor protoreflect.FieldDescr // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgCreateAuction) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { + case "cerc.auction.v1.MsgCreateAuction.signer": + x.Signer = value.Interface().(string) + case "cerc.auction.v1.MsgCreateAuction.kind": + x.Kind = value.Interface().(string) case "cerc.auction.v1.MsgCreateAuction.commits_duration": x.CommitsDuration = value.Message().Interface().(*durationpb.Duration) case "cerc.auction.v1.MsgCreateAuction.reveals_duration": @@ -304,10 +308,6 @@ func (x *fastReflection_MsgCreateAuction) Set(fd protoreflect.FieldDescriptor, v x.RevealFee = value.Message().Interface().(*v1beta1.Coin) case "cerc.auction.v1.MsgCreateAuction.minimum_bid": x.MinimumBid = value.Message().Interface().(*v1beta1.Coin) - case "cerc.auction.v1.MsgCreateAuction.signer": - x.Signer = value.Interface().(string) - case "cerc.auction.v1.MsgCreateAuction.kind": - x.Kind = value.Interface().(string) case "cerc.auction.v1.MsgCreateAuction.max_price": x.MaxPrice = value.Message().Interface().(*v1beta1.Coin) case "cerc.auction.v1.MsgCreateAuction.num_providers": @@ -381,6 +381,10 @@ func (x *fastReflection_MsgCreateAuction) Mutable(fd protoreflect.FieldDescripto // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_MsgCreateAuction) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "cerc.auction.v1.MsgCreateAuction.signer": + return protoreflect.ValueOfString("") + case "cerc.auction.v1.MsgCreateAuction.kind": + return protoreflect.ValueOfString("") case "cerc.auction.v1.MsgCreateAuction.commits_duration": m := new(durationpb.Duration) return protoreflect.ValueOfMessage(m.ProtoReflect()) @@ -396,10 +400,6 @@ func (x *fastReflection_MsgCreateAuction) NewField(fd protoreflect.FieldDescript case "cerc.auction.v1.MsgCreateAuction.minimum_bid": m := new(v1beta1.Coin) return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "cerc.auction.v1.MsgCreateAuction.signer": - return protoreflect.ValueOfString("") - case "cerc.auction.v1.MsgCreateAuction.kind": - return protoreflect.ValueOfString("") case "cerc.auction.v1.MsgCreateAuction.max_price": m := new(v1beta1.Coin) return protoreflect.ValueOfMessage(m.ProtoReflect()) @@ -474,6 +474,14 @@ func (x *fastReflection_MsgCreateAuction) ProtoMethods() *protoiface.Methods { var n int var l int _ = l + l = len(x.Signer) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Kind) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } if x.CommitsDuration != nil { l = options.Size(x.CommitsDuration) n += 1 + l + runtime.Sov(uint64(l)) @@ -494,14 +502,6 @@ func (x *fastReflection_MsgCreateAuction) ProtoMethods() *protoiface.Methods { l = options.Size(x.MinimumBid) n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.Signer) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.Kind) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } if x.MaxPrice != nil { l = options.Size(x.MaxPrice) n += 1 + l + runtime.Sov(uint64(l)) @@ -557,20 +557,6 @@ func (x *fastReflection_MsgCreateAuction) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x42 } - if len(x.Kind) > 0 { - i -= len(x.Kind) - copy(dAtA[i:], x.Kind) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Kind))) - i-- - dAtA[i] = 0x3a - } - if len(x.Signer) > 0 { - i -= len(x.Signer) - copy(dAtA[i:], x.Signer) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Signer))) - i-- - dAtA[i] = 0x32 - } if x.MinimumBid != nil { encoded, err := options.Marshal(x.MinimumBid) if err != nil { @@ -583,7 +569,7 @@ func (x *fastReflection_MsgCreateAuction) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x2a + dAtA[i] = 0x3a } if x.RevealFee != nil { encoded, err := options.Marshal(x.RevealFee) @@ -597,7 +583,7 @@ func (x *fastReflection_MsgCreateAuction) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x22 + dAtA[i] = 0x32 } if x.CommitFee != nil { encoded, err := options.Marshal(x.CommitFee) @@ -611,7 +597,7 @@ func (x *fastReflection_MsgCreateAuction) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x2a } if x.RevealsDuration != nil { encoded, err := options.Marshal(x.RevealsDuration) @@ -625,7 +611,7 @@ func (x *fastReflection_MsgCreateAuction) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x22 } if x.CommitsDuration != nil { encoded, err := options.Marshal(x.CommitsDuration) @@ -639,6 +625,20 @@ func (x *fastReflection_MsgCreateAuction) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- + dAtA[i] = 0x1a + } + if len(x.Kind) > 0 { + i -= len(x.Kind) + copy(dAtA[i:], x.Kind) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Kind))) + i-- + dAtA[i] = 0x12 + } + if len(x.Signer) > 0 { + i -= len(x.Signer) + copy(dAtA[i:], x.Signer) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Signer))) + i-- dAtA[i] = 0xa } if input.Buf != nil { @@ -691,6 +691,70 @@ func (x *fastReflection_MsgCreateAuction) ProtoMethods() *protoiface.Methods { } switch fieldNum { case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Kind = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CommitsDuration", wireType) } @@ -726,7 +790,7 @@ func (x *fastReflection_MsgCreateAuction) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 2: + case 4: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RevealsDuration", wireType) } @@ -762,7 +826,7 @@ func (x *fastReflection_MsgCreateAuction) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 3: + case 5: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CommitFee", wireType) } @@ -798,7 +862,7 @@ func (x *fastReflection_MsgCreateAuction) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 4: + case 6: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RevealFee", wireType) } @@ -834,7 +898,7 @@ func (x *fastReflection_MsgCreateAuction) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 5: + case 7: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MinimumBid", wireType) } @@ -870,70 +934,6 @@ func (x *fastReflection_MsgCreateAuction) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 6: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Signer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Kind = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex case 8: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MaxPrice", wireType) @@ -4299,23 +4299,26 @@ type MsgCreateAuction struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Duration of the commits phase in seconds - CommitsDuration *durationpb.Duration `protobuf:"bytes,1,opt,name=commits_duration,json=commitsDuration,proto3" json:"commits_duration,omitempty"` - // Duration of the reveals phase in seconds - RevealsDuration *durationpb.Duration `protobuf:"bytes,2,opt,name=reveals_duration,json=revealsDuration,proto3" json:"reveals_duration,omitempty"` - // Commit fees - CommitFee *v1beta1.Coin `protobuf:"bytes,3,opt,name=commit_fee,json=commitFee,proto3" json:"commit_fee,omitempty"` - // Reveal fees - RevealFee *v1beta1.Coin `protobuf:"bytes,4,opt,name=reveal_fee,json=revealFee,proto3" json:"reveal_fee,omitempty"` - // Minimum acceptable bid amount - MinimumBid *v1beta1.Coin `protobuf:"bytes,5,opt,name=minimum_bid,json=minimumBid,proto3" json:"minimum_bid,omitempty"` // Address of the signer - Signer string `protobuf:"bytes,6,opt,name=signer,proto3" json:"signer,omitempty"` - // Auction's kind (vickrey | provider) - Kind string `protobuf:"bytes,7,opt,name=kind,proto3" json:"kind,omitempty"` - // Maximum acceptable bid amount (for service provider auctions) + Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` + // Auction kind (vickrey | provider) + Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty"` + // Duration of the commits phase in seconds + CommitsDuration *durationpb.Duration `protobuf:"bytes,3,opt,name=commits_duration,json=commitsDuration,proto3" json:"commits_duration,omitempty"` + // Duration of the reveals phase in seconds + RevealsDuration *durationpb.Duration `protobuf:"bytes,4,opt,name=reveals_duration,json=revealsDuration,proto3" json:"reveals_duration,omitempty"` + // Commit fees + CommitFee *v1beta1.Coin `protobuf:"bytes,5,opt,name=commit_fee,json=commitFee,proto3" json:"commit_fee,omitempty"` + // Reveal fees + RevealFee *v1beta1.Coin `protobuf:"bytes,6,opt,name=reveal_fee,json=revealFee,proto3" json:"reveal_fee,omitempty"` + // Minimum acceptable bid amount + // Only applicable in vickrey auctions + MinimumBid *v1beta1.Coin `protobuf:"bytes,7,opt,name=minimum_bid,json=minimumBid,proto3" json:"minimum_bid,omitempty"` + // Maximum acceptable bid amount + // Only applicable in provider auctions MaxPrice *v1beta1.Coin `protobuf:"bytes,8,opt,name=max_price,json=maxPrice,proto3" json:"max_price,omitempty"` - // Number of providers to be selected + // Number of desired providers (num of auction winners) + // Only applicable in provider auctions NumProviders int32 `protobuf:"varint,9,opt,name=num_providers,json=numProviders,proto3" json:"num_providers,omitempty"` } @@ -4339,6 +4342,20 @@ func (*MsgCreateAuction) Descriptor() ([]byte, []int) { return file_cerc_auction_v1_tx_proto_rawDescGZIP(), []int{0} } +func (x *MsgCreateAuction) GetSigner() string { + if x != nil { + return x.Signer + } + return "" +} + +func (x *MsgCreateAuction) GetKind() string { + if x != nil { + return x.Kind + } + return "" +} + func (x *MsgCreateAuction) GetCommitsDuration() *durationpb.Duration { if x != nil { return x.CommitsDuration @@ -4374,20 +4391,6 @@ func (x *MsgCreateAuction) GetMinimumBid() *v1beta1.Coin { return nil } -func (x *MsgCreateAuction) GetSigner() string { - if x != nil { - return x.Signer - } - return "" -} - -func (x *MsgCreateAuction) GetKind() string { - if x != nil { - return x.Kind - } - return "" -} - func (x *MsgCreateAuction) GetMaxPrice() *v1beta1.Coin { if x != nil { return x.MaxPrice @@ -4719,50 +4722,50 @@ var file_cerc_auction_v1_tx_proto_rawDesc = []byte{ 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd6, 0x06, 0x0a, 0x10, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x81, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x73, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x3b, 0xc8, - 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x63, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x73, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x20, 0x79, - 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x5f, 0x64, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x73, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x81, 0x01, 0x0a, 0x10, - 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x73, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x42, 0x3b, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, - 0x22, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x73, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x73, - 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x0f, - 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x73, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x65, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, - 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x2b, - 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x23, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x63, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x66, 0x65, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, - 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x66, 0x65, 0x65, 0x22, 0x52, 0x09, 0x63, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x46, 0x65, 0x65, 0x12, 0x65, 0x0a, 0x0a, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, - 0x5f, 0x66, 0x65, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x23, 0x6a, - 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x66, 0x65, 0x65, 0x22, - 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x66, 0x65, - 0x65, 0x22, 0x52, 0x09, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x46, 0x65, 0x65, 0x12, 0x69, 0x0a, - 0x0b, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x62, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x2d, 0xc8, - 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x25, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6d, 0x69, 0x6e, - 0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x62, 0x69, 0x64, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, - 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x62, 0x69, 0x64, 0x22, 0x52, 0x0a, 0x6d, 0x69, - 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x42, 0x69, 0x64, 0x12, 0x37, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, - 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1f, 0xf2, 0xde, 0x1f, 0x1b, 0x6a, 0x73, - 0x6f, 0x6e, 0x3a, 0x22, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, - 0x3a, 0x22, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, - 0x72, 0x12, 0x2f, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x1b, 0xf2, 0xde, 0x1f, 0x17, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6b, 0x69, 0x6e, 0x64, 0x22, - 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6b, 0x69, 0x6e, 0x64, 0x22, 0x52, 0x04, 0x6b, 0x69, - 0x6e, 0x64, 0x12, 0x61, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, + 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1f, 0xf2, 0xde, 0x1f, 0x1b, 0x6a, 0x73, 0x6f, + 0x6e, 0x3a, 0x22, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, + 0x22, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, + 0x12, 0x2f, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1b, + 0xf2, 0xde, 0x1f, 0x17, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6b, 0x69, 0x6e, 0x64, 0x22, 0x20, + 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6b, 0x69, 0x6e, 0x64, 0x22, 0x52, 0x04, 0x6b, 0x69, 0x6e, + 0x64, 0x12, 0x81, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x5f, 0x64, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x3b, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, + 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x5f, 0x64, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, + 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, + 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x44, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x81, 0x01, 0x0a, 0x10, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, + 0x73, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x3b, 0xc8, 0xde, 0x1f, + 0x00, 0xf2, 0xde, 0x1f, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x72, 0x65, 0x76, 0x65, 0x61, + 0x6c, 0x73, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x20, 0x79, 0x61, 0x6d, + 0x6c, 0x3a, 0x22, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x73, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x22, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x0f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, + 0x73, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x65, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, + 0x1f, 0x23, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x66, + 0x65, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x5f, 0x66, 0x65, 0x65, 0x22, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x46, 0x65, 0x65, + 0x12, 0x65, 0x0a, 0x0a, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, + 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, + 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x23, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x72, + 0x65, 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x66, 0x65, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, + 0x22, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x66, 0x65, 0x65, 0x22, 0x52, 0x09, 0x72, 0x65, + 0x76, 0x65, 0x61, 0x6c, 0x46, 0x65, 0x65, 0x12, 0x69, 0x0a, 0x0b, 0x6d, 0x69, 0x6e, 0x69, 0x6d, + 0x75, 0x6d, 0x5f, 0x62, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x2d, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, + 0x25, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x62, + 0x69, 0x64, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, + 0x6d, 0x5f, 0x62, 0x69, 0x64, 0x22, 0x52, 0x0a, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x42, + 0x69, 0x64, 0x12, 0x61, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x29, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x21, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, diff --git a/proto/cerc/auction/v1/auction.proto b/proto/cerc/auction/v1/auction.proto index 8f2b74ec..7483d1ea 100644 --- a/proto/cerc/auction/v1/auction.proto +++ b/proto/cerc/auction/v1/auction.proto @@ -40,7 +40,8 @@ message Params { (gogoproto.moretags) = "json:\"reveal_fee\" yaml:\"reveal_fee\"" ]; - // Minimum acceptable bid amount (for vickrey auctions) + // Minimum acceptable bid amount + // Only applicable in vickrey auctions cosmos.base.v1beta1.Coin minimum_bid = 5 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"minimum_bid\" yaml:\"minimum_bid\"" @@ -53,7 +54,7 @@ message Auction { string id = 1; - // Auction's kind (vickrey | provider) + // Auction kind (vickrey | provider) string kind = 2 [ (gogoproto.moretags) = "json:\"kind\" yaml:\"kind\"" ]; string status = 3; @@ -93,34 +94,42 @@ message Auction { (gogoproto.moretags) = "json:\"reveal_fee\" yaml:\"reveal_fee\"" ]; - // Minimum acceptable bid amount for a valid commit (for vickrey auctions) + // Minimum acceptable bid amount for a valid commit + // Only applicable in vickrey auctions cosmos.base.v1beta1.Coin minimum_bid = 10 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"minimum_bid\" yaml:\"minimum_bid\"" ]; - // Winner's address for Vickrey auctions, can be multiple for provider auctions + // Addresses of the winners + // (single winner for vickrey auction) + // (multiple winners for provider auctions) repeated string winner_addresses = 11; - // Winning bids, i.e., the best bids + // Winning bids, i.e. the best bids repeated cosmos.base.v1beta1.Coin winning_bids = 12 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"winning_bids\" yaml:\"winning_bids\"" ]; - // Amount the winner pays (vickrey auction) or is paid (provider auction) + // Auction winning price + // vickrey auction: second highest bid, paid by the winner + // provider auction: higest bid amongst winning_bids, paid by auction creator + // to each winner cosmos.base.v1beta1.Coin winning_price = 13 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"winning_price\" yaml:\"winning_price\"" ]; - // Maximum acceptable bid amount (for provider auctions) + // Maximum acceptable bid amount for a valid commit + // Only applicable in provider auctions cosmos.base.v1beta1.Coin max_price = 14 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"max_price\" yaml:\"max_price\"" ]; - // Number of providers to be selected + // Number of desired providers (num of auction winners) + // Only applicable in provider auctions int32 num_providers = 15; } diff --git a/proto/cerc/auction/v1/tx.proto b/proto/cerc/auction/v1/tx.proto index a1054d7f..846a57a9 100644 --- a/proto/cerc/auction/v1/tx.proto +++ b/proto/cerc/auction/v1/tx.proto @@ -41,52 +41,55 @@ message MsgCreateAuction { option (gogoproto.goproto_getters) = false; option (cosmos.msg.v1.signer) = "signer"; + // Address of the signer + string signer = 1 + [ (gogoproto.moretags) = "json:\"signer\" yaml:\"signer\"" ]; + + // Auction kind (vickrey | provider) + string kind = 2 [ (gogoproto.moretags) = "json:\"kind\" yaml:\"kind\"" ]; + // Duration of the commits phase in seconds - google.protobuf.Duration commits_duration = 1 [ + google.protobuf.Duration commits_duration = 3 [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true, (gogoproto.moretags) = "json:\"commits_duration\" yaml:\"commits_duration\"" ]; // Duration of the reveals phase in seconds - google.protobuf.Duration reveals_duration = 2 [ + google.protobuf.Duration reveals_duration = 4 [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true, (gogoproto.moretags) = "json:\"reveals_duration\" yaml:\"reveals_duration\"" ]; // Commit fees - cosmos.base.v1beta1.Coin commit_fee = 3 [ + cosmos.base.v1beta1.Coin commit_fee = 5 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"commit_fee\" yaml:\"commit_fee\"" ]; // Reveal fees - cosmos.base.v1beta1.Coin reveal_fee = 4 [ + cosmos.base.v1beta1.Coin reveal_fee = 6 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"reveal_fee\" yaml:\"reveal_fee\"" ]; - // Minimum acceptable bid amount (for vickrey auctions) - cosmos.base.v1beta1.Coin minimum_bid = 5 [ + // Minimum acceptable bid amount + // Only applicable in vickrey auctions + cosmos.base.v1beta1.Coin minimum_bid = 7 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"minimum_bid\" yaml:\"minimum_bid\"" ]; - // Address of the signer - string signer = 6 - [ (gogoproto.moretags) = "json:\"signer\" yaml:\"signer\"" ]; - - // Auction's kind (vickrey | provider) - string kind = 7 [ (gogoproto.moretags) = "json:\"kind\" yaml:\"kind\"" ]; - - // Maximum acceptable bid amount (for provider auctions) + // Maximum acceptable bid amount + // Only applicable in provider auctions cosmos.base.v1beta1.Coin max_price = 8 [ (gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"max_price\" yaml:\"max_price\"" ]; - // Number of providers to be selected + // Number of desired providers (num of auction winners) + // Only applicable in provider auctions int32 num_providers = 9; } diff --git a/x/auction/auction.pb.go b/x/auction/auction.pb.go index 619052f1..68c0b7ed 100644 --- a/x/auction/auction.pb.go +++ b/x/auction/auction.pb.go @@ -40,6 +40,7 @@ type Params struct { // Reveal fees RevealFee types.Coin `protobuf:"bytes,4,opt,name=reveal_fee,json=revealFee,proto3" json:"reveal_fee" json:"reveal_fee" yaml:"reveal_fee"` // Minimum acceptable bid amount + // Only applicable in vickrey auctions MinimumBid types.Coin `protobuf:"bytes,5,opt,name=minimum_bid,json=minimumBid,proto3" json:"minimum_bid" json:"minimum_bid" yaml:"minimum_bid"` } @@ -113,7 +114,7 @@ func (m *Params) GetMinimumBid() types.Coin { // Auction represents a sealed-bid on-chain auction type Auction struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // Auction's kind (vickrey | provider) + // Auction kind (vickrey | provider) Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty" json:"kind" yaml:"kind"` Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` // Address of the creator of the auction @@ -129,19 +130,24 @@ type Auction struct { CommitFee types.Coin `protobuf:"bytes,8,opt,name=commit_fee,json=commitFee,proto3" json:"commit_fee" json:"commit_fee" yaml:"commit_fee"` RevealFee types.Coin `protobuf:"bytes,9,opt,name=reveal_fee,json=revealFee,proto3" json:"reveal_fee" json:"reveal_fee" yaml:"reveal_fee"` // Minimum acceptable bid amount for a valid commit + // Only applicable in vickrey auctions MinimumBid types.Coin `protobuf:"bytes,10,opt,name=minimum_bid,json=minimumBid,proto3" json:"minimum_bid" json:"minimum_bid" yaml:"minimum_bid"` - // Addresses of the winners (one for vickrey auctions and can be multiple for - // provider auctions) + // Addresses of the winners + // (single winner for vickrey auction) + // (multiple winners for provider auctions) WinnerAddresses []string `protobuf:"bytes,11,rep,name=winner_addresses,json=winnerAddresses,proto3" json:"winner_addresses,omitempty"` - // Winning bids, i.e., the best bids + // Winning bids, i.e. the best bids WinningBids []types.Coin `protobuf:"bytes,12,rep,name=winning_bids,json=winningBids,proto3" json:"winning_bids" json:"winning_bids" yaml:"winning_bids"` - // Amount the winner pays (vickrey auction) or gets paid (provider auction), - // i.e. the second best bid + // Auction winning price + // vickrey auction: second highest bid, paid by the winner + // provider auction: higest bid amongst winning_bids, paid by auction creator + // to each winner WinningPrice types.Coin `protobuf:"bytes,13,opt,name=winning_price,json=winningPrice,proto3" json:"winning_price" json:"winning_price" yaml:"winning_price"` - // Maximum acceptable bid amount for a valid commit for service provider - // auctions + // Maximum acceptable bid amount for a valid commit + // Only applicable in provider auctions MaxPrice types.Coin `protobuf:"bytes,14,opt,name=max_price,json=maxPrice,proto3" json:"max_price" json:"max_price" yaml:"max_price"` - // Number of providers to be selected + // Number of desired providers (num of auction winners) + // Only applicable in provider auctions NumProviders int32 `protobuf:"varint,15,opt,name=num_providers,json=numProviders,proto3" json:"num_providers,omitempty"` } diff --git a/x/auction/keeper/keeper.go b/x/auction/keeper/keeper.go index 543787a5..8dc6e13d 100644 --- a/x/auction/keeper/keeper.go +++ b/x/auction/keeper/keeper.go @@ -353,6 +353,7 @@ func (k Keeper) CreateAuction(ctx sdk.Context, msg auctiontypes.MsgCreateAuction auction := auctiontypes.Auction{ Id: auctionId, + Kind: msg.Kind, Status: auctiontypes.AuctionStatusCommitPhase, OwnerAddress: signerAddress.String(), CreateTime: now, @@ -362,7 +363,6 @@ func (k Keeper) CreateAuction(ctx sdk.Context, msg auctiontypes.MsgCreateAuction RevealFee: msg.RevealFee, MinimumBid: msg.MinimumBid, MaxPrice: msg.MaxPrice, - Kind: msg.Kind, NumProviders: msg.NumProviders, } @@ -535,8 +535,8 @@ func (k Keeper) RevealBid(ctx sdk.Context, msg auctiontypes.MsgRevealBid) (*auct return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Bid is lower than minimum bid.") } - if auction.Kind == auctiontypes.AuctionKindProvider && bidAmount.IsGTE(auction.MaxPrice) { - return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Bid is higher than maximum price.") + if auction.Kind == auctiontypes.AuctionKindProvider && auction.MaxPrice.IsLT(bidAmount) { + return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Bid is higher than max price.") } // Lock bid amount. @@ -714,6 +714,7 @@ func (k Keeper) pickAuctionWinner(ctx sdk.Context, auction *auctiontypes.Auction if highestBid != nil { auction.WinningBids = []sdk.Coin{highestBid.BidAmount} auction.WinnerAddresses = []string{highestBid.BidderAddress} + // Winner pays 2nd price, if a 2nd price exists. auction.WinningPrice = highestBid.BidAmount if secondHighestBid != nil { @@ -721,7 +722,7 @@ func (k Keeper) pickAuctionWinner(ctx sdk.Context, auction *auctiontypes.Auction } k.Logger(ctx).Info(fmt.Sprintf("Auction %s winner %s.", auction.Id, auction.WinnerAddresses[0])) k.Logger(ctx).Info(fmt.Sprintf("Auction %s winner bid %s.", auction.Id, auction.WinningBids[0].String())) - k.Logger(ctx).Info(fmt.Sprintf("Auction %s winner price %s.", auction.Id, auction.WinningPrice.String())) + k.Logger(ctx).Info(fmt.Sprintf("Auction %s winning price %s.", auction.Id, auction.WinningPrice.String())) } else { k.Logger(ctx).Info(fmt.Sprintf("Auction %s has no valid revealed bids (no winner).", auction.Id)) } @@ -755,7 +756,7 @@ func (k Keeper) pickAuctionWinner(ctx sdk.Context, auction *auctiontypes.Auction } // Process winner account (if nobody bids, there won't be a winner). - if len(auction.WinnerAddresses) == 1 { + if len(auction.WinnerAddresses) != 0 { winnerAddress, err := sdk.AccAddressFromBech32(auction.WinnerAddresses[0]) if err != nil { k.Logger(ctx).Error(fmt.Sprintf("Invalid winner address. %v", err)) @@ -831,9 +832,10 @@ func (k Keeper) pickProviderAuctionWinners(ctx sdk.Context, auction *auctiontype return 0 }) + // Take best min(len(revealedBids), auction.NumProviders) bids numWinners := int(auction.NumProviders) if len(revealedBids) < numWinners { - numWinners = (len(revealedBids)) + numWinners = len(revealedBids) } winnerBids := revealedBids[:numWinners] @@ -846,6 +848,7 @@ func (k Keeper) pickProviderAuctionWinners(ctx sdk.Context, auction *auctiontype winnerAddresses[i] = bid.BidderAddress winningBids[i] = bid.BidAmount } + auction.WinnerAddresses = winnerAddresses auction.WinningBids = winningBids @@ -855,7 +858,7 @@ func (k Keeper) pickProviderAuctionWinners(ctx sdk.Context, auction *auctiontype for _, bid := range winnerBids { k.Logger(ctx).Info(fmt.Sprintf("Auction %s winner address: %s, bid amount: %s.", auction.Id, bid.BidderAddress, bid.BidAmount.String())) } - k.Logger(ctx).Info(fmt.Sprintf("Auction %s winner price %s.", auction.Id, auction.WinningPrice.String())) + k.Logger(ctx).Info(fmt.Sprintf("Auction %s winning price %s.", auction.Id, auction.WinningPrice.String())) } else { k.Logger(ctx).Info(fmt.Sprintf("Auction %s has no valid revealed bids (no winner).", auction.Id)) } @@ -882,6 +885,7 @@ func (k Keeper) pickProviderAuctionWinners(ctx sdk.Context, auction *auctiontype } // Process winner accounts (if nobody bids, there won't be a winner). + totalLockedAmount := auction.MaxPrice.Amount.Mul(math.NewInt(int64(auction.NumProviders))) if len(winnerBids) > 0 { for _, bid := range winnerBids { winnerAddress, err := sdk.AccAddressFromBech32(bid.BidderAddress) @@ -896,32 +900,29 @@ func (k Keeper) pickProviderAuctionWinners(ctx sdk.Context, auction *auctiontype k.Logger(ctx).Error(fmt.Sprintf("Auction error sending funds to winner: %v", sdkErr)) panic(sdkErr) } - } - // Send back extra amount to auction creator - totalLockedAmount := auction.MaxPrice.Amount.Mul(math.NewInt(int64(auction.NumProviders))) - totalAmountPaid := auction.WinningPrice.Amount.Mul(math.NewInt(int64(auction.NumProviders))) - extraAmountCoin := sdk.NewCoin(auction.MaxPrice.Denom, totalLockedAmount.Sub(totalAmountPaid)) + // Send back extra amount to auction creator + totalAmountPaid := auction.WinningPrice.Amount.Mul(math.NewInt(int64(len(winnerBids)))) + extraAmount := sdk.NewCoin(auction.MaxPrice.Denom, totalLockedAmount.Sub(totalAmountPaid)) sdkErr := k.bankKeeper.SendCoinsFromModuleToAccount( ctx, auctiontypes.ModuleName, sdk.AccAddress(auction.OwnerAddress), - sdk.NewCoins(extraAmountCoin), + sdk.NewCoins(extraAmount), ) if sdkErr != nil { k.Logger(ctx).Error(fmt.Sprintf("Auction error returning extra locked amount: %v", sdkErr)) panic(sdkErr) } } else { - totalLockedAmount := sdk.NewCoin(auction.MaxPrice.Denom, auction.MaxPrice.Amount.Mul(math.NewInt(int64(auction.NumProviders)))) - + // Return all locked amount in case of no winners sdkErr := k.bankKeeper.SendCoinsFromModuleToAccount( ctx, auctiontypes.ModuleName, sdk.AccAddress(auction.OwnerAddress), - sdk.NewCoins(totalLockedAmount)) + sdk.NewCoins(sdk.NewCoin(auction.MaxPrice.Denom, totalLockedAmount))) if sdkErr != nil { k.Logger(ctx).Error(fmt.Sprintf("Auction error returning bid amount: %v", sdkErr)) panic(sdkErr) diff --git a/x/auction/tx.pb.go b/x/auction/tx.pb.go index d7df6dda..03f5fa39 100644 --- a/x/auction/tx.pb.go +++ b/x/auction/tx.pb.go @@ -38,23 +38,26 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // MsgCreateAuction defines a create auction message type MsgCreateAuction struct { - // Duration of the commits phase in seconds - CommitsDuration time.Duration `protobuf:"bytes,1,opt,name=commits_duration,json=commitsDuration,proto3,stdduration" json:"commits_duration" json:"commits_duration" yaml:"commits_duration"` - // Duration of the reveals phase in seconds - RevealsDuration time.Duration `protobuf:"bytes,2,opt,name=reveals_duration,json=revealsDuration,proto3,stdduration" json:"reveals_duration" json:"reveals_duration" yaml:"reveals_duration"` - // Commit fees - CommitFee types.Coin `protobuf:"bytes,3,opt,name=commit_fee,json=commitFee,proto3" json:"commit_fee" json:"commit_fee" yaml:"commit_fee"` - // Reveal fees - RevealFee types.Coin `protobuf:"bytes,4,opt,name=reveal_fee,json=revealFee,proto3" json:"reveal_fee" json:"reveal_fee" yaml:"reveal_fee"` - // Minimum acceptable bid amount - MinimumBid types.Coin `protobuf:"bytes,5,opt,name=minimum_bid,json=minimumBid,proto3" json:"minimum_bid" json:"minimum_bid" yaml:"minimum_bid"` // Address of the signer - Signer string `protobuf:"bytes,6,opt,name=signer,proto3" json:"signer,omitempty" json:"signer" yaml:"signer"` - // Auction's kind (vickrey | provider) - Kind string `protobuf:"bytes,7,opt,name=kind,proto3" json:"kind,omitempty" json:"kind" yaml:"kind"` - // Maximum acceptable bid amount (for service provider auctions) + Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty" json:"signer" yaml:"signer"` + // Auction kind (vickrey | provider) + Kind string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty" json:"kind" yaml:"kind"` + // Duration of the commits phase in seconds + CommitsDuration time.Duration `protobuf:"bytes,3,opt,name=commits_duration,json=commitsDuration,proto3,stdduration" json:"commits_duration" json:"commits_duration" yaml:"commits_duration"` + // Duration of the reveals phase in seconds + RevealsDuration time.Duration `protobuf:"bytes,4,opt,name=reveals_duration,json=revealsDuration,proto3,stdduration" json:"reveals_duration" json:"reveals_duration" yaml:"reveals_duration"` + // Commit fees + CommitFee types.Coin `protobuf:"bytes,5,opt,name=commit_fee,json=commitFee,proto3" json:"commit_fee" json:"commit_fee" yaml:"commit_fee"` + // Reveal fees + RevealFee types.Coin `protobuf:"bytes,6,opt,name=reveal_fee,json=revealFee,proto3" json:"reveal_fee" json:"reveal_fee" yaml:"reveal_fee"` + // Minimum acceptable bid amount + // Only applicable in vickrey auctions + MinimumBid types.Coin `protobuf:"bytes,7,opt,name=minimum_bid,json=minimumBid,proto3" json:"minimum_bid" json:"minimum_bid" yaml:"minimum_bid"` + // Maximum acceptable bid amount + // Only applicable in provider auctions MaxPrice types.Coin `protobuf:"bytes,8,opt,name=max_price,json=maxPrice,proto3" json:"max_price" json:"max_price" yaml:"max_price"` - // Number of providers to be selected + // Number of desired providers (num of auction winners) + // Only applicable in provider auctions NumProviders int32 `protobuf:"varint,9,opt,name=num_providers,json=numProviders,proto3" json:"num_providers,omitempty"` } @@ -404,68 +407,68 @@ func init() { func init() { proto.RegisterFile("cerc/auction/v1/tx.proto", fileDescriptor_70947cda59e835fd) } var fileDescriptor_70947cda59e835fd = []byte{ - // 964 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xc1, 0x6e, 0xdb, 0x46, - 0x10, 0x15, 0x23, 0x5b, 0x89, 0xd6, 0x4e, 0x1d, 0x10, 0x2e, 0x4c, 0xcb, 0xb5, 0x28, 0xd3, 0x30, - 0x62, 0xa7, 0x30, 0x09, 0xbb, 0x68, 0x03, 0xb8, 0x87, 0xc2, 0x4c, 0x11, 0xb4, 0x05, 0x0c, 0x18, - 0x2c, 0x72, 0xc9, 0x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, 0xee, 0x84, 0x2c, 0x49, 0x68, - 0xce, 0xdb, 0x5a, 0x89, 0x65, 0xb4, 0x8c, 0xed, 0x85, 0xfd, 0x55, 0x57, 0x49, 0x75, 0xb5, 0x54, - 0xf7, 0x53, 0x08, 0xf0, 0x3f, 0x7e, 0x39, 0xb0, 0x2b, 0xc3, 0x81, 0xed, 0x7d, 0xc5, 0x59, 0x7a, - 0xe0, 0x94, 0x0b, 0x38, 0xad, 0xa7, 0x38, 0x39, 0x9d, 0xe1, 0xff, 0xe9, 0x2f, 0xdb, 0x08, 0x96, - 0xc0, 0xad, 0xab, 0x49, 0x0d, 0x19, 0xe9, 0x13, 0x7c, 0x5a, 0xd0, 0x70, 0xe3, 0x8a, 0x1a, 0xca, - 0x05, 0xb4, 0x86, 0x29, 0xbf, 0xd2, 0x00, 0xee, 0x91, 0x06, 0x82, 0x90, 0x92, 0xd5, 0x7e, 0x42, - 0x88, 0x55, 0x05, 0x72, 0x18, 0xaf, 0x78, 0x17, 0x2e, 0xbc, 0x0b, 0xf7, 0x01, 0xa3, 0xa9, 0xff, - 0x3e, 0x90, 0x6f, 0x16, 0x07, 0x20, 0x52, 0x27, 0x5b, 0x97, 0x9e, 0xa0, 0xae, 0x8c, 0x87, 0x84, - 0x08, 0x1a, 0xc5, 0x2c, 0x69, 0xe6, 0xae, 0x48, 0x33, 0x4e, 0x9d, 0xec, 0x0e, 0x68, 0x94, 0x21, - 0x68, 0x28, 0x5a, 0x48, 0x68, 0x4a, 0x93, 0x5e, 0xd2, 0xee, 0xd0, 0xc8, 0x9a, 0xbf, 0x8c, 0x67, - 0x17, 0x78, 0xb6, 0x14, 0x4f, 0x21, 0x57, 0x13, 0x15, 0x5d, 0x01, 0x02, 0xcb, 0xa7, 0x91, 0x79, - 0x1f, 0xd5, 0x38, 0x8d, 0x53, 0x92, 0x59, 0xb5, 0x96, 0xb1, 0x5d, 0xf7, 0xed, 0xe1, 0xc0, 0x5e, - 0x53, 0x65, 0x94, 0x5f, 0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xaa, 0x01, 0xcc, 0x93, 0x1a, + 0x08, 0x42, 0xaa, 0xac, 0xee, 0x13, 0x42, 0xac, 0x45, 0x80, 0xc3, 0x45, 0x8a, 0x5b, 0x77, 0xe1, + 0xd6, 0xdd, 0x07, 0x8c, 0xa6, 0xfe, 0xbb, 0x00, 0xdf, 0x2a, 0x0a, 0x20, 0xb6, 0xce, 0x1e, 0x5d, + 0x5a, 0x82, 0xba, 0x5a, 0x3c, 0x24, 0x44, 0x60, 0x14, 0x59, 0x62, 0x6a, 0xd7, 0xc4, 0x4c, 0xb7, + 0xce, 0x9e, 0x0e, 0x30, 0x6a, 0x21, 0x30, 0x14, 0x35, 0x12, 0x9a, 0xd2, 0x64, 0x90, 0x74, 0x7b, + 0x34, 0xb2, 0x6e, 0x5e, 0xc5, 0xd9, 0x03, 0xce, 0xb6, 0xe2, 0x14, 0xf6, 0x6a, 0x50, 0xd1, 0x14, + 0x20, 0x58, 0xf9, 0x34, 0x32, 0x31, 0xaa, 0x27, 0xf8, 0xac, 0xdb, 0xcf, 0x68, 0x48, 0xac, 0x5b, + 0x57, 0x81, 0x76, 0x01, 0xb4, 0x09, 0x20, 0xbd, 0x73, 0x82, 0x99, 0x18, 0x82, 0x5b, 0x09, 0x3e, + 0x3b, 0x16, 0x8f, 0xe6, 0x16, 0xba, 0x9d, 0x0e, 0x12, 0x31, 0x5b, 0x43, 0x1a, 0x91, 0x8c, 0x5b, + 0xf5, 0xb6, 0xb1, 0xb3, 0x18, 0x2c, 0xa5, 0x83, 0xe4, 0x58, 0xdb, 0x0e, 0x96, 0xbf, 0xfb, 0xd1, + 0xae, 0x3c, 0x7b, 0xfd, 0xe2, 0x1e, 0x8c, 0x82, 0xf3, 0x15, 0xb2, 0xca, 0x73, 0x15, 0x10, 0xde, + 0x67, 0x29, 0x27, 0xe6, 0x23, 0x74, 0x13, 0xa6, 0x50, 0x0e, 0x58, 0xa3, 0x63, 0xb9, 0xa5, 0xd7, + 0x8b, 0x0b, 0x5b, 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 0x5f, + 0xb4, 0x2a, 0xaf, 0x2e, 0x5a, 0x95, 0xdf, 0x2e, 0x5a, 0x95, 0xc7, 0xdb, 0x31, 0xcd, 0xdd, 0x61, + 0xd4, 0x73, 0xc5, 0x6f, 0x15, 0xc9, 0xc2, 0x3d, 0xca, 0xbc, 0x53, 0x1c, 0xb2, 0x94, 0x86, 0x91, + 0x77, 0xa6, 0x2b, 0xee, 0xd5, 0xe4, 0xff, 0xc1, 0x7b, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0xd2, + 0x88, 0x14, 0x9a, 0x40, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -701,20 +704,6 @@ func (m *MsgCreateAuction) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x42 - if len(m.Kind) > 0 { - i -= len(m.Kind) - copy(dAtA[i:], m.Kind) - i = encodeVarintTx(dAtA, i, uint64(len(m.Kind))) - i-- - dAtA[i] = 0x3a - } - if len(m.Signer) > 0 { - i -= len(m.Signer) - copy(dAtA[i:], m.Signer) - i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) - i-- - dAtA[i] = 0x32 - } { size, err := m.MinimumBid.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -724,7 +713,7 @@ func (m *MsgCreateAuction) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintTx(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x2a + dAtA[i] = 0x3a { size, err := m.RevealFee.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -734,7 +723,7 @@ func (m *MsgCreateAuction) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintTx(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 + dAtA[i] = 0x32 { size, err := m.CommitFee.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -744,7 +733,7 @@ func (m *MsgCreateAuction) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintTx(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0x2a n5, err5 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.RevealsDuration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.RevealsDuration):]) if err5 != nil { return 0, err5 @@ -752,7 +741,7 @@ func (m *MsgCreateAuction) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= n5 i = encodeVarintTx(dAtA, i, uint64(n5)) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x22 n6, err6 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.CommitsDuration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.CommitsDuration):]) if err6 != nil { return 0, err6 @@ -760,7 +749,21 @@ func (m *MsgCreateAuction) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= n6 i = encodeVarintTx(dAtA, i, uint64(n6)) i-- - dAtA[i] = 0xa + dAtA[i] = 0x1a + if len(m.Kind) > 0 { + i -= len(m.Kind) + copy(dAtA[i:], m.Kind) + i = encodeVarintTx(dAtA, i, uint64(len(m.Kind))) + i-- + dAtA[i] = 0x12 + } + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } @@ -1037,6 +1040,14 @@ func (m *MsgCreateAuction) Size() (n int) { } var l int _ = l + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Kind) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.CommitsDuration) n += 1 + l + sovTx(uint64(l)) l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.RevealsDuration) @@ -1047,14 +1058,6 @@ func (m *MsgCreateAuction) Size() (n int) { n += 1 + l + sovTx(uint64(l)) l = m.MinimumBid.Size() n += 1 + l + sovTx(uint64(l)) - l = len(m.Signer) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Kind) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } l = m.MaxPrice.Size() n += 1 + l + sovTx(uint64(l)) if m.NumProviders != 0 { @@ -1204,6 +1207,70 @@ func (m *MsgCreateAuction) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Kind = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field CommitsDuration", wireType) } @@ -1236,7 +1303,7 @@ func (m *MsgCreateAuction) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 2: + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RevealsDuration", wireType) } @@ -1269,7 +1336,7 @@ func (m *MsgCreateAuction) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 3: + case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field CommitFee", wireType) } @@ -1302,7 +1369,7 @@ func (m *MsgCreateAuction) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 4: + case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RevealFee", wireType) } @@ -1335,7 +1402,7 @@ func (m *MsgCreateAuction) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 5: + case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field MinimumBid", wireType) } @@ -1368,70 +1435,6 @@ func (m *MsgCreateAuction) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Kind = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field MaxPrice", wireType) -- 2.45.2 From fec82eb2f85cdd6266efa1fa0d153dd459754e51 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Thu, 19 Sep 2024 09:30:38 +0530 Subject: [PATCH 14/29] Update Auction GQL schema type --- gql/README.md | 2 +- gql/cerc-io/laconicd/schema.graphql | 6 +- gql/generated.go | 149 ++++++++++++++++------------ gql/models_gen.go | 2 +- gql/util.go | 8 +- 5 files changed, 89 insertions(+), 78 deletions(-) diff --git a/gql/README.md b/gql/README.md index 5c4e75d5..c0b6aa34 100644 --- a/gql/README.md +++ b/gql/README.md @@ -13,7 +13,7 @@ On having some change in the GQL schema (for example: adding a new query) update go get github.com/99designs/gqlgen@v0.17.22 # Generate bindings - # In gql + cd gql go run github.com/99designs/gqlgen generate ``` diff --git a/gql/cerc-io/laconicd/schema.graphql b/gql/cerc-io/laconicd/schema.graphql index 44502aab..be9f857f 100644 --- a/gql/cerc-io/laconicd/schema.graphql +++ b/gql/cerc-io/laconicd/schema.graphql @@ -168,13 +168,13 @@ type Auction { commitFee: Coin! # Fee required to bid/participate in the auction. revealFee: Coin! # Reveal fee (paid back to bidders only if they unseal/reveal the bid). minimumBid: Coin! # Minimum bid amount. - winnerAddresses: [String]! # Winner address. - winnerBids: [Coin]! # The winning bid amount. + winnerAddresses: [String!]! # Winner address. + winnerBids: [Coin!]! # The winning bid amount. winnerPrice: Coin! # The price that the winner actually pays (2nd highest bid). maxPrice: Coin! # Max bid amount for service provider auction. kind: String! # Auction kind. numProviders: Int # Number of service providers - bids: [AuctionBid] # Bids make in the auction. + bids: [AuctionBid!]! # Bids made in the auction. } # Record defines the basic properties of an entity in the graph database. diff --git a/gql/generated.go b/gql/generated.go index 46aebfa5..5ebb69a9 100644 --- a/gql/generated.go +++ b/gql/generated.go @@ -2197,9 +2197,9 @@ func (ec *executionContext) _Auction_winnerAddresses(ctx context.Context, field } return graphql.Null } - res := resTmp.([]*string) + res := resTmp.([]string) fc.Result = res - return ec.marshalNString2ᚕᚖstring(ctx, field.Selections, res) + return ec.marshalNString2ᚕstringᚄ(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_Auction_winnerAddresses(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -2243,7 +2243,7 @@ func (ec *executionContext) _Auction_winnerBids(ctx context.Context, field graph } res := resTmp.([]*Coin) fc.Result = res - return ec.marshalNCoin2ᚕᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐCoin(ctx, field.Selections, res) + return ec.marshalNCoin2ᚕᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐCoinᚄ(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_Auction_winnerBids(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -2471,11 +2471,14 @@ func (ec *executionContext) _Auction_bids(ctx context.Context, field graphql.Col return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } res := resTmp.([]*AuctionBid) fc.Result = res - return ec.marshalOAuctionBid2ᚕᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐAuctionBid(ctx, field.Selections, res) + return ec.marshalNAuctionBid2ᚕᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐAuctionBidᚄ(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_Auction_bids(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -8924,6 +8927,9 @@ func (ec *executionContext) _Auction(ctx context.Context, sel ast.SelectionSet, out.Values[i] = ec._Auction_bids(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -10578,6 +10584,60 @@ func (ec *executionContext) marshalNAttribute2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋla return ec._Attribute(ctx, sel, v) } +func (ec *executionContext) marshalNAuctionBid2ᚕᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐAuctionBidᚄ(ctx context.Context, sel ast.SelectionSet, v []*AuctionBid) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNAuctionBid2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐAuctionBid(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalNAuctionBid2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐAuctionBid(ctx context.Context, sel ast.SelectionSet, v *AuctionBid) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._AuctionBid(ctx, sel, v) +} + func (ec *executionContext) marshalNAuthority2ᚕᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐAuthority(ctx context.Context, sel ast.SelectionSet, v []*Authority) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup @@ -10689,7 +10749,7 @@ func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.Se return res } -func (ec *executionContext) marshalNCoin2ᚕᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐCoin(ctx context.Context, sel ast.SelectionSet, v []*Coin) graphql.Marshaler { +func (ec *executionContext) marshalNCoin2ᚕᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐCoinᚄ(ctx context.Context, sel ast.SelectionSet, v []*Coin) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -10713,7 +10773,7 @@ func (ec *executionContext) marshalNCoin2ᚕᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaco if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalOCoin2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐCoin(ctx, sel, v[i]) + ret[i] = ec.marshalNCoin2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐCoin(ctx, sel, v[i]) } if isLen1 { f(i) @@ -10724,6 +10784,12 @@ func (ec *executionContext) marshalNCoin2ᚕᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaco } wg.Wait() + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + return ret } @@ -10959,16 +11025,16 @@ func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.S return res } -func (ec *executionContext) unmarshalNString2ᚕᚖstring(ctx context.Context, v interface{}) ([]*string, error) { +func (ec *executionContext) unmarshalNString2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { var vSlice []interface{} if v != nil { vSlice = graphql.CoerceList(v) } var err error - res := make([]*string, len(vSlice)) + res := make([]string, len(vSlice)) for i := range vSlice { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalOString2ᚖstring(ctx, vSlice[i]) + res[i], err = ec.unmarshalNString2string(ctx, vSlice[i]) if err != nil { return nil, err } @@ -10976,10 +11042,16 @@ func (ec *executionContext) unmarshalNString2ᚕᚖstring(ctx context.Context, v return res, nil } -func (ec *executionContext) marshalNString2ᚕᚖstring(ctx context.Context, sel ast.SelectionSet, v []*string) graphql.Marshaler { +func (ec *executionContext) marshalNString2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { ret := make(graphql.Array, len(v)) for i := range v { - ret[i] = ec.marshalOString2ᚖstring(ctx, sel, v[i]) + ret[i] = ec.marshalNString2string(ctx, sel, v[i]) + } + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } } return ret @@ -11467,54 +11539,6 @@ func (ec *executionContext) marshalOAuction2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaco return ec._Auction(ctx, sel, v) } -func (ec *executionContext) marshalOAuctionBid2ᚕᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐAuctionBid(ctx context.Context, sel ast.SelectionSet, v []*AuctionBid) graphql.Marshaler { - if v == nil { - return graphql.Null - } - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalOAuctionBid2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐAuctionBid(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - return ret -} - -func (ec *executionContext) marshalOAuctionBid2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐAuctionBid(ctx context.Context, sel ast.SelectionSet, v *AuctionBid) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._AuctionBid(ctx, sel, v) -} - func (ec *executionContext) marshalOAuthority2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐAuthority(ctx context.Context, sel ast.SelectionSet, v *Authority) graphql.Marshaler { if v == nil { return graphql.Null @@ -11697,13 +11721,6 @@ func (ec *executionContext) marshalOCoin2ᚕᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaco return ret } -func (ec *executionContext) marshalOCoin2ᚖgitᚗvdbᚗtoᚋcercᚑioᚋlaconicdᚋgqlᚐCoin(ctx context.Context, sel ast.SelectionSet, v *Coin) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._Coin(ctx, sel, v) -} - func (ec *executionContext) unmarshalOFloat2ᚖfloat64(ctx context.Context, v interface{}) (*float64, error) { if v == nil { return nil, nil diff --git a/gql/models_gen.go b/gql/models_gen.go index 79585977..e8a62016 100644 --- a/gql/models_gen.go +++ b/gql/models_gen.go @@ -35,7 +35,7 @@ type Auction struct { CommitFee *Coin `json:"commitFee"` RevealFee *Coin `json:"revealFee"` MinimumBid *Coin `json:"minimumBid"` - WinnerAddresses []*string `json:"winnerAddresses"` + WinnerAddresses []string `json:"winnerAddresses"` WinnerBids []*Coin `json:"winnerBids"` WinnerPrice *Coin `json:"winnerPrice"` MaxPrice *Coin `json:"maxPrice"` diff --git a/gql/util.go b/gql/util.go index 3aa3d08b..bc295fc7 100644 --- a/gql/util.go +++ b/gql/util.go @@ -232,12 +232,6 @@ func GetGQLAuction(auction *auctiontypes.Auction, bids []*auctiontypes.Bid) (*Au return nil, nil } - winnerAddresses := make([]*string, len(auction.WinnerAddresses)) - for i, winnerAddress := range auction.WinnerAddresses { - address := winnerAddress - winnerAddresses[i] = &address - } - numProviders := int(auction.NumProviders) gqlAuction := Auction{ @@ -250,7 +244,7 @@ func GetGQLAuction(auction *auctiontypes.Auction, bids []*auctiontypes.Bid) (*Au CommitFee: getGQLCoin(auction.CommitFee), RevealFee: getGQLCoin(auction.RevealFee), MinimumBid: getGQLCoin(auction.MinimumBid), - WinnerAddresses: winnerAddresses, + WinnerAddresses: auction.WinnerAddresses, WinnerBids: getGQLCoins(auction.WinningBids), WinnerPrice: getGQLCoin(auction.WinningPrice), MaxPrice: getGQLCoin(auction.MaxPrice), -- 2.45.2 From 3a05924998cc54d75fd6f574c757cc70cc749193 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Thu, 19 Sep 2024 09:59:46 +0530 Subject: [PATCH 15/29] Update create auction CLI --- gql/README.md | 4 ++-- x/auction/client/cli/tx.go | 22 +++++++++++----------- x/auction/module/autocli.go | 5 ++++- x/auction/msgs.go | 22 ++++++++++++++++------ x/registry/keeper/naming_keeper.go | 4 ++-- 5 files changed, 35 insertions(+), 22 deletions(-) diff --git a/gql/README.md b/gql/README.md index c0b6aa34..d2f10b1c 100644 --- a/gql/README.md +++ b/gql/README.md @@ -1,6 +1,6 @@ # cerc-io laconic gql -> Browser : http://localhost:9473 for gql +> Browser : for gql ## Run gqlgen @@ -385,4 +385,4 @@ Query participants: nitroAddress } } -``` \ No newline at end of file +``` diff --git a/x/auction/client/cli/tx.go b/x/auction/client/cli/tx.go index 30423244..2f094b78 100644 --- a/x/auction/client/cli/tx.go +++ b/x/auction/client/cli/tx.go @@ -133,7 +133,7 @@ func GetCmdRevealBid() *cobra.Command { func GetCmdCreateAuction() *cobra.Command { cmd := &cobra.Command{ - Use: "create [commits-duration] [reveals-duration] [commit-fee] [reveal-fee] [minimum-bid] [max-price] [kind] [num-providers]", + Use: "create [kind] [commits-duration] [reveals-duration] [commit-fee] [reveal-fee] [minimum-bid] [max-price] [num-providers]", Short: "Create auction.", Args: cobra.ExactArgs(8), RunE: func(cmd *cobra.Command, args []string) error { @@ -142,45 +142,46 @@ func GetCmdCreateAuction() *cobra.Command { return err } - commitsDuration, err := time.ParseDuration(args[0]) + kind := args[0] + + commitsDuration, err := time.ParseDuration(args[1]) if err != nil { return err } - revealsDuration, err := time.ParseDuration(args[1]) + revealsDuration, err := time.ParseDuration(args[2]) if err != nil { return err } - commitFee, err := sdk.ParseCoinNormalized(args[2]) + commitFee, err := sdk.ParseCoinNormalized(args[3]) if err != nil { return err } - revealFee, err := sdk.ParseCoinNormalized(args[3]) + revealFee, err := sdk.ParseCoinNormalized(args[4]) if err != nil { return err } - minimumBid, err := sdk.ParseCoinNormalized(args[4]) + minimumBid, err := sdk.ParseCoinNormalized(args[5]) if err != nil { return err } - maxPrice, err := sdk.ParseCoinNormalized(args[5]) + maxPrice, err := sdk.ParseCoinNormalized(args[6]) if err != nil { return err } - kind := args[6] - numProvidersInt, err := strconv.Atoi(args[7]) if err != nil { - return fmt.Errorf("invalid num-providers value: %w", err) + return err } numProviders := int32(numProvidersInt) msg := auctiontypes.NewMsgCreateAuction( + kind, commitsDuration, revealsDuration, commitFee, @@ -188,7 +189,6 @@ func GetCmdCreateAuction() *cobra.Command { minimumBid, maxPrice, numProviders, - kind, clientCtx.GetFromAddress(), ) err = msg.ValidateBasic() diff --git a/x/auction/module/autocli.go b/x/auction/module/autocli.go index f9df6543..b1214695 100644 --- a/x/auction/module/autocli.go +++ b/x/auction/module/autocli.go @@ -81,14 +81,17 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { RpcCommandOptions: []*autocliv1.RpcCommandOptions{ { RpcMethod: "CreateAuction", - Use: "create [commits-duration] [reveals-duration] [commit-fee] [reveal-fee] [minimum-bid]", + Use: "create [kind] [commits-duration] [reveals-duration] [commit-fee] [reveal-fee] [minimum-bid] [max-price] [num-providers]", 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"}, }, }, { diff --git a/x/auction/msgs.go b/x/auction/msgs.go index 2ed0cc69..7634135f 100644 --- a/x/auction/msgs.go +++ b/x/auction/msgs.go @@ -17,6 +17,7 @@ var ( // NewMsgCreateAuction is the constructor function for MsgCreateAuction. func NewMsgCreateAuction( + kind string, commitsDuration time.Duration, revealsDuration time.Duration, commitFee sdk.Coin, @@ -24,7 +25,6 @@ func NewMsgCreateAuction( minimumBid sdk.Coin, maxPrice sdk.Coin, numProviders int32, - kind string, signer sdk.AccAddress, ) MsgCreateAuction { fmt.Print(signer.String()) @@ -56,20 +56,30 @@ func (msg MsgCreateAuction) ValidateBasic() error { return errorsmod.Wrap(sdkerrors.ErrInvalidAddress, msg.Signer) } + if msg.Kind != AuctionKindVickrey && msg.Kind != AuctionKindProvider { + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, fmt.Sprintf("auction kind should be one of %s | %s", AuctionKindVickrey, AuctionKindProvider)) + } + if msg.CommitsDuration <= 0 { - return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "commit phase duration invalid.") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "commit phase duration invalid") } if msg.RevealsDuration <= 0 { - return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "reveal phase duration invalid.") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "reveal phase duration invalid") } if msg.Kind == AuctionKindVickrey && !msg.MinimumBid.IsPositive() { - return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "minimum bid should be greater than zero.") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, fmt.Sprintf("minimum bid should be greater than zero for %s auction", AuctionKindVickrey)) } - if msg.Kind == AuctionKindProvider && !msg.MaxPrice.IsPositive() { - return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "maximum price should be greater than zero.") + if msg.Kind == AuctionKindProvider { + if !msg.MaxPrice.IsPositive() { + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, fmt.Sprintf("max price should be greater than zero for %s auction", AuctionKindProvider)) + } + + if msg.NumProviders <= 0 { + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, fmt.Sprintf("num providers should be greater than zero for %s auction", AuctionKindProvider)) + } } return nil diff --git a/x/registry/keeper/naming_keeper.go b/x/registry/keeper/naming_keeper.go index 4358d5ec..963da40d 100644 --- a/x/registry/keeper/naming_keeper.go +++ b/x/registry/keeper/naming_keeper.go @@ -289,14 +289,14 @@ func (k Keeper) createAuthority(ctx sdk.Context, name string, owner string, isRo // Create an auction. msg := auctiontypes.NewMsgCreateAuction( + auctiontypes.AuctionKindVickrey, moduleParams.AuthorityAuctionCommitsDuration, moduleParams.AuthorityAuctionRevealsDuration, moduleParams.AuthorityAuctionCommitFee, moduleParams.AuthorityAuctionRevealFee, moduleParams.AuthorityAuctionMinimumBid, sdk.NewCoin("alnt", math.NewInt(0)), - int32(1), - auctiontypes.AuctionKindVickrey, + 0, ownerAddress, ) -- 2.45.2 From 7901e5f0f0ff7d171c1bf93d7a6c303e5b884e93 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Thu, 19 Sep 2024 15:08:38 +0530 Subject: [PATCH 16/29] Remove unused auction module params --- api/cerc/auction/v1/auction.pulsar.go | 802 ++++-------------- cmd/laconicd/cmd/root.go | 4 +- proto/cerc/auction/v1/auction.proto | 39 +- .../auction/keeper/query_server_test.go | 28 +- x/auction/auction.pb.go | 432 ++-------- x/auction/params.go | 134 +-- x/registry/keeper/naming_keeper.go | 2 +- 7 files changed, 255 insertions(+), 1186 deletions(-) diff --git a/api/cerc/auction/v1/auction.pulsar.go b/api/cerc/auction/v1/auction.pulsar.go index 74085a45..aab5ae86 100644 --- a/api/cerc/auction/v1/auction.pulsar.go +++ b/api/cerc/auction/v1/auction.pulsar.go @@ -9,7 +9,6 @@ import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - durationpb "google.golang.org/protobuf/types/known/durationpb" timestamppb "google.golang.org/protobuf/types/known/timestamppb" io "io" reflect "reflect" @@ -17,22 +16,12 @@ import ( ) var ( - md_Params protoreflect.MessageDescriptor - fd_Params_commits_duration protoreflect.FieldDescriptor - fd_Params_reveals_duration protoreflect.FieldDescriptor - fd_Params_commit_fee protoreflect.FieldDescriptor - fd_Params_reveal_fee protoreflect.FieldDescriptor - fd_Params_minimum_bid protoreflect.FieldDescriptor + md_Params protoreflect.MessageDescriptor ) func init() { file_cerc_auction_v1_auction_proto_init() md_Params = File_cerc_auction_v1_auction_proto.Messages().ByName("Params") - fd_Params_commits_duration = md_Params.Fields().ByName("commits_duration") - fd_Params_reveals_duration = md_Params.Fields().ByName("reveals_duration") - fd_Params_commit_fee = md_Params.Fields().ByName("commit_fee") - fd_Params_reveal_fee = md_Params.Fields().ByName("reveal_fee") - fd_Params_minimum_bid = md_Params.Fields().ByName("minimum_bid") } var _ protoreflect.Message = (*fastReflection_Params)(nil) @@ -100,36 +89,6 @@ func (x *fastReflection_Params) Interface() protoreflect.ProtoMessage { // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.CommitsDuration != nil { - value := protoreflect.ValueOfMessage(x.CommitsDuration.ProtoReflect()) - if !f(fd_Params_commits_duration, value) { - return - } - } - if x.RevealsDuration != nil { - value := protoreflect.ValueOfMessage(x.RevealsDuration.ProtoReflect()) - if !f(fd_Params_reveals_duration, value) { - return - } - } - if x.CommitFee != nil { - value := protoreflect.ValueOfMessage(x.CommitFee.ProtoReflect()) - if !f(fd_Params_commit_fee, value) { - return - } - } - if x.RevealFee != nil { - value := protoreflect.ValueOfMessage(x.RevealFee.ProtoReflect()) - if !f(fd_Params_reveal_fee, value) { - return - } - } - if x.MinimumBid != nil { - value := protoreflect.ValueOfMessage(x.MinimumBid.ProtoReflect()) - if !f(fd_Params_minimum_bid, value) { - return - } - } } // Has reports whether a field is populated. @@ -145,16 +104,6 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto // a repeated field is populated if it is non-empty. func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "cerc.auction.v1.Params.commits_duration": - return x.CommitsDuration != nil - case "cerc.auction.v1.Params.reveals_duration": - return x.RevealsDuration != nil - case "cerc.auction.v1.Params.commit_fee": - return x.CommitFee != nil - case "cerc.auction.v1.Params.reveal_fee": - return x.RevealFee != nil - case "cerc.auction.v1.Params.minimum_bid": - return x.MinimumBid != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.v1.Params")) @@ -171,16 +120,6 @@ func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "cerc.auction.v1.Params.commits_duration": - x.CommitsDuration = nil - case "cerc.auction.v1.Params.reveals_duration": - x.RevealsDuration = nil - case "cerc.auction.v1.Params.commit_fee": - x.CommitFee = nil - case "cerc.auction.v1.Params.reveal_fee": - x.RevealFee = nil - case "cerc.auction.v1.Params.minimum_bid": - x.MinimumBid = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.v1.Params")) @@ -197,21 +136,6 @@ func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "cerc.auction.v1.Params.commits_duration": - value := x.CommitsDuration - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "cerc.auction.v1.Params.reveals_duration": - value := x.RevealsDuration - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "cerc.auction.v1.Params.commit_fee": - value := x.CommitFee - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "cerc.auction.v1.Params.reveal_fee": - value := x.RevealFee - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "cerc.auction.v1.Params.minimum_bid": - value := x.MinimumBid - return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.v1.Params")) @@ -232,16 +156,6 @@ func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) pro // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "cerc.auction.v1.Params.commits_duration": - x.CommitsDuration = value.Message().Interface().(*durationpb.Duration) - case "cerc.auction.v1.Params.reveals_duration": - x.RevealsDuration = value.Message().Interface().(*durationpb.Duration) - case "cerc.auction.v1.Params.commit_fee": - x.CommitFee = value.Message().Interface().(*v1beta1.Coin) - case "cerc.auction.v1.Params.reveal_fee": - x.RevealFee = value.Message().Interface().(*v1beta1.Coin) - case "cerc.auction.v1.Params.minimum_bid": - x.MinimumBid = value.Message().Interface().(*v1beta1.Coin) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.v1.Params")) @@ -262,31 +176,6 @@ func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value proto // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cerc.auction.v1.Params.commits_duration": - if x.CommitsDuration == nil { - x.CommitsDuration = new(durationpb.Duration) - } - return protoreflect.ValueOfMessage(x.CommitsDuration.ProtoReflect()) - case "cerc.auction.v1.Params.reveals_duration": - if x.RevealsDuration == nil { - x.RevealsDuration = new(durationpb.Duration) - } - return protoreflect.ValueOfMessage(x.RevealsDuration.ProtoReflect()) - case "cerc.auction.v1.Params.commit_fee": - if x.CommitFee == nil { - x.CommitFee = new(v1beta1.Coin) - } - return protoreflect.ValueOfMessage(x.CommitFee.ProtoReflect()) - case "cerc.auction.v1.Params.reveal_fee": - if x.RevealFee == nil { - x.RevealFee = new(v1beta1.Coin) - } - return protoreflect.ValueOfMessage(x.RevealFee.ProtoReflect()) - case "cerc.auction.v1.Params.minimum_bid": - if x.MinimumBid == nil { - x.MinimumBid = new(v1beta1.Coin) - } - return protoreflect.ValueOfMessage(x.MinimumBid.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.v1.Params")) @@ -300,21 +189,6 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cerc.auction.v1.Params.commits_duration": - m := new(durationpb.Duration) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "cerc.auction.v1.Params.reveals_duration": - m := new(durationpb.Duration) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "cerc.auction.v1.Params.commit_fee": - m := new(v1beta1.Coin) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "cerc.auction.v1.Params.reveal_fee": - m := new(v1beta1.Coin) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "cerc.auction.v1.Params.minimum_bid": - m := new(v1beta1.Coin) - return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.v1.Params")) @@ -384,26 +258,6 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - if x.CommitsDuration != nil { - l = options.Size(x.CommitsDuration) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.RevealsDuration != nil { - l = options.Size(x.RevealsDuration) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.CommitFee != nil { - l = options.Size(x.CommitFee) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.RevealFee != nil { - l = options.Size(x.RevealFee) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.MinimumBid != nil { - l = options.Size(x.MinimumBid) - n += 1 + l + runtime.Sov(uint64(l)) - } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -433,76 +287,6 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.MinimumBid != nil { - encoded, err := options.Marshal(x.MinimumBid) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x2a - } - if x.RevealFee != nil { - encoded, err := options.Marshal(x.RevealFee) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x22 - } - if x.CommitFee != nil { - encoded, err := options.Marshal(x.CommitFee) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x1a - } - if x.RevealsDuration != nil { - encoded, err := options.Marshal(x.RevealsDuration) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x12 - } - if x.CommitsDuration != nil { - encoded, err := options.Marshal(x.CommitsDuration) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0xa - } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) } else { @@ -552,186 +336,6 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CommitsDuration", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.CommitsDuration == nil { - x.CommitsDuration = &durationpb.Duration{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.CommitsDuration); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RevealsDuration", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.RevealsDuration == nil { - x.RevealsDuration = &durationpb.Duration{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.RevealsDuration); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CommitFee", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.CommitFee == nil { - x.CommitFee = &v1beta1.Coin{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.CommitFee); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RevealFee", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.RevealFee == nil { - x.RevealFee = &v1beta1.Coin{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.RevealFee); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MinimumBid", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.MinimumBid == nil { - x.MinimumBid = &v1beta1.Coin{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.MinimumBid); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -3840,18 +3444,6 @@ type Params struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - - // Duration of the commits phase in seconds - CommitsDuration *durationpb.Duration `protobuf:"bytes,1,opt,name=commits_duration,json=commitsDuration,proto3" json:"commits_duration,omitempty"` - // Duration of the reveals phase in seconds - RevealsDuration *durationpb.Duration `protobuf:"bytes,2,opt,name=reveals_duration,json=revealsDuration,proto3" json:"reveals_duration,omitempty"` - // Commit fees - CommitFee *v1beta1.Coin `protobuf:"bytes,3,opt,name=commit_fee,json=commitFee,proto3" json:"commit_fee,omitempty"` - // Reveal fees - RevealFee *v1beta1.Coin `protobuf:"bytes,4,opt,name=reveal_fee,json=revealFee,proto3" json:"reveal_fee,omitempty"` - // Minimum acceptable bid amount - // Only applicable in vickrey auctions - MinimumBid *v1beta1.Coin `protobuf:"bytes,5,opt,name=minimum_bid,json=minimumBid,proto3" json:"minimum_bid,omitempty"` } func (x *Params) Reset() { @@ -3874,41 +3466,6 @@ func (*Params) Descriptor() ([]byte, []int) { return file_cerc_auction_v1_auction_proto_rawDescGZIP(), []int{0} } -func (x *Params) GetCommitsDuration() *durationpb.Duration { - if x != nil { - return x.CommitsDuration - } - return nil -} - -func (x *Params) GetRevealsDuration() *durationpb.Duration { - if x != nil { - return x.RevealsDuration - } - return nil -} - -func (x *Params) GetCommitFee() *v1beta1.Coin { - if x != nil { - return x.CommitFee - } - return nil -} - -func (x *Params) GetRevealFee() *v1beta1.Coin { - if x != nil { - return x.RevealFee - } - return nil -} - -func (x *Params) GetMinimumBid() *v1beta1.Coin { - if x != nil { - return x.MinimumBid - } - return nil -} - // Auction represents a sealed-bid on-chain auction type Auction struct { state protoimpl.MessageState @@ -4221,187 +3778,148 @@ var file_cerc_auction_v1_auction_proto_rawDesc = []byte{ 0x31, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xcf, 0x04, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x12, 0x81, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x5f, 0x64, - 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x3b, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, - 0x1f, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x5f, - 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, - 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x22, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x44, 0x75, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x81, 0x01, 0x0a, 0x10, 0x72, 0x65, 0x76, 0x65, 0x61, - 0x6c, 0x73, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x3b, 0xc8, 0xde, - 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x72, 0x65, 0x76, 0x65, - 0x61, 0x6c, 0x73, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x20, 0x79, 0x61, - 0x6d, 0x6c, 0x3a, 0x22, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x73, 0x5f, 0x64, 0x75, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x0f, 0x72, 0x65, 0x76, 0x65, 0x61, - 0x6c, 0x73, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x65, 0x0a, 0x0a, 0x63, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, - 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xf2, - 0xde, 0x1f, 0x23, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, - 0x66, 0x65, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x5f, 0x66, 0x65, 0x65, 0x22, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x46, 0x65, - 0x65, 0x12, 0x65, 0x0a, 0x0a, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x66, 0x65, 0x65, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, - 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, - 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x23, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, - 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x66, 0x65, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, - 0x3a, 0x22, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x66, 0x65, 0x65, 0x22, 0x52, 0x09, 0x72, - 0x65, 0x76, 0x65, 0x61, 0x6c, 0x46, 0x65, 0x65, 0x12, 0x69, 0x0a, 0x0b, 0x6d, 0x69, 0x6e, 0x69, - 0x6d, 0x75, 0x6d, 0x5f, 0x62, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x2d, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, - 0x1f, 0x25, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x5f, - 0x62, 0x69, 0x64, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6d, 0x69, 0x6e, 0x69, 0x6d, - 0x75, 0x6d, 0x5f, 0x62, 0x69, 0x64, 0x22, 0x52, 0x0a, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, - 0x42, 0x69, 0x64, 0x3a, 0x04, 0x98, 0xa0, 0x1f, 0x00, 0x22, 0xd3, 0x09, 0x0a, 0x07, 0x41, 0x75, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2f, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x1b, 0xf2, 0xde, 0x1f, 0x17, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6b, - 0x69, 0x6e, 0x64, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6b, 0x69, 0x6e, 0x64, 0x22, - 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x23, - 0x0a, 0x0d, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x12, 0x6e, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, - 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x25, 0x6a, 0x73, - 0x6f, 0x6e, 0x3a, 0x22, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, - 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, - 0x6d, 0x65, 0x22, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, - 0x69, 0x6d, 0x65, 0x12, 0x81, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x5f, - 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x3b, 0xc8, 0xde, 0x1f, 0x00, - 0xf2, 0xde, 0x1f, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x73, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, - 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, - 0x6d, 0x65, 0x22, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, - 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x81, 0x01, 0x0a, 0x10, 0x72, 0x65, 0x76, 0x65, - 0x61, 0x6c, 0x73, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x3b, - 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x72, 0x65, - 0x76, 0x65, 0x61, 0x6c, 0x73, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x20, - 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x73, 0x5f, 0x65, 0x6e, - 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0e, 0x72, 0x65, 0x76, - 0x65, 0x61, 0x6c, 0x73, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x65, 0x0a, 0x0a, 0x63, - 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, - 0xf2, 0xde, 0x1f, 0x23, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x5f, 0x66, 0x65, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x5f, 0x66, 0x65, 0x65, 0x22, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x46, - 0x65, 0x65, 0x12, 0x65, 0x0a, 0x0a, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x66, 0x65, 0x65, - 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, - 0x6e, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x23, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, - 0x22, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x66, 0x65, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d, - 0x6c, 0x3a, 0x22, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x66, 0x65, 0x65, 0x22, 0x52, 0x09, - 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x46, 0x65, 0x65, 0x12, 0x69, 0x0a, 0x0b, 0x6d, 0x69, 0x6e, - 0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x62, 0x69, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, - 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x2d, 0xc8, 0xde, 0x1f, 0x00, 0xf2, - 0xde, 0x1f, 0x25, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, - 0x5f, 0x62, 0x69, 0x64, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6d, 0x69, 0x6e, 0x69, - 0x6d, 0x75, 0x6d, 0x5f, 0x62, 0x69, 0x64, 0x22, 0x52, 0x0a, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, - 0x6d, 0x42, 0x69, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x77, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, - 0x77, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x12, - 0x6d, 0x0a, 0x0c, 0x77, 0x69, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x69, 0x64, 0x73, 0x18, - 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, - 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, - 0x42, 0x2f, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x27, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, - 0x77, 0x69, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x69, 0x64, 0x73, 0x22, 0x20, 0x79, 0x61, - 0x6d, 0x6c, 0x3a, 0x22, 0x77, 0x69, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x69, 0x64, 0x73, - 0x22, 0x52, 0x0b, 0x77, 0x69, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x42, 0x69, 0x64, 0x73, 0x12, 0x71, - 0x0a, 0x0d, 0x77, 0x69, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, - 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, - 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, - 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x29, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, - 0x77, 0x69, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x22, 0x20, 0x79, - 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x77, 0x69, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x72, 0x69, - 0x63, 0x65, 0x22, 0x52, 0x0c, 0x77, 0x69, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x69, 0x63, - 0x65, 0x12, 0x61, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x0e, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, - 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, - 0x29, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x21, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6d, - 0x61, 0x78, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, - 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x22, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x50, - 0x72, 0x69, 0x63, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x6e, 0x75, 0x6d, 0x5f, 0x70, 0x72, 0x6f, 0x76, - 0x69, 0x64, 0x65, 0x72, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6e, 0x75, 0x6d, - 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x22, - 0x4c, 0x0a, 0x08, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3a, 0x0a, 0x08, 0x61, - 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, - 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, - 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x08, 0x61, - 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x22, 0x9f, 0x05, - 0x0a, 0x03, 0x42, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x5f, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x62, 0x69, - 0x64, 0x64, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x68, 0x61, - 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x48, 0x61, 0x73, 0x68, 0x12, 0x6e, 0x0a, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x74, - 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x25, 0x6a, - 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, - 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x74, - 0x69, 0x6d, 0x65, 0x22, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x54, 0x69, 0x6d, 0x65, 0x12, 0x65, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x66, - 0x65, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, - 0x6f, 0x69, 0x6e, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x23, 0x6a, 0x73, 0x6f, - 0x6e, 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x66, 0x65, 0x65, 0x22, 0x20, 0x79, - 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x66, 0x65, 0x65, 0x22, - 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x46, 0x65, 0x65, 0x12, 0x6e, 0x0a, 0x0b, 0x72, - 0x65, 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x08, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x22, 0xd3, 0x09, 0x0a, 0x07, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2f, 0x0a, + 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1b, 0xf2, 0xde, 0x1f, + 0x17, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6b, 0x69, 0x6e, 0x64, 0x22, 0x20, 0x79, 0x61, 0x6d, + 0x6c, 0x3a, 0x22, 0x6b, 0x69, 0x6e, 0x64, 0x22, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x16, + 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6f, + 0x77, 0x6e, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x6e, 0x0a, 0x0b, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x31, 0xc8, 0xde, - 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x25, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x72, 0x65, 0x76, 0x65, - 0x61, 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x72, - 0x65, 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x90, 0xdf, 0x1f, 0x01, 0x52, - 0x0a, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x65, 0x0a, 0x0a, 0x72, - 0x65, 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, - 0xf2, 0xde, 0x1f, 0x23, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, - 0x5f, 0x66, 0x65, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x72, 0x65, 0x76, 0x65, - 0x61, 0x6c, 0x5f, 0x66, 0x65, 0x65, 0x22, 0x52, 0x09, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x46, - 0x65, 0x65, 0x12, 0x65, 0x0a, 0x0a, 0x62, 0x69, 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x25, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x90, 0xdf, 0x1f, 0x01, 0x52, + 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x81, 0x01, 0x0a, 0x10, + 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x42, 0x3b, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, + 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, + 0x6d, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x73, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x90, 0xdf, 0x1f, 0x01, 0x52, + 0x0e, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, + 0x81, 0x01, 0x0a, 0x10, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x73, 0x5f, 0x65, 0x6e, 0x64, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x3b, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x2f, + 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x73, 0x5f, 0x65, 0x6e, + 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x72, 0x65, + 0x76, 0x65, 0x61, 0x6c, 0x73, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x90, + 0xdf, 0x1f, 0x01, 0x52, 0x0e, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x73, 0x45, 0x6e, 0x64, 0x54, + 0x69, 0x6d, 0x65, 0x12, 0x65, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x66, 0x65, + 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, + 0x69, 0x6e, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x23, 0x6a, 0x73, 0x6f, 0x6e, + 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x66, 0x65, 0x65, 0x22, 0x20, 0x79, 0x61, + 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x66, 0x65, 0x65, 0x22, 0x52, + 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x46, 0x65, 0x65, 0x12, 0x65, 0x0a, 0x0a, 0x72, 0x65, + 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xf2, + 0xde, 0x1f, 0x23, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x5f, + 0x66, 0x65, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x72, 0x65, 0x76, 0x65, 0x61, + 0x6c, 0x5f, 0x66, 0x65, 0x65, 0x22, 0x52, 0x09, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x46, 0x65, + 0x65, 0x12, 0x69, 0x0a, 0x0b, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x62, 0x69, 0x64, + 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, - 0x6e, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x23, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, - 0x22, 0x62, 0x69, 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x20, 0x79, 0x61, 0x6d, - 0x6c, 0x3a, 0x22, 0x62, 0x69, 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x52, 0x09, - 0x62, 0x69, 0x64, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x42, - 0xbc, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x2e, 0x76, 0x64, 0x62, - 0x2e, 0x74, 0x6f, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2d, 0x69, 0x6f, 0x2f, 0x6c, 0x61, 0x63, 0x6f, - 0x6e, 0x69, 0x63, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x61, 0x75, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x41, 0x58, 0xaa, 0x02, 0x0f, 0x43, 0x65, 0x72, 0x63, 0x2e, - 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x43, 0x65, 0x72, - 0x63, 0x5c, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1b, 0x43, - 0x65, 0x72, 0x63, 0x5c, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x43, 0x65, 0x72, - 0x63, 0x3a, 0x3a, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x42, 0x2d, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x25, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, + 0x22, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x62, 0x69, 0x64, 0x22, 0x20, 0x79, 0x61, + 0x6d, 0x6c, 0x3a, 0x22, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x62, 0x69, 0x64, 0x22, + 0x52, 0x0a, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x42, 0x69, 0x64, 0x12, 0x29, 0x0a, 0x10, + 0x77, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, + 0x18, 0x0b, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x77, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x12, 0x6d, 0x0a, 0x0c, 0x77, 0x69, 0x6e, 0x6e, 0x69, + 0x6e, 0x67, 0x5f, 0x62, 0x69, 0x64, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x2f, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, + 0x1f, 0x27, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x77, 0x69, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x5f, + 0x62, 0x69, 0x64, 0x73, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x77, 0x69, 0x6e, 0x6e, + 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x69, 0x64, 0x73, 0x22, 0x52, 0x0b, 0x77, 0x69, 0x6e, 0x6e, 0x69, + 0x6e, 0x67, 0x42, 0x69, 0x64, 0x73, 0x12, 0x71, 0x0a, 0x0d, 0x77, 0x69, 0x6e, 0x6e, 0x69, 0x6e, + 0x67, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, + 0x1f, 0x29, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x77, 0x69, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x5f, + 0x70, 0x72, 0x69, 0x63, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x77, 0x69, 0x6e, + 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x22, 0x52, 0x0c, 0x77, 0x69, 0x6e, + 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x61, 0x0a, 0x09, 0x6d, 0x61, 0x78, + 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x29, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, + 0x21, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, + 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x72, 0x69, 0x63, + 0x65, 0x22, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x23, 0x0a, 0x0d, + 0x6e, 0x75, 0x6d, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x18, 0x0f, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6e, 0x75, 0x6d, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, + 0x73, 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x22, 0x4c, 0x0a, 0x08, 0x41, 0x75, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x3a, 0x0a, 0x08, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, + 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x08, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, + 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x22, 0x9f, 0x05, 0x0a, 0x03, 0x42, 0x69, 0x64, 0x12, 0x1d, 0x0a, + 0x0a, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, + 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x63, + 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x6e, 0x0a, 0x0b, + 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x31, 0xc8, + 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x25, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x63, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, + 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x90, 0xdf, 0x1f, 0x01, + 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x65, 0x0a, 0x0a, + 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x2b, 0xc8, 0xde, 0x1f, + 0x00, 0xf2, 0xde, 0x1f, 0x23, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x5f, 0x66, 0x65, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x5f, 0x66, 0x65, 0x65, 0x22, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x46, 0x65, 0x65, 0x12, 0x6e, 0x0a, 0x0b, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x74, 0x69, + 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x25, 0x6a, 0x73, + 0x6f, 0x6e, 0x3a, 0x22, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, + 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x74, 0x69, + 0x6d, 0x65, 0x22, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0a, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x54, + 0x69, 0x6d, 0x65, 0x12, 0x65, 0x0a, 0x0a, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x66, 0x65, + 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, + 0x69, 0x6e, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x23, 0x6a, 0x73, 0x6f, 0x6e, + 0x3a, 0x22, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x66, 0x65, 0x65, 0x22, 0x20, 0x79, 0x61, + 0x6d, 0x6c, 0x3a, 0x22, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x66, 0x65, 0x65, 0x22, 0x52, + 0x09, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x46, 0x65, 0x65, 0x12, 0x65, 0x0a, 0x0a, 0x62, 0x69, + 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xf2, + 0xde, 0x1f, 0x23, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x62, 0x69, 0x64, 0x5f, 0x61, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x62, 0x69, 0x64, 0x5f, 0x61, + 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x52, 0x09, 0x62, 0x69, 0x64, 0x41, 0x6d, 0x6f, 0x75, 0x6e, + 0x74, 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x42, 0xbc, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, + 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x42, + 0x0c, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x39, 0x67, 0x69, 0x74, 0x2e, 0x76, 0x64, 0x62, 0x2e, 0x74, 0x6f, 0x2f, 0x63, 0x65, 0x72, 0x63, + 0x2d, 0x69, 0x6f, 0x2f, 0x6c, 0x61, 0x63, 0x6f, 0x6e, 0x69, 0x63, 0x64, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, + 0x3b, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x41, 0x58, + 0xaa, 0x02, 0x0f, 0x43, 0x65, 0x72, 0x63, 0x2e, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x56, 0x31, 0xca, 0x02, 0x0f, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1b, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x41, 0x75, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x11, 0x43, 0x65, 0x72, 0x63, 0x3a, 0x3a, 0x41, 0x75, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -4422,36 +3940,30 @@ var file_cerc_auction_v1_auction_proto_goTypes = []interface{}{ (*Auction)(nil), // 1: cerc.auction.v1.Auction (*Auctions)(nil), // 2: cerc.auction.v1.Auctions (*Bid)(nil), // 3: cerc.auction.v1.Bid - (*durationpb.Duration)(nil), // 4: google.protobuf.Duration + (*timestamppb.Timestamp)(nil), // 4: google.protobuf.Timestamp (*v1beta1.Coin)(nil), // 5: cosmos.base.v1beta1.Coin - (*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp } var file_cerc_auction_v1_auction_proto_depIdxs = []int32{ - 4, // 0: cerc.auction.v1.Params.commits_duration:type_name -> google.protobuf.Duration - 4, // 1: cerc.auction.v1.Params.reveals_duration:type_name -> google.protobuf.Duration - 5, // 2: cerc.auction.v1.Params.commit_fee:type_name -> cosmos.base.v1beta1.Coin - 5, // 3: cerc.auction.v1.Params.reveal_fee:type_name -> cosmos.base.v1beta1.Coin - 5, // 4: cerc.auction.v1.Params.minimum_bid:type_name -> cosmos.base.v1beta1.Coin - 6, // 5: cerc.auction.v1.Auction.create_time:type_name -> google.protobuf.Timestamp - 6, // 6: cerc.auction.v1.Auction.commits_end_time:type_name -> google.protobuf.Timestamp - 6, // 7: cerc.auction.v1.Auction.reveals_end_time:type_name -> google.protobuf.Timestamp - 5, // 8: cerc.auction.v1.Auction.commit_fee:type_name -> cosmos.base.v1beta1.Coin - 5, // 9: cerc.auction.v1.Auction.reveal_fee:type_name -> cosmos.base.v1beta1.Coin - 5, // 10: cerc.auction.v1.Auction.minimum_bid:type_name -> cosmos.base.v1beta1.Coin - 5, // 11: cerc.auction.v1.Auction.winning_bids:type_name -> cosmos.base.v1beta1.Coin - 5, // 12: cerc.auction.v1.Auction.winning_price:type_name -> cosmos.base.v1beta1.Coin - 5, // 13: cerc.auction.v1.Auction.max_price:type_name -> cosmos.base.v1beta1.Coin - 1, // 14: cerc.auction.v1.Auctions.auctions:type_name -> cerc.auction.v1.Auction - 6, // 15: cerc.auction.v1.Bid.commit_time:type_name -> google.protobuf.Timestamp - 5, // 16: cerc.auction.v1.Bid.commit_fee:type_name -> cosmos.base.v1beta1.Coin - 6, // 17: cerc.auction.v1.Bid.reveal_time:type_name -> google.protobuf.Timestamp - 5, // 18: cerc.auction.v1.Bid.reveal_fee:type_name -> cosmos.base.v1beta1.Coin - 5, // 19: cerc.auction.v1.Bid.bid_amount:type_name -> cosmos.base.v1beta1.Coin - 20, // [20:20] is the sub-list for method output_type - 20, // [20:20] is the sub-list for method input_type - 20, // [20:20] is the sub-list for extension type_name - 20, // [20:20] is the sub-list for extension extendee - 0, // [0:20] is the sub-list for field type_name + 4, // 0: cerc.auction.v1.Auction.create_time:type_name -> google.protobuf.Timestamp + 4, // 1: cerc.auction.v1.Auction.commits_end_time:type_name -> google.protobuf.Timestamp + 4, // 2: cerc.auction.v1.Auction.reveals_end_time:type_name -> google.protobuf.Timestamp + 5, // 3: cerc.auction.v1.Auction.commit_fee:type_name -> cosmos.base.v1beta1.Coin + 5, // 4: cerc.auction.v1.Auction.reveal_fee:type_name -> cosmos.base.v1beta1.Coin + 5, // 5: cerc.auction.v1.Auction.minimum_bid:type_name -> cosmos.base.v1beta1.Coin + 5, // 6: cerc.auction.v1.Auction.winning_bids:type_name -> cosmos.base.v1beta1.Coin + 5, // 7: cerc.auction.v1.Auction.winning_price:type_name -> cosmos.base.v1beta1.Coin + 5, // 8: cerc.auction.v1.Auction.max_price:type_name -> cosmos.base.v1beta1.Coin + 1, // 9: cerc.auction.v1.Auctions.auctions:type_name -> cerc.auction.v1.Auction + 4, // 10: cerc.auction.v1.Bid.commit_time:type_name -> google.protobuf.Timestamp + 5, // 11: cerc.auction.v1.Bid.commit_fee:type_name -> cosmos.base.v1beta1.Coin + 4, // 12: cerc.auction.v1.Bid.reveal_time:type_name -> google.protobuf.Timestamp + 5, // 13: cerc.auction.v1.Bid.reveal_fee:type_name -> cosmos.base.v1beta1.Coin + 5, // 14: cerc.auction.v1.Bid.bid_amount:type_name -> cosmos.base.v1beta1.Coin + 15, // [15:15] is the sub-list for method output_type + 15, // [15:15] is the sub-list for method input_type + 15, // [15:15] is the sub-list for extension type_name + 15, // [15:15] is the sub-list for extension extendee + 0, // [0:15] is the sub-list for field type_name } func init() { file_cerc_auction_v1_auction_proto_init() } diff --git a/cmd/laconicd/cmd/root.go b/cmd/laconicd/cmd/root.go index 3fdb0341..af1cd19e 100644 --- a/cmd/laconicd/cmd/root.go +++ b/cmd/laconicd/cmd/root.go @@ -1,6 +1,7 @@ package cmd import ( + "fmt" "os" "time" @@ -20,6 +21,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keyring" "github.com/cosmos/cosmos-sdk/server" serverconfig "github.com/cosmos/cosmos-sdk/server/config" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/cosmos/cosmos-sdk/x/auth/tx" @@ -98,7 +100,7 @@ func NewRootCmd() *cobra.Command { // overwrite the minimum gas price from the app configuration srvCfg := serverconfig.DefaultConfig() - srvCfg.MinGasPrices = "0alnt" + srvCfg.MinGasPrices = fmt.Sprintf("0%s", sdk.DefaultBondDenom) // overwrite the block timeout cmtCfg := cmtcfg.DefaultConfig() diff --git a/proto/cerc/auction/v1/auction.proto b/proto/cerc/auction/v1/auction.proto index 7483d1ea..b0b31a11 100644 --- a/proto/cerc/auction/v1/auction.proto +++ b/proto/cerc/auction/v1/auction.proto @@ -3,50 +3,13 @@ syntax = "proto3"; package cerc.auction.v1; import "gogoproto/gogo.proto"; -import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; import "cosmos/base/v1beta1/coin.proto"; option go_package = "git.vdb.to/cerc-io/laconicd/x/auction"; // Params defines the auction module parameters -message Params { - // Write custom stringer method - option (gogoproto.goproto_stringer) = false; - - // Duration of the commits phase in seconds - google.protobuf.Duration commits_duration = 1 [ - (gogoproto.nullable) = false, - (gogoproto.stdduration) = true, - (gogoproto.moretags) = "json:\"commits_duration\" yaml:\"commits_duration\"" - ]; - - // Duration of the reveals phase in seconds - google.protobuf.Duration reveals_duration = 2 [ - (gogoproto.nullable) = false, - (gogoproto.stdduration) = true, - (gogoproto.moretags) = "json:\"reveals_duration\" yaml:\"reveals_duration\"" - ]; - - // Commit fees - cosmos.base.v1beta1.Coin commit_fee = 3 [ - (gogoproto.nullable) = false, - (gogoproto.moretags) = "json:\"commit_fee\" yaml:\"commit_fee\"" - ]; - - // Reveal fees - cosmos.base.v1beta1.Coin reveal_fee = 4 [ - (gogoproto.nullable) = false, - (gogoproto.moretags) = "json:\"reveal_fee\" yaml:\"reveal_fee\"" - ]; - - // Minimum acceptable bid amount - // Only applicable in vickrey auctions - cosmos.base.v1beta1.Coin minimum_bid = 5 [ - (gogoproto.nullable) = false, - (gogoproto.moretags) = "json:\"minimum_bid\" yaml:\"minimum_bid\"" - ]; -} +message Params {} // Auction represents a sealed-bid on-chain auction message Auction { diff --git a/tests/integration/auction/keeper/query_server_test.go b/tests/integration/auction/keeper/query_server_test.go index 1a8c8b53..c5e73e8e 100644 --- a/tests/integration/auction/keeper/query_server_test.go +++ b/tests/integration/auction/keeper/query_server_test.go @@ -3,8 +3,10 @@ package keeper_test import ( "context" "fmt" + "time" "cosmossdk.io/math" + sdkmath "cosmossdk.io/math" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" @@ -285,6 +287,7 @@ func (kts *KeeperTestSuite) TestGrpcGetAuctionsByOwner() { } func (kts *KeeperTestSuite) TestGrpcQueryBalance() { + testCases := []struct { msg string req *types.QueryGetAuctionModuleBalanceRequest @@ -327,24 +330,17 @@ func (kts *KeeperTestSuite) createAuctionAndCommitBid(commitBid bool) (*types.Au // Create funded account(s) accounts := simtestutil.AddTestAddrs(kts.BankKeeper, integrationTest.BondDenomProvider{}, ctx, accCount, math.NewInt(1000000)) - params, err := k.GetParams(ctx) - if err != nil { - return nil, nil, err - } - auction, err := k.CreateAuction( ctx, - types.NewMsgCreateAuction( - params.CommitsDuration, - params.RevealsDuration, - params.CommitFee, - params.RevealFee, - params.MinimumBid, - sdk.Coin{}, - int32(1), - types.AuctionKindVickrey, - accounts[0], - ), + types.MsgCreateAuction{ + Kind: types.AuctionKindVickrey, + Signer: accounts[0].String(), + CommitsDuration: 5 * time.Minute, + RevealsDuration: 5 * time.Minute, + CommitFee: sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(1000)), + RevealFee: sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(1000)), + MinimumBid: sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(1000000)), + }, ) if err != nil { return nil, nil, err diff --git a/x/auction/auction.pb.go b/x/auction/auction.pb.go index 68c0b7ed..3bbb5e5a 100644 --- a/x/auction/auction.pb.go +++ b/x/auction/auction.pb.go @@ -9,7 +9,6 @@ import ( _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" - _ "google.golang.org/protobuf/types/known/durationpb" _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" @@ -31,21 +30,11 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Params defines the auction module parameters type Params struct { - // Duration of the commits phase in seconds - CommitsDuration time.Duration `protobuf:"bytes,1,opt,name=commits_duration,json=commitsDuration,proto3,stdduration" json:"commits_duration" json:"commits_duration" yaml:"commits_duration"` - // Duration of the reveals phase in seconds - RevealsDuration time.Duration `protobuf:"bytes,2,opt,name=reveals_duration,json=revealsDuration,proto3,stdduration" json:"reveals_duration" json:"reveals_duration" yaml:"reveals_duration"` - // Commit fees - CommitFee types.Coin `protobuf:"bytes,3,opt,name=commit_fee,json=commitFee,proto3" json:"commit_fee" json:"commit_fee" yaml:"commit_fee"` - // Reveal fees - RevealFee types.Coin `protobuf:"bytes,4,opt,name=reveal_fee,json=revealFee,proto3" json:"reveal_fee" json:"reveal_fee" yaml:"reveal_fee"` - // Minimum acceptable bid amount - // Only applicable in vickrey auctions - MinimumBid types.Coin `protobuf:"bytes,5,opt,name=minimum_bid,json=minimumBid,proto3" json:"minimum_bid" json:"minimum_bid" yaml:"minimum_bid"` } -func (m *Params) Reset() { *m = Params{} } -func (*Params) ProtoMessage() {} +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} func (*Params) Descriptor() ([]byte, []int) { return fileDescriptor_34b162eb5b365523, []int{0} } @@ -76,41 +65,6 @@ func (m *Params) XXX_DiscardUnknown() { var xxx_messageInfo_Params proto.InternalMessageInfo -func (m *Params) GetCommitsDuration() time.Duration { - if m != nil { - return m.CommitsDuration - } - return 0 -} - -func (m *Params) GetRevealsDuration() time.Duration { - if m != nil { - return m.RevealsDuration - } - return 0 -} - -func (m *Params) GetCommitFee() types.Coin { - if m != nil { - return m.CommitFee - } - return types.Coin{} -} - -func (m *Params) GetRevealFee() types.Coin { - if m != nil { - return m.RevealFee - } - return types.Coin{} -} - -func (m *Params) GetMinimumBid() types.Coin { - if m != nil { - return m.MinimumBid - } - return types.Coin{} -} - // Auction represents a sealed-bid on-chain auction type Auction struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` @@ -278,63 +232,58 @@ func init() { func init() { proto.RegisterFile("cerc/auction/v1/auction.proto", fileDescriptor_34b162eb5b365523) } var fileDescriptor_34b162eb5b365523 = []byte{ - // 888 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xcf, 0x6f, 0xe3, 0x44, - 0x14, 0x8e, 0xdb, 0x34, 0x1b, 0x4f, 0x9a, 0x76, 0x65, 0x21, 0x30, 0x45, 0x9b, 0x84, 0x56, 0x15, - 0xad, 0xd0, 0xda, 0x0a, 0xdc, 0xc2, 0x01, 0xc5, 0xfc, 0x10, 0x48, 0x1c, 0x2a, 0x8b, 0x13, 0x17, - 0x6b, 0xec, 0x99, 0x4d, 0x07, 0x32, 0x33, 0xc1, 0x63, 0x67, 0xcb, 0x91, 0x1b, 0xc7, 0x3d, 0xee, - 0x0d, 0xfe, 0x9c, 0xbd, 0xb1, 0x12, 0x17, 0x4e, 0x05, 0xb5, 0xff, 0xc1, 0xfe, 0x05, 0x68, 0x7e, - 0x39, 0x8e, 0x77, 0x97, 0x10, 0xa4, 0xee, 0xcd, 0xf3, 0xcd, 0xbc, 0xf7, 0x7d, 0xf3, 0xe6, 0xbd, - 0x2f, 0x01, 0x0f, 0x32, 0x9c, 0x67, 0x21, 0x2c, 0xb3, 0x82, 0x70, 0x16, 0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 0x83, 0xd6, 0x9f, 0xb7, 0x83, 0xd6, 0x77, 0xa7, 0x33, 0x52, - 0x04, 0x4b, 0x94, 0x06, 0x05, 0x0f, 0x65, 0xd7, 0x3f, 0x24, 0x3c, 0x9c, 0xc3, 0x8c, 0x33, 0x92, - 0xa1, 0xf0, 0xca, 0xfe, 0xcd, 0x4d, 0x3b, 0xaa, 0xce, 0x1f, 0xff, 0x13, 0x00, 0x00, 0xff, 0xff, - 0x92, 0xcd, 0xec, 0xad, 0x08, 0x0b, 0x00, 0x00, + // 810 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcb, 0x6e, 0xdb, 0x46, + 0x14, 0x15, 0x2d, 0x59, 0x16, 0x47, 0x0f, 0x1b, 0x44, 0xd1, 0xb2, 0x2e, 0x2c, 0xa9, 0x32, 0x8c, + 0xca, 0x28, 0x4c, 0x42, 0xed, 0xce, 0x5d, 0x14, 0x52, 0xd1, 0xa2, 0x05, 0xba, 0x30, 0x88, 0xac, + 0xb2, 0x21, 0x86, 0x9c, 0xb1, 0x3c, 0x89, 0x66, 0x46, 0xe1, 0x50, 0xb2, 0xb3, 0xcc, 0x2e, 0x4b, + 0xff, 0x41, 0xf2, 0x39, 0x5e, 0x1a, 0xc8, 0x26, 0x2b, 0x27, 0xb0, 0xff, 0xc0, 0x5f, 0x10, 0x70, + 0x1e, 0x32, 0xc5, 0x3c, 0x14, 0x07, 0xf0, 0x8e, 0xf7, 0xcc, 0xbd, 0xf7, 0x9c, 0x3b, 0xba, 0x73, + 0x20, 0xb0, 0x13, 0xe3, 0x24, 0xf6, 0xe1, 0x2c, 0x4e, 0x09, 0x67, 0xfe, 0x7c, 0x60, 0x3e, 0xbd, + 0x69, 0xc2, 0x53, 0xee, 0x6c, 0x66, 0xc7, 0x9e, 0xc1, 0xe6, 0x83, 0xed, 0xef, 0xc6, 0x7c, 0xcc, + 0xe5, 0x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1, 0x20, 0xef, 0x8a, 0x0b, 0x6f, 0x35, 0x6f, 0x90, 0x12, 0xf9, 0x84, 0x31, 0x54, + 0x1f, 0xca, 0x18, 0x18, 0xa8, 0xeb, 0xb7, 0xfc, 0x95, 0xee, 0x57, 0x18, 0x2b, 0x57, 0x5c, 0xf0, + 0x86, 0xdc, 0x58, 0x0a, 0x31, 0x63, 0xe5, 0x8c, 0xa8, 0xf6, 0x50, 0x46, 0x84, 0x01, 0x88, 0x08, + 0x0a, 0x21, 0xe5, 0x33, 0x96, 0xde, 0xdb, 0xef, 0xee, 0x4a, 0x0d, 0x4d, 0x0e, 0x09, 0xec, 0x88, + 0xa0, 0xa1, 0xfc, 0x56, 0x1b, 0x3a, 0xfa, 0xf3, 0xe2, 0xba, 0x6d, 0x5d, 0x5e, 0xb7, 0xad, 0xf7, + 0xd7, 0x6d, 0xeb, 0xfc, 0xa6, 0x5d, 0xba, 0xbc, 0x69, 0x97, 0xde, 0xde, 0xb4, 0x4b, 0x8f, 0xf7, + 0xc6, 0x24, 0xf5, 0xe6, 0x28, 0xf2, 0x52, 0xee, 0x67, 0x5b, 0x7f, 0x40, 0xb8, 0x3f, 0x81, 0x31, + 0x67, 0x24, 0x46, 0xfe, 0x99, 0xf9, 0xfb, 0x11, 0x55, 0xe5, 0x3d, 0xff, 0xfe, 0x21, 0x00, 0x00, + 0xff, 0xff, 0x79, 0x66, 0x4c, 0x00, 0xa0, 0x08, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -357,52 +306,6 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - { - size, err := m.MinimumBid.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAuction(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - { - size, err := m.RevealFee.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAuction(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - { - size, err := m.CommitFee.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAuction(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - n4, err4 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.RevealsDuration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.RevealsDuration):]) - if err4 != nil { - return 0, err4 - } - i -= n4 - i = encodeVarintAuction(dAtA, i, uint64(n4)) - i-- - dAtA[i] = 0x12 - n5, err5 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.CommitsDuration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.CommitsDuration):]) - if err5 != nil { - return 0, err5 - } - i -= n5 - i = encodeVarintAuction(dAtA, i, uint64(n5)) - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -504,28 +407,28 @@ func (m *Auction) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x42 - n11, err11 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.RevealsEndTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.RevealsEndTime):]) - if err11 != nil { - return 0, err11 + n6, err6 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.RevealsEndTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.RevealsEndTime):]) + if err6 != nil { + return 0, err6 } - i -= n11 - i = encodeVarintAuction(dAtA, i, uint64(n11)) + i -= n6 + i = encodeVarintAuction(dAtA, i, uint64(n6)) i-- dAtA[i] = 0x3a - n12, err12 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.CommitsEndTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.CommitsEndTime):]) - if err12 != nil { - return 0, err12 + n7, err7 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.CommitsEndTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.CommitsEndTime):]) + if err7 != nil { + return 0, err7 } - i -= n12 - i = encodeVarintAuction(dAtA, i, uint64(n12)) + i -= n7 + i = encodeVarintAuction(dAtA, i, uint64(n7)) i-- dAtA[i] = 0x32 - n13, err13 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.CreateTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.CreateTime):]) - if err13 != nil { - return 0, err13 + n8, err8 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.CreateTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.CreateTime):]) + if err8 != nil { + return 0, err8 } - i -= n13 - i = encodeVarintAuction(dAtA, i, uint64(n13)) + i -= n8 + i = encodeVarintAuction(dAtA, i, uint64(n8)) i-- dAtA[i] = 0x2a if len(m.OwnerAddress) > 0 { @@ -636,12 +539,12 @@ func (m *Bid) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x42 - n16, err16 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.RevealTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.RevealTime):]) - if err16 != nil { - return 0, err16 + n11, err11 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.RevealTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.RevealTime):]) + if err11 != nil { + return 0, err11 } - i -= n16 - i = encodeVarintAuction(dAtA, i, uint64(n16)) + i -= n11 + i = encodeVarintAuction(dAtA, i, uint64(n11)) i-- dAtA[i] = 0x3a { @@ -654,12 +557,12 @@ func (m *Bid) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x32 - n18, err18 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.CommitTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.CommitTime):]) - if err18 != nil { - return 0, err18 + n13, err13 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.CommitTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.CommitTime):]) + if err13 != nil { + return 0, err13 } - i -= n18 - i = encodeVarintAuction(dAtA, i, uint64(n18)) + i -= n13 + i = encodeVarintAuction(dAtA, i, uint64(n13)) i-- dAtA[i] = 0x2a if len(m.CommitHash) > 0 { @@ -710,16 +613,6 @@ func (m *Params) Size() (n int) { } var l int _ = l - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.CommitsDuration) - n += 1 + l + sovAuction(uint64(l)) - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.RevealsDuration) - n += 1 + l + sovAuction(uint64(l)) - l = m.CommitFee.Size() - n += 1 + l + sovAuction(uint64(l)) - l = m.RevealFee.Size() - n += 1 + l + sovAuction(uint64(l)) - l = m.MinimumBid.Size() - n += 1 + l + sovAuction(uint64(l)) return n } @@ -864,171 +757,6 @@ func (m *Params) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CommitsDuration", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuction - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.CommitsDuration, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RevealsDuration", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuction - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.RevealsDuration, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CommitFee", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuction - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.CommitFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RevealFee", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuction - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.RevealFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MinimumBid", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuction - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuction - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAuction - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.MinimumBid.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipAuction(dAtA[iNdEx:]) diff --git a/x/auction/params.go b/x/auction/params.go index 766d01b7..4b4ce104 100644 --- a/x/auction/params.go +++ b/x/auction/params.go @@ -1,143 +1,11 @@ package auction -import ( - "errors" - fmt "fmt" - "strings" - time "time" - - sdkmath "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -var ( - DefaultCommitsDuration = 5 * time.Minute - DefaultRevealsDuration = 5 * time.Minute - - DefaultCommitFee = sdkmath.NewInt(1000) // 10^3 alnt - DefaultRevealFee = sdkmath.NewInt(1000) // 10^3 alnt - DefaultMinimumBid = sdkmath.NewInt(1000000) // 10^6 alnt -) - -func NewParams(commitsDuration time.Duration, revealsDuration time.Duration, commitFee sdk.Coin, revealFee sdk.Coin, minimumBid sdk.Coin) Params { - return Params{ - CommitsDuration: commitsDuration, - RevealsDuration: revealsDuration, - CommitFee: commitFee, - RevealFee: revealFee, - MinimumBid: minimumBid, - } -} - // DefaultParams returns a default set of parameters. func DefaultParams() Params { - return Params{ - CommitsDuration: DefaultCommitsDuration, - RevealsDuration: DefaultRevealsDuration, - CommitFee: sdk.NewCoin(sdk.DefaultBondDenom, DefaultCommitFee), - RevealFee: sdk.NewCoin(sdk.DefaultBondDenom, DefaultRevealFee), - MinimumBid: sdk.NewCoin(sdk.DefaultBondDenom, DefaultMinimumBid), - } -} - -// String returns a human readable string representation of the parameters. -func (p Params) String() string { - var sb strings.Builder - sb.WriteString("Params: \n") - sb.WriteString(fmt.Sprintf("CommitsDuration: %s\n", p.CommitsDuration.String())) - sb.WriteString(fmt.Sprintf("RevealsDuration: %s\n", p.RevealsDuration.String())) - sb.WriteString(fmt.Sprintf("CommitFee: %s\n", p.CommitFee.String())) - sb.WriteString(fmt.Sprintf("RevealFee: %s\n", p.RevealFee.String())) - sb.WriteString(fmt.Sprintf("MinimumBid: %s\n", p.MinimumBid.String())) - return sb.String() + return Params{} } // Validate a set of params. func (p Params) Validate() error { - if err := validateCommitsDuration(p.CommitsDuration); err != nil { - return err - } - - if err := validateRevealsDuration(p.RevealsDuration); err != nil { - return err - } - - if err := validateCommitFee(p.CommitFee); err != nil { - return err - } - - if err := validateRevealFee(p.RevealFee); err != nil { - return err - } - - if err := validateMinimumBid(p.MinimumBid); err != nil { - return err - } - - return nil -} - -func validateCommitsDuration(i interface{}) error { - v, ok := i.(time.Duration) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } - - if v < 0 { - return errors.New("commits duration cannot be negative") - } - - return nil -} - -func validateRevealsDuration(i interface{}) error { - v, ok := i.(time.Duration) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } - - if v < 0 { - return errors.New("reveals duration cannot be negative") - } - - return nil -} - -func validateCommitFee(i interface{}) error { - v, ok := i.(sdk.Coin) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } - - if v.Amount.IsNegative() { - return errors.New("commit fee must be positive") - } - - return nil -} - -func validateRevealFee(i interface{}) error { - v, ok := i.(sdk.Coin) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } - - if v.Amount.IsNegative() { - return errors.New("reveal fee must be positive") - } - - return nil -} - -func validateMinimumBid(i interface{}) error { - v, ok := i.(sdk.Coin) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } - - if v.Amount.IsNegative() { - return errors.New("minimum bid must be positive") - } - return nil } diff --git a/x/registry/keeper/naming_keeper.go b/x/registry/keeper/naming_keeper.go index 963da40d..660173cd 100644 --- a/x/registry/keeper/naming_keeper.go +++ b/x/registry/keeper/naming_keeper.go @@ -295,7 +295,7 @@ func (k Keeper) createAuthority(ctx sdk.Context, name string, owner string, isRo moduleParams.AuthorityAuctionCommitFee, moduleParams.AuthorityAuctionRevealFee, moduleParams.AuthorityAuctionMinimumBid, - sdk.NewCoin("alnt", math.NewInt(0)), + sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(0)), 0, ownerAddress, ) -- 2.45.2 From 273da5f2a9c4e15522d8d661cbb703ff15f22aea Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Thu, 19 Sep 2024 17:16:24 +0530 Subject: [PATCH 17/29] Handle failing e2e tests --- tests/e2e/auction/suite.go | 3 +++ tests/e2e/auction/tx.go | 3 +++ x/auction/client/cli/tx.go | 5 ++--- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/e2e/auction/suite.go b/tests/e2e/auction/suite.go index e055f5d7..94285a48 100644 --- a/tests/e2e/auction/suite.go +++ b/tests/e2e/auction/suite.go @@ -103,10 +103,13 @@ func (ets *E2ETestSuite) createAuctionAndBid(createAuction, createBid bool) stri if createAuction { auctionArgs := []string{ + types.AuctionKindVickrey, sampleCommitTime, sampleRevealTime, fmt.Sprintf("10%s", ets.cfg.BondDenom), fmt.Sprintf("10%s", ets.cfg.BondDenom), fmt.Sprintf("100%s", ets.cfg.BondDenom), + fmt.Sprintf("0%s", ets.cfg.BondDenom), + "0", } resp, err := ets.executeTx(cli.GetCmdCreateAuction(), auctionArgs, ownerAccount) diff --git a/tests/e2e/auction/tx.go b/tests/e2e/auction/tx.go index f259f539..1c33a073 100644 --- a/tests/e2e/auction/tx.go +++ b/tests/e2e/auction/tx.go @@ -46,10 +46,13 @@ func (ets *E2ETestSuite) TestTxCommitBid() { ets.Run(fmt.Sprintf("Case %s", test.msg), func() { if test.createAuction { auctionArgs := []string{ + auctiontypes.AuctionKindVickrey, sampleCommitTime, sampleRevealTime, fmt.Sprintf("10%s", ets.cfg.BondDenom), fmt.Sprintf("10%s", ets.cfg.BondDenom), fmt.Sprintf("100%s", ets.cfg.BondDenom), + fmt.Sprintf("0%s", ets.cfg.BondDenom), + "0", } resp, err := ets.executeTx(cli.GetCmdCreateAuction(), auctionArgs, ownerAccount) diff --git a/x/auction/client/cli/tx.go b/x/auction/client/cli/tx.go index 2f094b78..4e285f37 100644 --- a/x/auction/client/cli/tx.go +++ b/x/auction/client/cli/tx.go @@ -174,11 +174,10 @@ func GetCmdCreateAuction() *cobra.Command { return err } - numProvidersInt, err := strconv.Atoi(args[7]) + numProviders, err := strconv.ParseInt(args[7], 10, 32) if err != nil { return err } - numProviders := int32(numProvidersInt) msg := auctiontypes.NewMsgCreateAuction( kind, @@ -188,7 +187,7 @@ func GetCmdCreateAuction() *cobra.Command { revealFee, minimumBid, maxPrice, - numProviders, + int32(numProviders), clientCtx.GetFromAddress(), ) err = msg.ValidateBasic() -- 2.45.2 From 3f9b4944809a703c915cc9572e48a1f5a6ac5b26 Mon Sep 17 00:00:00 2001 From: IshaVenikar Date: Fri, 20 Sep 2024 10:37:24 +0530 Subject: [PATCH 18/29] Lock bid price in reveal phase only for vickrey auctions --- x/auction/keeper/keeper.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/x/auction/keeper/keeper.go b/x/auction/keeper/keeper.go index 8dc6e13d..9a8ec3e5 100644 --- a/x/auction/keeper/keeper.go +++ b/x/auction/keeper/keeper.go @@ -540,9 +540,11 @@ func (k Keeper) RevealBid(ctx sdk.Context, msg auctiontypes.MsgRevealBid) (*auct } // Lock bid amount. - sdkErr := k.bankKeeper.SendCoinsFromAccountToModule(ctx, signerAddress, auctiontypes.ModuleName, sdk.NewCoins(bidAmount)) - if sdkErr != nil { - return nil, sdkErr + if auction.Kind == auctiontypes.AuctionKindVickrey { + sdkErr := k.bankKeeper.SendCoinsFromAccountToModule(ctx, signerAddress, auctiontypes.ModuleName, sdk.NewCoins(bidAmount)) + if sdkErr != nil { + return nil, sdkErr + } } // Update bid. -- 2.45.2 From 93f7f17cc04e22d88d92afec8f241a70494e0fce Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Fri, 20 Sep 2024 11:54:36 +0530 Subject: [PATCH 19/29] Use stable sort for sorting bids --- x/auction/keeper/keeper.go | 42 +++++++++++++++----------------------- 1 file changed, 16 insertions(+), 26 deletions(-) diff --git a/x/auction/keeper/keeper.go b/x/auction/keeper/keeper.go index 9a8ec3e5..2cb4cde4 100644 --- a/x/auction/keeper/keeper.go +++ b/x/auction/keeper/keeper.go @@ -825,7 +825,7 @@ func (k Keeper) pickProviderAuctionWinners(ctx sdk.Context, auction *auctiontype } // Sort the valid bids - slices.SortFunc(revealedBids, func(a, b *auctiontypes.Bid) int { + slices.SortStableFunc(revealedBids, func(a, b *auctiontypes.Bid) int { if a.BidAmount.Amount.LT(b.BidAmount.Amount) { return -1 } else if a.BidAmount.Amount.GT(b.BidAmount.Amount) { @@ -887,7 +887,6 @@ func (k Keeper) pickProviderAuctionWinners(ctx sdk.Context, auction *auctiontype } // Process winner accounts (if nobody bids, there won't be a winner). - totalLockedAmount := auction.MaxPrice.Amount.Mul(math.NewInt(int64(auction.NumProviders))) if len(winnerBids) > 0 { for _, bid := range winnerBids { winnerAddress, err := sdk.AccAddressFromBech32(bid.BidderAddress) @@ -903,32 +902,23 @@ func (k Keeper) pickProviderAuctionWinners(ctx sdk.Context, auction *auctiontype panic(sdkErr) } } + } - // Send back extra amount to auction creator - totalAmountPaid := auction.WinningPrice.Amount.Mul(math.NewInt(int64(len(winnerBids)))) - extraAmount := sdk.NewCoin(auction.MaxPrice.Denom, totalLockedAmount.Sub(totalAmountPaid)) + // Send back any leftover locked amount to auction creator + // All of it in case of no winners + totalLockedAmount := auction.MaxPrice.Amount.Mul(math.NewInt(int64(auction.NumProviders))) + totalAmountPaid := auction.WinningPrice.Amount.Mul(math.NewInt(int64(len(auction.WinnerAddresses)))) + creatorLeftOverAmount := sdk.NewCoin(auction.MaxPrice.Denom, totalLockedAmount.Sub(totalAmountPaid)) - sdkErr := k.bankKeeper.SendCoinsFromModuleToAccount( - ctx, - auctiontypes.ModuleName, - sdk.AccAddress(auction.OwnerAddress), - sdk.NewCoins(extraAmount), - ) - if sdkErr != nil { - k.Logger(ctx).Error(fmt.Sprintf("Auction error returning extra locked amount: %v", sdkErr)) - panic(sdkErr) - } - } else { - // Return all locked amount in case of no winners - sdkErr := k.bankKeeper.SendCoinsFromModuleToAccount( - ctx, - auctiontypes.ModuleName, - sdk.AccAddress(auction.OwnerAddress), - sdk.NewCoins(sdk.NewCoin(auction.MaxPrice.Denom, totalLockedAmount))) - if sdkErr != nil { - k.Logger(ctx).Error(fmt.Sprintf("Auction error returning bid amount: %v", sdkErr)) - panic(sdkErr) - } + sdkErr := k.bankKeeper.SendCoinsFromModuleToAccount( + ctx, + auctiontypes.ModuleName, + sdk.AccAddress(auction.OwnerAddress), + sdk.NewCoins(creatorLeftOverAmount), + ) + if sdkErr != nil { + k.Logger(ctx).Error(fmt.Sprintf("Auction error returning leftover locked amount: %v", sdkErr)) + panic(sdkErr) } // Notify other modules (hook). -- 2.45.2 From 3fcab104968ba8d1eb6a1e2e24ebc7072b0198ac Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Fri, 20 Sep 2024 12:31:22 +0530 Subject: [PATCH 20/29] Update authority auctions test CI workflow --- ...{test-sdk-auction.yml => test-sdk-authority-auction.yml} | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename .gitea/workflows/{test-sdk-auction.yml => test-sdk-authority-auction.yml} (87%) diff --git a/.gitea/workflows/test-sdk-auction.yml b/.gitea/workflows/test-sdk-authority-auction.yml similarity index 87% rename from .gitea/workflows/test-sdk-auction.yml rename to .gitea/workflows/test-sdk-authority-auction.yml index 95b78930..91e8bac3 100644 --- a/.gitea/workflows/test-sdk-auction.yml +++ b/.gitea/workflows/test-sdk-authority-auction.yml @@ -7,7 +7,7 @@ on: - release/** jobs: - sdk_tests_auctions: + sdk_tests_authority_auctions: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -35,6 +35,6 @@ jobs: TEST_AUCTION_ENABLED: true run: docker compose up -d - - name: Run auction tests + - name: Run authority auction tests working-directory: tests/sdk_tests - run: ./run-tests.sh test:auctions + run: ./run-tests.sh test:authority-auctions -- 2.45.2 From ecddfb96bc601d2a817ddf9ec81928ae9178ad89 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Fri, 20 Sep 2024 15:51:07 +0530 Subject: [PATCH 21/29] Remove unnecessary log --- x/auction/msgs.go | 1 - 1 file changed, 1 deletion(-) diff --git a/x/auction/msgs.go b/x/auction/msgs.go index 7634135f..2945ca35 100644 --- a/x/auction/msgs.go +++ b/x/auction/msgs.go @@ -27,7 +27,6 @@ func NewMsgCreateAuction( numProviders int32, signer sdk.AccAddress, ) MsgCreateAuction { - fmt.Print(signer.String()) return MsgCreateAuction{ CommitsDuration: commitsDuration, RevealsDuration: revealsDuration, -- 2.45.2 From 3710f83002661e427fcad398887da95b57e87027 Mon Sep 17 00:00:00 2001 From: IshaVenikar Date: Mon, 23 Sep 2024 14:48:12 +0530 Subject: [PATCH 22/29] Fix auction owner address type --- x/auction/keeper/keeper.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/x/auction/keeper/keeper.go b/x/auction/keeper/keeper.go index 2cb4cde4..05e99473 100644 --- a/x/auction/keeper/keeper.go +++ b/x/auction/keeper/keeper.go @@ -910,10 +910,16 @@ func (k Keeper) pickProviderAuctionWinners(ctx sdk.Context, auction *auctiontype totalAmountPaid := auction.WinningPrice.Amount.Mul(math.NewInt(int64(len(auction.WinnerAddresses)))) creatorLeftOverAmount := sdk.NewCoin(auction.MaxPrice.Denom, totalLockedAmount.Sub(totalAmountPaid)) + creatorAddress, err := sdk.AccAddressFromBech32(auction.OwnerAddress) + if err != nil { + k.Logger(ctx).Error(fmt.Sprintf("Invalid creatorAddress address. %v", err)) + panic("Invalid creator address.") + } + sdkErr := k.bankKeeper.SendCoinsFromModuleToAccount( ctx, auctiontypes.ModuleName, - sdk.AccAddress(auction.OwnerAddress), + creatorAddress, sdk.NewCoins(creatorLeftOverAmount), ) if sdkErr != nil { -- 2.45.2 From 287c4c7782b017c117429c738b320b6b4b949752 Mon Sep 17 00:00:00 2001 From: IshaVenikar Date: Mon, 23 Sep 2024 17:58:35 +0530 Subject: [PATCH 23/29] Update proto files and bindings --- api/cerc/auction/v1/auction.pulsar.go | 194 ++-- api/cerc/auction/v1/tx.pulsar.go | 1201 +++++++++++++++++++++++-- api/cerc/auction/v1/tx_grpc.pb.go | 39 + proto/cerc/auction/v1/auction.proto | 4 + proto/cerc/auction/v1/tx.proto | 28 + x/auction/auction.pb.go | 144 +-- x/auction/tx.pb.go | 550 +++++++++-- x/auction/tx.pb.gw.go | 83 ++ 8 files changed, 1994 insertions(+), 249 deletions(-) diff --git a/api/cerc/auction/v1/auction.pulsar.go b/api/cerc/auction/v1/auction.pulsar.go index aab5ae86..d7851989 100644 --- a/api/cerc/auction/v1/auction.pulsar.go +++ b/api/cerc/auction/v1/auction.pulsar.go @@ -485,6 +485,7 @@ var ( fd_Auction_winning_price protoreflect.FieldDescriptor fd_Auction_max_price protoreflect.FieldDescriptor fd_Auction_num_providers protoreflect.FieldDescriptor + fd_Auction_funds_released protoreflect.FieldDescriptor ) func init() { @@ -505,6 +506,7 @@ func init() { fd_Auction_winning_price = md_Auction.Fields().ByName("winning_price") fd_Auction_max_price = md_Auction.Fields().ByName("max_price") fd_Auction_num_providers = md_Auction.Fields().ByName("num_providers") + fd_Auction_funds_released = md_Auction.Fields().ByName("funds_released") } var _ protoreflect.Message = (*fastReflection_Auction)(nil) @@ -662,6 +664,12 @@ func (x *fastReflection_Auction) Range(f func(protoreflect.FieldDescriptor, prot return } } + if x.FundsReleased != false { + value := protoreflect.ValueOfBool(x.FundsReleased) + if !f(fd_Auction_funds_released, value) { + return + } + } } // Has reports whether a field is populated. @@ -707,6 +715,8 @@ func (x *fastReflection_Auction) Has(fd protoreflect.FieldDescriptor) bool { return x.MaxPrice != nil case "cerc.auction.v1.Auction.num_providers": return x.NumProviders != int32(0) + case "cerc.auction.v1.Auction.funds_released": + return x.FundsReleased != false default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.v1.Auction")) @@ -753,6 +763,8 @@ func (x *fastReflection_Auction) Clear(fd protoreflect.FieldDescriptor) { x.MaxPrice = nil case "cerc.auction.v1.Auction.num_providers": x.NumProviders = int32(0) + case "cerc.auction.v1.Auction.funds_released": + x.FundsReleased = false default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.v1.Auction")) @@ -820,6 +832,9 @@ func (x *fastReflection_Auction) Get(descriptor protoreflect.FieldDescriptor) pr case "cerc.auction.v1.Auction.num_providers": value := x.NumProviders return protoreflect.ValueOfInt32(value) + case "cerc.auction.v1.Auction.funds_released": + value := x.FundsReleased + return protoreflect.ValueOfBool(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.v1.Auction")) @@ -874,6 +889,8 @@ func (x *fastReflection_Auction) Set(fd protoreflect.FieldDescriptor, value prot x.MaxPrice = value.Message().Interface().(*v1beta1.Coin) case "cerc.auction.v1.Auction.num_providers": x.NumProviders = int32(value.Int()) + case "cerc.auction.v1.Auction.funds_released": + x.FundsReleased = value.Bool() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.v1.Auction")) @@ -956,6 +973,8 @@ func (x *fastReflection_Auction) Mutable(fd protoreflect.FieldDescriptor) protor panic(fmt.Errorf("field owner_address of message cerc.auction.v1.Auction is not mutable")) case "cerc.auction.v1.Auction.num_providers": panic(fmt.Errorf("field num_providers of message cerc.auction.v1.Auction is not mutable")) + case "cerc.auction.v1.Auction.funds_released": + panic(fmt.Errorf("field funds_released of message cerc.auction.v1.Auction is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.v1.Auction")) @@ -1009,6 +1028,8 @@ func (x *fastReflection_Auction) NewField(fd protoreflect.FieldDescriptor) proto return protoreflect.ValueOfMessage(m.ProtoReflect()) case "cerc.auction.v1.Auction.num_providers": return protoreflect.ValueOfInt32(int32(0)) + case "cerc.auction.v1.Auction.funds_released": + return protoreflect.ValueOfBool(false) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.v1.Auction")) @@ -1141,6 +1162,9 @@ func (x *fastReflection_Auction) ProtoMethods() *protoiface.Methods { if x.NumProviders != 0 { n += 1 + runtime.Sov(uint64(x.NumProviders)) } + if x.FundsReleased { + n += 3 + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -1170,6 +1194,18 @@ func (x *fastReflection_Auction) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.FundsReleased { + i-- + if x.FundsReleased { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x80 + } if x.NumProviders != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.NumProviders)) i-- @@ -1890,6 +1926,26 @@ func (x *fastReflection_Auction) ProtoMethods() *protoiface.Methods { break } } + case 16: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field FundsReleased", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.FundsReleased = bool(v != 0) default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -3507,7 +3563,8 @@ type Auction struct { MaxPrice *v1beta1.Coin `protobuf:"bytes,14,opt,name=max_price,json=maxPrice,proto3" json:"max_price,omitempty"` // Number of desired providers (num of auction winners) // Only applicable in provider auctions - NumProviders int32 `protobuf:"varint,15,opt,name=num_providers,json=numProviders,proto3" json:"num_providers,omitempty"` + NumProviders int32 `protobuf:"varint,15,opt,name=num_providers,json=numProviders,proto3" json:"num_providers,omitempty"` + FundsReleased bool `protobuf:"varint,16,opt,name=funds_released,json=fundsReleased,proto3" json:"funds_released,omitempty"` } func (x *Auction) Reset() { @@ -3635,6 +3692,13 @@ func (x *Auction) GetNumProviders() int32 { return 0 } +func (x *Auction) GetFundsReleased() bool { + if x != nil { + return x.FundsReleased + } + return false +} + // Auctions represent all the auctions in the module type Auctions struct { state protoimpl.MessageState @@ -3783,7 +3847,7 @@ var file_cerc_auction_v1_auction_proto_rawDesc = []byte{ 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x08, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x22, 0xd3, 0x09, 0x0a, 0x07, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, + 0x73, 0x22, 0xab, 0x0a, 0x0a, 0x07, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2f, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1b, 0xf2, 0xde, 0x1f, 0x17, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x6b, 0x69, 0x6e, 0x64, 0x22, 0x20, 0x79, 0x61, 0x6d, @@ -3860,66 +3924,72 @@ var file_cerc_auction_v1_auction_proto_rawDesc = []byte{ 0x65, 0x22, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x6e, 0x75, 0x6d, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6e, 0x75, 0x6d, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, - 0x73, 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x22, 0x4c, 0x0a, 0x08, 0x41, 0x75, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x12, 0x3a, 0x0a, 0x08, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, - 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x08, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, - 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x22, 0x9f, 0x05, 0x0a, 0x03, 0x42, 0x69, 0x64, 0x12, 0x1d, 0x0a, - 0x0a, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, - 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x63, - 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x6e, 0x0a, 0x0b, - 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x31, 0xc8, - 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x25, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x63, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, - 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x90, 0xdf, 0x1f, 0x01, - 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x65, 0x0a, 0x0a, - 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x2b, 0xc8, 0xde, 0x1f, - 0x00, 0xf2, 0xde, 0x1f, 0x23, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x5f, 0x66, 0x65, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x5f, 0x66, 0x65, 0x65, 0x22, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x46, 0x65, 0x65, 0x12, 0x6e, 0x0a, 0x0b, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x74, 0x69, - 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x25, 0x6a, 0x73, - 0x6f, 0x6e, 0x3a, 0x22, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, - 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x74, 0x69, - 0x6d, 0x65, 0x22, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0a, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x54, - 0x69, 0x6d, 0x65, 0x12, 0x65, 0x0a, 0x0a, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x66, 0x65, - 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, - 0x69, 0x6e, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x23, 0x6a, 0x73, 0x6f, 0x6e, - 0x3a, 0x22, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x66, 0x65, 0x65, 0x22, 0x20, 0x79, 0x61, - 0x6d, 0x6c, 0x3a, 0x22, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x66, 0x65, 0x65, 0x22, 0x52, - 0x09, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x46, 0x65, 0x65, 0x12, 0x65, 0x0a, 0x0a, 0x62, 0x69, - 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, - 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xf2, - 0xde, 0x1f, 0x23, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x62, 0x69, 0x64, 0x5f, 0x61, 0x6d, 0x6f, - 0x75, 0x6e, 0x74, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x62, 0x69, 0x64, 0x5f, 0x61, - 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x52, 0x09, 0x62, 0x69, 0x64, 0x41, 0x6d, 0x6f, 0x75, 0x6e, - 0x74, 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x42, 0xbc, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, - 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x42, - 0x0c, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, - 0x39, 0x67, 0x69, 0x74, 0x2e, 0x76, 0x64, 0x62, 0x2e, 0x74, 0x6f, 0x2f, 0x63, 0x65, 0x72, 0x63, - 0x2d, 0x69, 0x6f, 0x2f, 0x6c, 0x61, 0x63, 0x6f, 0x6e, 0x69, 0x63, 0x64, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, - 0x3b, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x41, 0x58, - 0xaa, 0x02, 0x0f, 0x43, 0x65, 0x72, 0x63, 0x2e, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x56, 0x31, 0xca, 0x02, 0x0f, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1b, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x41, 0x75, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0xea, 0x02, 0x11, 0x43, 0x65, 0x72, 0x63, 0x3a, 0x3a, 0x41, 0x75, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x12, 0x56, 0x0a, 0x0e, 0x66, 0x75, 0x6e, 0x64, 0x73, 0x5f, 0x72, 0x65, 0x6c, 0x65, 0x61, + 0x73, 0x65, 0x64, 0x18, 0x10, 0x20, 0x01, 0x28, 0x08, 0x42, 0x2f, 0xf2, 0xde, 0x1f, 0x2b, 0x6a, + 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x66, 0x75, 0x6e, 0x64, 0x73, 0x5f, 0x72, 0x65, 0x6c, 0x65, 0x61, + 0x73, 0x65, 0x64, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x66, 0x75, 0x6e, 0x64, 0x73, + 0x5f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x22, 0x52, 0x0d, 0x66, 0x75, 0x6e, 0x64, + 0x73, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x64, 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x22, + 0x4c, 0x0a, 0x08, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3a, 0x0a, 0x08, 0x61, + 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, + 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, + 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x08, 0x61, + 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x22, 0x9f, 0x05, + 0x0a, 0x03, 0x42, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x62, 0x69, 0x64, 0x64, 0x65, 0x72, 0x5f, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x62, 0x69, + 0x64, 0x64, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x68, 0x61, + 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x48, 0x61, 0x73, 0x68, 0x12, 0x6e, 0x0a, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x74, + 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x31, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x25, 0x6a, + 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, + 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x74, + 0x69, 0x6d, 0x65, 0x22, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x54, 0x69, 0x6d, 0x65, 0x12, 0x65, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x66, + 0x65, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, + 0x6f, 0x69, 0x6e, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x23, 0x6a, 0x73, 0x6f, + 0x6e, 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x66, 0x65, 0x65, 0x22, 0x20, 0x79, + 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x66, 0x65, 0x65, 0x22, + 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x46, 0x65, 0x65, 0x12, 0x6e, 0x0a, 0x0b, 0x72, + 0x65, 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x31, 0xc8, 0xde, + 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x25, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x72, 0x65, 0x76, 0x65, + 0x61, 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x72, + 0x65, 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x90, 0xdf, 0x1f, 0x01, 0x52, + 0x0a, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x65, 0x0a, 0x0a, 0x72, + 0x65, 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x66, 0x65, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, + 0xf2, 0xde, 0x1f, 0x23, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, + 0x5f, 0x66, 0x65, 0x65, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x72, 0x65, 0x76, 0x65, + 0x61, 0x6c, 0x5f, 0x66, 0x65, 0x65, 0x22, 0x52, 0x09, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x46, + 0x65, 0x65, 0x12, 0x65, 0x0a, 0x0a, 0x62, 0x69, 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, + 0x6e, 0x42, 0x2b, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x23, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, + 0x22, 0x62, 0x69, 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x20, 0x79, 0x61, 0x6d, + 0x6c, 0x3a, 0x22, 0x62, 0x69, 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x52, 0x09, + 0x62, 0x69, 0x64, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x42, + 0xbc, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x2e, 0x76, 0x64, 0x62, + 0x2e, 0x74, 0x6f, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2d, 0x69, 0x6f, 0x2f, 0x6c, 0x61, 0x63, 0x6f, + 0x6e, 0x69, 0x63, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x61, 0x75, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x41, 0x58, 0xaa, 0x02, 0x0f, 0x43, 0x65, 0x72, 0x63, 0x2e, + 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x43, 0x65, 0x72, + 0x63, 0x5c, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1b, 0x43, + 0x65, 0x72, 0x63, 0x5c, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x43, 0x65, 0x72, + 0x63, 0x3a, 0x3a, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/cerc/auction/v1/tx.pulsar.go b/api/cerc/auction/v1/tx.pulsar.go index e7ac7275..7f679762 100644 --- a/api/cerc/auction/v1/tx.pulsar.go +++ b/api/cerc/auction/v1/tx.pulsar.go @@ -4280,6 +4280,925 @@ func (x *fastReflection_MsgUpdateParamsResponse) ProtoMethods() *protoiface.Meth } } +var ( + md_MsgReleaseFunds protoreflect.MessageDescriptor + fd_MsgReleaseFunds_auction_id protoreflect.FieldDescriptor + fd_MsgReleaseFunds_signer protoreflect.FieldDescriptor +) + +func init() { + file_cerc_auction_v1_tx_proto_init() + md_MsgReleaseFunds = File_cerc_auction_v1_tx_proto.Messages().ByName("MsgReleaseFunds") + fd_MsgReleaseFunds_auction_id = md_MsgReleaseFunds.Fields().ByName("auction_id") + fd_MsgReleaseFunds_signer = md_MsgReleaseFunds.Fields().ByName("signer") +} + +var _ protoreflect.Message = (*fastReflection_MsgReleaseFunds)(nil) + +type fastReflection_MsgReleaseFunds MsgReleaseFunds + +func (x *MsgReleaseFunds) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgReleaseFunds)(x) +} + +func (x *MsgReleaseFunds) slowProtoReflect() protoreflect.Message { + mi := &file_cerc_auction_v1_tx_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgReleaseFunds_messageType fastReflection_MsgReleaseFunds_messageType +var _ protoreflect.MessageType = fastReflection_MsgReleaseFunds_messageType{} + +type fastReflection_MsgReleaseFunds_messageType struct{} + +func (x fastReflection_MsgReleaseFunds_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgReleaseFunds)(nil) +} +func (x fastReflection_MsgReleaseFunds_messageType) New() protoreflect.Message { + return new(fastReflection_MsgReleaseFunds) +} +func (x fastReflection_MsgReleaseFunds_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgReleaseFunds +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgReleaseFunds) Descriptor() protoreflect.MessageDescriptor { + return md_MsgReleaseFunds +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgReleaseFunds) Type() protoreflect.MessageType { + return _fastReflection_MsgReleaseFunds_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgReleaseFunds) New() protoreflect.Message { + return new(fastReflection_MsgReleaseFunds) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgReleaseFunds) Interface() protoreflect.ProtoMessage { + return (*MsgReleaseFunds)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgReleaseFunds) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.AuctionId != "" { + value := protoreflect.ValueOfString(x.AuctionId) + if !f(fd_MsgReleaseFunds_auction_id, value) { + return + } + } + if x.Signer != "" { + value := protoreflect.ValueOfString(x.Signer) + if !f(fd_MsgReleaseFunds_signer, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgReleaseFunds) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cerc.auction.v1.MsgReleaseFunds.auction_id": + return x.AuctionId != "" + case "cerc.auction.v1.MsgReleaseFunds.signer": + return x.Signer != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.v1.MsgReleaseFunds")) + } + panic(fmt.Errorf("message cerc.auction.v1.MsgReleaseFunds does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgReleaseFunds) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cerc.auction.v1.MsgReleaseFunds.auction_id": + x.AuctionId = "" + case "cerc.auction.v1.MsgReleaseFunds.signer": + x.Signer = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.v1.MsgReleaseFunds")) + } + panic(fmt.Errorf("message cerc.auction.v1.MsgReleaseFunds does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgReleaseFunds) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cerc.auction.v1.MsgReleaseFunds.auction_id": + value := x.AuctionId + return protoreflect.ValueOfString(value) + case "cerc.auction.v1.MsgReleaseFunds.signer": + value := x.Signer + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.v1.MsgReleaseFunds")) + } + panic(fmt.Errorf("message cerc.auction.v1.MsgReleaseFunds does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgReleaseFunds) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cerc.auction.v1.MsgReleaseFunds.auction_id": + x.AuctionId = value.Interface().(string) + case "cerc.auction.v1.MsgReleaseFunds.signer": + x.Signer = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.v1.MsgReleaseFunds")) + } + panic(fmt.Errorf("message cerc.auction.v1.MsgReleaseFunds does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgReleaseFunds) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cerc.auction.v1.MsgReleaseFunds.auction_id": + panic(fmt.Errorf("field auction_id of message cerc.auction.v1.MsgReleaseFunds is not mutable")) + case "cerc.auction.v1.MsgReleaseFunds.signer": + panic(fmt.Errorf("field signer of message cerc.auction.v1.MsgReleaseFunds is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.v1.MsgReleaseFunds")) + } + panic(fmt.Errorf("message cerc.auction.v1.MsgReleaseFunds does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgReleaseFunds) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cerc.auction.v1.MsgReleaseFunds.auction_id": + return protoreflect.ValueOfString("") + case "cerc.auction.v1.MsgReleaseFunds.signer": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.v1.MsgReleaseFunds")) + } + panic(fmt.Errorf("message cerc.auction.v1.MsgReleaseFunds does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgReleaseFunds) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cerc.auction.v1.MsgReleaseFunds", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgReleaseFunds) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgReleaseFunds) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgReleaseFunds) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgReleaseFunds) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgReleaseFunds) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.AuctionId) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Signer) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgReleaseFunds) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Signer) > 0 { + i -= len(x.Signer) + copy(dAtA[i:], x.Signer) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Signer))) + i-- + dAtA[i] = 0x12 + } + if len(x.AuctionId) > 0 { + i -= len(x.AuctionId) + copy(dAtA[i:], x.AuctionId) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AuctionId))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgReleaseFunds) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgReleaseFunds: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgReleaseFunds: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.AuctionId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgReleaseFundsResponse protoreflect.MessageDescriptor + fd_MsgReleaseFundsResponse_auction protoreflect.FieldDescriptor +) + +func init() { + file_cerc_auction_v1_tx_proto_init() + md_MsgReleaseFundsResponse = File_cerc_auction_v1_tx_proto.Messages().ByName("MsgReleaseFundsResponse") + fd_MsgReleaseFundsResponse_auction = md_MsgReleaseFundsResponse.Fields().ByName("auction") +} + +var _ protoreflect.Message = (*fastReflection_MsgReleaseFundsResponse)(nil) + +type fastReflection_MsgReleaseFundsResponse MsgReleaseFundsResponse + +func (x *MsgReleaseFundsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgReleaseFundsResponse)(x) +} + +func (x *MsgReleaseFundsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cerc_auction_v1_tx_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgReleaseFundsResponse_messageType fastReflection_MsgReleaseFundsResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgReleaseFundsResponse_messageType{} + +type fastReflection_MsgReleaseFundsResponse_messageType struct{} + +func (x fastReflection_MsgReleaseFundsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgReleaseFundsResponse)(nil) +} +func (x fastReflection_MsgReleaseFundsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgReleaseFundsResponse) +} +func (x fastReflection_MsgReleaseFundsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgReleaseFundsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgReleaseFundsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgReleaseFundsResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgReleaseFundsResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgReleaseFundsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgReleaseFundsResponse) New() protoreflect.Message { + return new(fastReflection_MsgReleaseFundsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgReleaseFundsResponse) Interface() protoreflect.ProtoMessage { + return (*MsgReleaseFundsResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgReleaseFundsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Auction != nil { + value := protoreflect.ValueOfMessage(x.Auction.ProtoReflect()) + if !f(fd_MsgReleaseFundsResponse_auction, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgReleaseFundsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cerc.auction.v1.MsgReleaseFundsResponse.auction": + return x.Auction != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.v1.MsgReleaseFundsResponse")) + } + panic(fmt.Errorf("message cerc.auction.v1.MsgReleaseFundsResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgReleaseFundsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cerc.auction.v1.MsgReleaseFundsResponse.auction": + x.Auction = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.v1.MsgReleaseFundsResponse")) + } + panic(fmt.Errorf("message cerc.auction.v1.MsgReleaseFundsResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgReleaseFundsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cerc.auction.v1.MsgReleaseFundsResponse.auction": + value := x.Auction + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.v1.MsgReleaseFundsResponse")) + } + panic(fmt.Errorf("message cerc.auction.v1.MsgReleaseFundsResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgReleaseFundsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cerc.auction.v1.MsgReleaseFundsResponse.auction": + x.Auction = value.Message().Interface().(*Auction) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.v1.MsgReleaseFundsResponse")) + } + panic(fmt.Errorf("message cerc.auction.v1.MsgReleaseFundsResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgReleaseFundsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cerc.auction.v1.MsgReleaseFundsResponse.auction": + if x.Auction == nil { + x.Auction = new(Auction) + } + return protoreflect.ValueOfMessage(x.Auction.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.v1.MsgReleaseFundsResponse")) + } + panic(fmt.Errorf("message cerc.auction.v1.MsgReleaseFundsResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgReleaseFundsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cerc.auction.v1.MsgReleaseFundsResponse.auction": + m := new(Auction) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.v1.MsgReleaseFundsResponse")) + } + panic(fmt.Errorf("message cerc.auction.v1.MsgReleaseFundsResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgReleaseFundsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cerc.auction.v1.MsgReleaseFundsResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgReleaseFundsResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgReleaseFundsResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgReleaseFundsResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgReleaseFundsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgReleaseFundsResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Auction != nil { + l = options.Size(x.Auction) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgReleaseFundsResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Auction != nil { + encoded, err := options.Marshal(x.Auction) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgReleaseFundsResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgReleaseFundsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgReleaseFundsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Auction", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Auction == nil { + x.Auction = &Auction{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Auction); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 @@ -4703,6 +5622,89 @@ func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { return file_cerc_auction_v1_tx_proto_rawDescGZIP(), []int{7} } +// ReleaseFunds defines the message to pay the winners of provider auctions +type MsgReleaseFunds struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Auction id + AuctionId string `protobuf:"bytes,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty"` + // Address of the signer + Signer string `protobuf:"bytes,2,opt,name=signer,proto3" json:"signer,omitempty"` +} + +func (x *MsgReleaseFunds) Reset() { + *x = MsgReleaseFunds{} + if protoimpl.UnsafeEnabled { + mi := &file_cerc_auction_v1_tx_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgReleaseFunds) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgReleaseFunds) ProtoMessage() {} + +// Deprecated: Use MsgReleaseFunds.ProtoReflect.Descriptor instead. +func (*MsgReleaseFunds) Descriptor() ([]byte, []int) { + return file_cerc_auction_v1_tx_proto_rawDescGZIP(), []int{8} +} + +func (x *MsgReleaseFunds) GetAuctionId() string { + if x != nil { + return x.AuctionId + } + return "" +} + +func (x *MsgReleaseFunds) GetSigner() string { + if x != nil { + return x.Signer + } + return "" +} + +// MsgReleaseFundsResponse returns the state of the auction after releasing the funds +type MsgReleaseFundsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Auction details + Auction *Auction `protobuf:"bytes,1,opt,name=auction,proto3" json:"auction,omitempty"` +} + +func (x *MsgReleaseFundsResponse) Reset() { + *x = MsgReleaseFundsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cerc_auction_v1_tx_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgReleaseFundsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgReleaseFundsResponse) ProtoMessage() {} + +// Deprecated: Use MsgReleaseFundsResponse.ProtoReflect.Descriptor instead. +func (*MsgReleaseFundsResponse) Descriptor() ([]byte, []int) { + return file_cerc_auction_v1_tx_proto_rawDescGZIP(), []int{9} +} + +func (x *MsgReleaseFundsResponse) GetAuction() *Auction { + if x != nil { + return x.Auction + } + return nil +} + var File_cerc_auction_v1_tx_proto protoreflect.FileDescriptor var file_cerc_auction_v1_tx_proto_rawDesc = []byte{ @@ -4835,49 +5837,75 @@ var file_cerc_auction_v1_tx_proto_rawDesc = []byte{ 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x32, 0xe1, 0x03, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x86, 0x01, 0x0a, 0x0d, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x2e, - 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, - 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x1a, 0x29, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x75, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x27, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x21, 0x22, 0x1f, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x75, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x76, 0x0a, 0x09, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x42, 0x69, - 0x64, 0x12, 0x1d, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x42, 0x69, 0x64, - 0x1a, 0x25, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x42, 0x69, 0x64, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x22, - 0x1b, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, - 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x62, 0x69, 0x64, 0x12, 0x76, 0x0a, 0x09, - 0x52, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x42, 0x69, 0x64, 0x12, 0x1d, 0x2e, 0x63, 0x65, 0x72, 0x63, - 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, - 0x65, 0x76, 0x65, 0x61, 0x6c, 0x42, 0x69, 0x64, 0x1a, 0x25, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, - 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, - 0x76, 0x65, 0x61, 0x6c, 0x42, 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x22, 0x1b, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x61, - 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, - 0x5f, 0x62, 0x69, 0x64, 0x12, 0x5a, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x12, 0x20, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, + 0x6e, 0x73, 0x65, 0x22, 0xa3, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6c, 0x65, 0x61, + 0x73, 0x65, 0x46, 0x75, 0x6e, 0x64, 0x73, 0x12, 0x46, 0x0a, 0x0a, 0x61, 0x75, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x27, 0xf2, 0xde, 0x1f, + 0x23, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, + 0x64, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x69, 0x64, 0x22, 0x52, 0x09, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, + 0x37, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x1f, 0xf2, 0xde, 0x1f, 0x1b, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x73, 0x69, 0x67, 0x6e, 0x65, + 0x72, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, + 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x3a, 0x0f, 0x88, 0xa0, 0x1f, 0x00, 0x82, 0xe7, + 0xb0, 0x2a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, 0x76, 0x0a, 0x17, 0x4d, 0x73, 0x67, + 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x46, 0x75, 0x6e, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x07, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, + 0x21, 0xf2, 0xde, 0x1f, 0x1d, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x61, 0x75, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x22, 0x20, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x22, 0x52, 0x07, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x04, 0x88, 0xa0, 0x1f, + 0x00, 0x32, 0xe6, 0x04, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x86, 0x01, 0x0a, 0x0d, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x2e, 0x63, 0x65, + 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, + 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x29, + 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x21, 0x22, 0x1f, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x75, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x76, 0x0a, 0x09, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x42, 0x69, 0x64, 0x12, + 0x1d, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, + 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x42, 0x69, 0x64, 0x1a, 0x25, + 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x42, 0x69, 0x64, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x22, 0x1b, 0x2f, + 0x63, 0x65, 0x72, 0x63, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, + 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x62, 0x69, 0x64, 0x12, 0x76, 0x0a, 0x09, 0x52, 0x65, + 0x76, 0x65, 0x61, 0x6c, 0x42, 0x69, 0x64, 0x12, 0x1d, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, + 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x76, + 0x65, 0x61, 0x6c, 0x42, 0x69, 0x64, 0x1a, 0x25, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x76, 0x65, + 0x61, 0x6c, 0x42, 0x69, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x22, 0x1b, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x61, 0x75, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x76, 0x65, 0x61, 0x6c, 0x5f, 0x62, + 0x69, 0x64, 0x12, 0x5a, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x12, 0x20, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x28, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x28, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xb7, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, - 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x42, - 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x2e, - 0x76, 0x64, 0x62, 0x2e, 0x74, 0x6f, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2d, 0x69, 0x6f, 0x2f, 0x6c, - 0x61, 0x63, 0x6f, 0x6e, 0x69, 0x63, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x65, 0x72, 0x63, - 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x75, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x41, 0x58, 0xaa, 0x02, 0x0f, 0x43, 0x65, - 0x72, 0x63, 0x2e, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, - 0x43, 0x65, 0x72, 0x63, 0x5c, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0xe2, - 0x02, 0x1b, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, - 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, - 0x43, 0x65, 0x72, 0x63, 0x3a, 0x3a, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x3a, 0x56, - 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x82, + 0x01, 0x0a, 0x0c, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x46, 0x75, 0x6e, 0x64, 0x73, 0x12, + 0x20, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, + 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x46, 0x75, 0x6e, 0x64, + 0x73, 0x1a, 0x28, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x46, 0x75, + 0x6e, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x20, 0x22, 0x1e, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x66, 0x75, + 0x6e, 0x64, 0x73, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xb7, 0x01, 0x0a, 0x13, 0x63, + 0x6f, 0x6d, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x39, 0x67, + 0x69, 0x74, 0x2e, 0x76, 0x64, 0x62, 0x2e, 0x74, 0x6f, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2d, 0x69, + 0x6f, 0x2f, 0x6c, 0x61, 0x63, 0x6f, 0x6e, 0x69, 0x63, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, + 0x65, 0x72, 0x63, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x61, + 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x41, 0x58, 0xaa, 0x02, + 0x0f, 0x43, 0x65, 0x72, 0x63, 0x2e, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x31, + 0xca, 0x02, 0x0f, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5c, + 0x56, 0x31, 0xe2, 0x02, 0x1b, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x11, 0x43, 0x65, 0x72, 0x63, 0x3a, 0x3a, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -4892,7 +5920,7 @@ func file_cerc_auction_v1_tx_proto_rawDescGZIP() []byte { return file_cerc_auction_v1_tx_proto_rawDescData } -var file_cerc_auction_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_cerc_auction_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_cerc_auction_v1_tx_proto_goTypes = []interface{}{ (*MsgCreateAuction)(nil), // 0: cerc.auction.v1.MsgCreateAuction (*MsgCreateAuctionResponse)(nil), // 1: cerc.auction.v1.MsgCreateAuctionResponse @@ -4902,36 +5930,41 @@ var file_cerc_auction_v1_tx_proto_goTypes = []interface{}{ (*MsgRevealBidResponse)(nil), // 5: cerc.auction.v1.MsgRevealBidResponse (*MsgUpdateParams)(nil), // 6: cerc.auction.v1.MsgUpdateParams (*MsgUpdateParamsResponse)(nil), // 7: cerc.auction.v1.MsgUpdateParamsResponse - (*durationpb.Duration)(nil), // 8: google.protobuf.Duration - (*v1beta1.Coin)(nil), // 9: cosmos.base.v1beta1.Coin - (*Auction)(nil), // 10: cerc.auction.v1.Auction - (*Bid)(nil), // 11: cerc.auction.v1.Bid - (*Params)(nil), // 12: cerc.auction.v1.Params + (*MsgReleaseFunds)(nil), // 8: cerc.auction.v1.MsgReleaseFunds + (*MsgReleaseFundsResponse)(nil), // 9: cerc.auction.v1.MsgReleaseFundsResponse + (*durationpb.Duration)(nil), // 10: google.protobuf.Duration + (*v1beta1.Coin)(nil), // 11: cosmos.base.v1beta1.Coin + (*Auction)(nil), // 12: cerc.auction.v1.Auction + (*Bid)(nil), // 13: cerc.auction.v1.Bid + (*Params)(nil), // 14: cerc.auction.v1.Params } var file_cerc_auction_v1_tx_proto_depIdxs = []int32{ - 8, // 0: cerc.auction.v1.MsgCreateAuction.commits_duration:type_name -> google.protobuf.Duration - 8, // 1: cerc.auction.v1.MsgCreateAuction.reveals_duration:type_name -> google.protobuf.Duration - 9, // 2: cerc.auction.v1.MsgCreateAuction.commit_fee:type_name -> cosmos.base.v1beta1.Coin - 9, // 3: cerc.auction.v1.MsgCreateAuction.reveal_fee:type_name -> cosmos.base.v1beta1.Coin - 9, // 4: cerc.auction.v1.MsgCreateAuction.minimum_bid:type_name -> cosmos.base.v1beta1.Coin - 9, // 5: cerc.auction.v1.MsgCreateAuction.max_price:type_name -> cosmos.base.v1beta1.Coin - 10, // 6: cerc.auction.v1.MsgCreateAuctionResponse.auction:type_name -> cerc.auction.v1.Auction - 11, // 7: cerc.auction.v1.MsgCommitBidResponse.bid:type_name -> cerc.auction.v1.Bid - 10, // 8: cerc.auction.v1.MsgRevealBidResponse.auction:type_name -> cerc.auction.v1.Auction - 12, // 9: cerc.auction.v1.MsgUpdateParams.params:type_name -> cerc.auction.v1.Params - 0, // 10: cerc.auction.v1.Msg.CreateAuction:input_type -> cerc.auction.v1.MsgCreateAuction - 2, // 11: cerc.auction.v1.Msg.CommitBid:input_type -> cerc.auction.v1.MsgCommitBid - 4, // 12: cerc.auction.v1.Msg.RevealBid:input_type -> cerc.auction.v1.MsgRevealBid - 6, // 13: cerc.auction.v1.Msg.UpdateParams:input_type -> cerc.auction.v1.MsgUpdateParams - 1, // 14: cerc.auction.v1.Msg.CreateAuction:output_type -> cerc.auction.v1.MsgCreateAuctionResponse - 3, // 15: cerc.auction.v1.Msg.CommitBid:output_type -> cerc.auction.v1.MsgCommitBidResponse - 5, // 16: cerc.auction.v1.Msg.RevealBid:output_type -> cerc.auction.v1.MsgRevealBidResponse - 7, // 17: cerc.auction.v1.Msg.UpdateParams:output_type -> cerc.auction.v1.MsgUpdateParamsResponse - 14, // [14:18] is the sub-list for method output_type - 10, // [10:14] is the sub-list for method input_type - 10, // [10:10] is the sub-list for extension type_name - 10, // [10:10] is the sub-list for extension extendee - 0, // [0:10] is the sub-list for field type_name + 10, // 0: cerc.auction.v1.MsgCreateAuction.commits_duration:type_name -> google.protobuf.Duration + 10, // 1: cerc.auction.v1.MsgCreateAuction.reveals_duration:type_name -> google.protobuf.Duration + 11, // 2: cerc.auction.v1.MsgCreateAuction.commit_fee:type_name -> cosmos.base.v1beta1.Coin + 11, // 3: cerc.auction.v1.MsgCreateAuction.reveal_fee:type_name -> cosmos.base.v1beta1.Coin + 11, // 4: cerc.auction.v1.MsgCreateAuction.minimum_bid:type_name -> cosmos.base.v1beta1.Coin + 11, // 5: cerc.auction.v1.MsgCreateAuction.max_price:type_name -> cosmos.base.v1beta1.Coin + 12, // 6: cerc.auction.v1.MsgCreateAuctionResponse.auction:type_name -> cerc.auction.v1.Auction + 13, // 7: cerc.auction.v1.MsgCommitBidResponse.bid:type_name -> cerc.auction.v1.Bid + 12, // 8: cerc.auction.v1.MsgRevealBidResponse.auction:type_name -> cerc.auction.v1.Auction + 14, // 9: cerc.auction.v1.MsgUpdateParams.params:type_name -> cerc.auction.v1.Params + 12, // 10: cerc.auction.v1.MsgReleaseFundsResponse.auction:type_name -> cerc.auction.v1.Auction + 0, // 11: cerc.auction.v1.Msg.CreateAuction:input_type -> cerc.auction.v1.MsgCreateAuction + 2, // 12: cerc.auction.v1.Msg.CommitBid:input_type -> cerc.auction.v1.MsgCommitBid + 4, // 13: cerc.auction.v1.Msg.RevealBid:input_type -> cerc.auction.v1.MsgRevealBid + 6, // 14: cerc.auction.v1.Msg.UpdateParams:input_type -> cerc.auction.v1.MsgUpdateParams + 8, // 15: cerc.auction.v1.Msg.ReleaseFunds:input_type -> cerc.auction.v1.MsgReleaseFunds + 1, // 16: cerc.auction.v1.Msg.CreateAuction:output_type -> cerc.auction.v1.MsgCreateAuctionResponse + 3, // 17: cerc.auction.v1.Msg.CommitBid:output_type -> cerc.auction.v1.MsgCommitBidResponse + 5, // 18: cerc.auction.v1.Msg.RevealBid:output_type -> cerc.auction.v1.MsgRevealBidResponse + 7, // 19: cerc.auction.v1.Msg.UpdateParams:output_type -> cerc.auction.v1.MsgUpdateParamsResponse + 9, // 20: cerc.auction.v1.Msg.ReleaseFunds:output_type -> cerc.auction.v1.MsgReleaseFundsResponse + 16, // [16:21] is the sub-list for method output_type + 11, // [11:16] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name } func init() { file_cerc_auction_v1_tx_proto_init() } @@ -5037,6 +6070,30 @@ func file_cerc_auction_v1_tx_proto_init() { return nil } } + file_cerc_auction_v1_tx_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgReleaseFunds); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cerc_auction_v1_tx_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgReleaseFundsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -5044,7 +6101,7 @@ func file_cerc_auction_v1_tx_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cerc_auction_v1_tx_proto_rawDesc, NumEnums: 0, - NumMessages: 8, + NumMessages: 10, NumExtensions: 0, NumServices: 1, }, diff --git a/api/cerc/auction/v1/tx_grpc.pb.go b/api/cerc/auction/v1/tx_grpc.pb.go index b2ab0479..fda2c039 100644 --- a/api/cerc/auction/v1/tx_grpc.pb.go +++ b/api/cerc/auction/v1/tx_grpc.pb.go @@ -23,6 +23,7 @@ const ( Msg_CommitBid_FullMethodName = "/cerc.auction.v1.Msg/CommitBid" Msg_RevealBid_FullMethodName = "/cerc.auction.v1.Msg/RevealBid" Msg_UpdateParams_FullMethodName = "/cerc.auction.v1.Msg/UpdateParams" + Msg_ReleaseFunds_FullMethodName = "/cerc.auction.v1.Msg/ReleaseFunds" ) // MsgClient is the client API for Msg service. @@ -38,6 +39,8 @@ type MsgClient interface { // UpdateParams defines an operation for updating the x/staking module // parameters. UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + // ReleaseFunds is the command for paying the winners of provider auctions + ReleaseFunds(ctx context.Context, in *MsgReleaseFunds, opts ...grpc.CallOption) (*MsgReleaseFundsResponse, error) } type msgClient struct { @@ -84,6 +87,15 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts return out, nil } +func (c *msgClient) ReleaseFunds(ctx context.Context, in *MsgReleaseFunds, opts ...grpc.CallOption) (*MsgReleaseFundsResponse, error) { + out := new(MsgReleaseFundsResponse) + err := c.cc.Invoke(ctx, Msg_ReleaseFunds_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. // All implementations must embed UnimplementedMsgServer // for forward compatibility @@ -97,6 +109,8 @@ type MsgServer interface { // UpdateParams defines an operation for updating the x/staking module // parameters. UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + // ReleaseFunds is the command for paying the winners of provider auctions + ReleaseFunds(context.Context, *MsgReleaseFunds) (*MsgReleaseFundsResponse, error) mustEmbedUnimplementedMsgServer() } @@ -116,6 +130,9 @@ func (UnimplementedMsgServer) RevealBid(context.Context, *MsgRevealBid) (*MsgRev func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") } +func (UnimplementedMsgServer) ReleaseFunds(context.Context, *MsgReleaseFunds) (*MsgReleaseFundsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ReleaseFunds not implemented") +} func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. @@ -201,6 +218,24 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Msg_ReleaseFunds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgReleaseFunds) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ReleaseFunds(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_ReleaseFunds_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ReleaseFunds(ctx, req.(*MsgReleaseFunds)) + } + return interceptor(ctx, in, info, handler) +} + // Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -224,6 +259,10 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ MethodName: "UpdateParams", Handler: _Msg_UpdateParams_Handler, }, + { + MethodName: "ReleaseFunds", + Handler: _Msg_ReleaseFunds_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cerc/auction/v1/tx.proto", diff --git a/proto/cerc/auction/v1/auction.proto b/proto/cerc/auction/v1/auction.proto index b0b31a11..91985750 100644 --- a/proto/cerc/auction/v1/auction.proto +++ b/proto/cerc/auction/v1/auction.proto @@ -94,6 +94,10 @@ message Auction { // Number of desired providers (num of auction winners) // Only applicable in provider auctions int32 num_providers = 15; + + bool funds_released = 16 [ + (gogoproto.moretags) = + "json:\"funds_released\" yaml:\"funds_released\"" ]; } // Auctions represent all the auctions in the module diff --git a/proto/cerc/auction/v1/tx.proto b/proto/cerc/auction/v1/tx.proto index 846a57a9..c93e1be6 100644 --- a/proto/cerc/auction/v1/tx.proto +++ b/proto/cerc/auction/v1/tx.proto @@ -34,6 +34,11 @@ service Msg { // UpdateParams defines an operation for updating the x/staking module // parameters. rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + + // ReleaseFunds is the command for paying the winners of provider auctions + rpc ReleaseFunds(MsgReleaseFunds) returns (MsgReleaseFundsResponse) { + option (google.api.http).post = "/cerc/auction/v1/release_funds"; + }; } // MsgCreateAuction defines a create auction message @@ -172,3 +177,26 @@ message MsgUpdateParams { // MsgUpdateParamsResponse defines the response structure for executing a // MsgUpdateParams message. message MsgUpdateParamsResponse {}; + +// ReleaseFunds defines the message to pay the winners of provider auctions +message MsgReleaseFunds { + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "signer"; + + // Auction id + string auction_id = 1 + [ (gogoproto.moretags) = "json:\"auction_id\" yaml:\"auction_id\"" ]; + + // Address of the signer + string signer = 2 + [ (gogoproto.moretags) = "json:\"signer\" yaml:\"signer\"" ]; +} + +// MsgReleaseFundsResponse returns the state of the auction after releasing the funds +message MsgReleaseFundsResponse { + option (gogoproto.goproto_getters) = false; + + // Auction details + Auction auction = 1 + [ (gogoproto.moretags) = "json:\"auction\" yaml:\"auction\"" ]; +} diff --git a/x/auction/auction.pb.go b/x/auction/auction.pb.go index 3bbb5e5a..21a05dfa 100644 --- a/x/auction/auction.pb.go +++ b/x/auction/auction.pb.go @@ -102,7 +102,8 @@ type Auction struct { MaxPrice types.Coin `protobuf:"bytes,14,opt,name=max_price,json=maxPrice,proto3" json:"max_price" json:"max_price" yaml:"max_price"` // Number of desired providers (num of auction winners) // Only applicable in provider auctions - NumProviders int32 `protobuf:"varint,15,opt,name=num_providers,json=numProviders,proto3" json:"num_providers,omitempty"` + NumProviders int32 `protobuf:"varint,15,opt,name=num_providers,json=numProviders,proto3" json:"num_providers,omitempty"` + FundsReleased bool `protobuf:"varint,16,opt,name=funds_released,json=fundsReleased,proto3" json:"funds_released,omitempty" json:"funds_released" yaml:"funds_released"` } func (m *Auction) Reset() { *m = Auction{} } @@ -232,58 +233,60 @@ func init() { func init() { proto.RegisterFile("cerc/auction/v1/auction.proto", fileDescriptor_34b162eb5b365523) } var fileDescriptor_34b162eb5b365523 = []byte{ - // 810 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcb, 0x6e, 0xdb, 0x46, - 0x14, 0x15, 0x2d, 0x59, 0x16, 0x47, 0x0f, 0x1b, 0x44, 0xd1, 0xb2, 0x2e, 0x2c, 0xa9, 0x32, 0x8c, - 0xca, 0x28, 0x4c, 0x42, 0xed, 0xce, 0x5d, 0x14, 0x52, 0xd1, 0xa2, 0x05, 0xba, 0x30, 0x88, 0xac, - 0xb2, 0x21, 0x86, 0x9c, 0xb1, 0x3c, 0x89, 0x66, 0x46, 0xe1, 0x50, 0xb2, 0xb3, 0xcc, 0x2e, 0x4b, - 0xff, 0x41, 0xf2, 0x39, 0x5e, 0x1a, 0xc8, 0x26, 0x2b, 0x27, 0xb0, 0xff, 0xc0, 0x5f, 0x10, 0x70, - 0x1e, 0x32, 0xc5, 0x3c, 0x14, 0x07, 0xf0, 0x8e, 0xf7, 0xcc, 0xbd, 0xf7, 0x9c, 0x3b, 0xba, 0x73, - 0x20, 0xb0, 0x13, 0xe3, 0x24, 0xf6, 0xe1, 0x2c, 0x4e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0xdc, 0xe7, 0x4c, 0xb2, 0x03, 0xea, - 0xfa, 0xe9, 0x9c, 0x40, 0x71, 0xa2, 0x2d, 0x52, 0x3f, 0xcd, 0x7f, 0xa1, 0x38, 0x91, 0x06, 0xa9, - 0x12, 0xbe, 0xd1, 0x20, 0xef, 0x8a, 0x0b, 0x6f, 0x35, 0x6f, 0x90, 0x12, 0xf9, 0x84, 0x31, 0x54, - 0x1f, 0xca, 0x18, 0x18, 0xa8, 0xeb, 0xb7, 0xfc, 0x95, 0xee, 0x57, 0x18, 0x2b, 0x57, 0x5c, 0xf0, - 0x86, 0xdc, 0x58, 0x0a, 0x31, 0x63, 0xe5, 0x8c, 0xa8, 0xf6, 0x50, 0x46, 0x84, 0x01, 0x88, 0x08, - 0x0a, 0x21, 0xe5, 0x33, 0x96, 0xde, 0xdb, 0xef, 0xee, 0x4a, 0x0d, 0x4d, 0x0e, 0x09, 0xec, 0x88, - 0xa0, 0xa1, 0xfc, 0x56, 0x1b, 0x3a, 0xfa, 0xf3, 0xe2, 0xba, 0x6d, 0x5d, 0x5e, 0xb7, 0xad, 0xf7, - 0xd7, 0x6d, 0xeb, 0xfc, 0xa6, 0x5d, 0xba, 0xbc, 0x69, 0x97, 0xde, 0xde, 0xb4, 0x4b, 0x8f, 0xf7, - 0xc6, 0x24, 0xf5, 0xe6, 0x28, 0xf2, 0x52, 0xee, 0x67, 0x5b, 0x7f, 0x40, 0xb8, 0x3f, 0x81, 0x31, - 0x67, 0x24, 0x46, 0xfe, 0x99, 0xf9, 0xfb, 0x11, 0x55, 0xe5, 0x3d, 0xff, 0xfe, 0x21, 0x00, 0x00, - 0xff, 0xff, 0x79, 0x66, 0x4c, 0x00, 0xa0, 0x08, 0x00, 0x00, + // 846 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x96, 0xcd, 0x6e, 0xeb, 0x44, + 0x14, 0xc7, 0xe3, 0x7e, 0xe4, 0x26, 0x27, 0x4d, 0x5a, 0x59, 0x08, 0x4c, 0xd1, 0x8d, 0x43, 0xaa, + 0x8a, 0x54, 0x57, 0xd7, 0x56, 0x60, 0x57, 0x16, 0xa8, 0x46, 0x20, 0x90, 0x58, 0x54, 0x16, 0x62, + 0xc1, 0xc6, 0x1a, 0x7b, 0xa6, 0xe9, 0x40, 0x66, 0xa6, 0x78, 0xec, 0xdc, 0xb2, 0x64, 0xc7, 0xf2, + 0xbe, 0x01, 0xec, 0x79, 0x91, 0xbb, 0xbc, 0x4b, 0x56, 0x01, 0xb5, 0x6f, 0xd0, 0x27, 0x40, 0x9e, + 0x8f, 0xd4, 0x31, 0x1f, 0xa1, 0x57, 0xea, 0x6e, 0xce, 0x7f, 0xe6, 0xcc, 0xef, 0x9c, 0xc9, 0xf1, + 0x5f, 0x81, 0xa7, 0x19, 0xc9, 0xb3, 0x10, 0x95, 0x59, 0x41, 0x05, 0x0f, 0x17, 0x53, 0xbb, 0x0c, + 0xae, 0x72, 0x51, 0x08, 0x77, 0xbf, 0xda, 0x0e, 0xac, 0xb6, 0x98, 0x1e, 0xbe, 0x35, 0x13, 0x33, + 0xa1, 0xf6, 0xc2, 0x6a, 0xa5, 0x8f, 0x1d, 0xfa, 0x33, 0x21, 0x66, 0x73, 0x12, 0xaa, 0x28, 0x2d, + 0x2f, 0xc2, 0x82, 0x32, 0x22, 0x0b, 0xc4, 0xae, 0xcc, 0x81, 0x61, 0x26, 0x24, 0x13, 0x32, 0x4c, + 0x91, 0x24, 0xe1, 0x62, 0x9a, 0x92, 0x02, 0x4d, 0xc3, 0x4c, 0x50, 0xc3, 0x19, 0x77, 0xa0, 0x7d, + 0x8e, 0x72, 0xc4, 0xe4, 0xf8, 0x37, 0x80, 0x27, 0x67, 0x9a, 0xe7, 0x0e, 0x60, 0x8b, 0x62, 0xcf, + 0x19, 0x39, 0x93, 0x6e, 0xbc, 0x45, 0xb1, 0x1b, 0xc2, 0xce, 0xf7, 0x94, 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 0xc7, 0x32, 0x38, + 0x02, 0x90, 0x52, 0x9c, 0x20, 0x26, 0x4a, 0x5e, 0x3c, 0xd8, 0x47, 0xef, 0x53, 0x2d, 0xa6, 0xa6, + 0xc4, 0xdd, 0x94, 0xe2, 0x33, 0xb5, 0xd6, 0x13, 0x1a, 0x7d, 0xf2, 0xea, 0x66, 0xe8, 0xbc, 0xbe, + 0x19, 0x3a, 0x7f, 0xde, 0x0c, 0x9d, 0x97, 0xb7, 0xc3, 0xd6, 0xeb, 0xdb, 0x61, 0xeb, 0xf7, 0xdb, + 0x61, 0xeb, 0xdb, 0xe3, 0x19, 0x2d, 0x82, 0x05, 0x4e, 0x83, 0x42, 0x84, 0xd5, 0xd4, 0x3f, 0xa7, + 0x22, 0x9c, 0xa3, 0x4c, 0x70, 0x9a, 0xe1, 0xf0, 0xda, 0xfe, 0xad, 0x49, 0xdb, 0xea, 0x9d, 0x3f, + 0xfa, 0x2b, 0x00, 0x00, 0xff, 0xff, 0xb8, 0x67, 0x62, 0x6b, 0xf8, 0x08, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -329,6 +332,18 @@ func (m *Auction) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.FundsReleased { + i-- + if m.FundsReleased { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x80 + } if m.NumProviders != 0 { i = encodeVarintAuction(dAtA, i, uint64(m.NumProviders)) i-- @@ -669,6 +684,9 @@ func (m *Auction) Size() (n int) { if m.NumProviders != 0 { n += 1 + sovAuction(uint64(m.NumProviders)) } + if m.FundsReleased { + n += 3 + } return n } @@ -1284,6 +1302,26 @@ func (m *Auction) Unmarshal(dAtA []byte) error { break } } + case 16: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FundsReleased", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.FundsReleased = bool(v != 0) default: iNdEx = preIndex skippy, err := skipAuction(dAtA[iNdEx:]) diff --git a/x/auction/tx.pb.go b/x/auction/tx.pb.go index 03f5fa39..1d4946d7 100644 --- a/x/auction/tx.pb.go +++ b/x/auction/tx.pb.go @@ -393,6 +393,86 @@ func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo +// ReleaseFunds defines the message to pay the winners of provider auctions +type MsgReleaseFunds struct { + // Auction id + AuctionId string `protobuf:"bytes,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty" json:"auction_id" yaml:"auction_id"` + // Address of the signer + Signer string `protobuf:"bytes,2,opt,name=signer,proto3" json:"signer,omitempty" json:"signer" yaml:"signer"` +} + +func (m *MsgReleaseFunds) Reset() { *m = MsgReleaseFunds{} } +func (m *MsgReleaseFunds) String() string { return proto.CompactTextString(m) } +func (*MsgReleaseFunds) ProtoMessage() {} +func (*MsgReleaseFunds) Descriptor() ([]byte, []int) { + return fileDescriptor_70947cda59e835fd, []int{8} +} +func (m *MsgReleaseFunds) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgReleaseFunds) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgReleaseFunds.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgReleaseFunds) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgReleaseFunds.Merge(m, src) +} +func (m *MsgReleaseFunds) XXX_Size() int { + return m.Size() +} +func (m *MsgReleaseFunds) XXX_DiscardUnknown() { + xxx_messageInfo_MsgReleaseFunds.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgReleaseFunds proto.InternalMessageInfo + +// MsgReleaseFundsResponse returns the state of the auction after releasing the funds +type MsgReleaseFundsResponse struct { + // Auction details + Auction *Auction `protobuf:"bytes,1,opt,name=auction,proto3" json:"auction,omitempty" json:"auction" yaml:"auction"` +} + +func (m *MsgReleaseFundsResponse) Reset() { *m = MsgReleaseFundsResponse{} } +func (m *MsgReleaseFundsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgReleaseFundsResponse) ProtoMessage() {} +func (*MsgReleaseFundsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_70947cda59e835fd, []int{9} +} +func (m *MsgReleaseFundsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgReleaseFundsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgReleaseFundsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgReleaseFundsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgReleaseFundsResponse.Merge(m, src) +} +func (m *MsgReleaseFundsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgReleaseFundsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgReleaseFundsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgReleaseFundsResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgCreateAuction)(nil), "cerc.auction.v1.MsgCreateAuction") proto.RegisterType((*MsgCreateAuctionResponse)(nil), "cerc.auction.v1.MsgCreateAuctionResponse") @@ -402,73 +482,79 @@ func init() { proto.RegisterType((*MsgRevealBidResponse)(nil), "cerc.auction.v1.MsgRevealBidResponse") proto.RegisterType((*MsgUpdateParams)(nil), "cerc.auction.v1.MsgUpdateParams") proto.RegisterType((*MsgUpdateParamsResponse)(nil), "cerc.auction.v1.MsgUpdateParamsResponse") + proto.RegisterType((*MsgReleaseFunds)(nil), "cerc.auction.v1.MsgReleaseFunds") + proto.RegisterType((*MsgReleaseFundsResponse)(nil), "cerc.auction.v1.MsgReleaseFundsResponse") } func init() { proto.RegisterFile("cerc/auction/v1/tx.proto", fileDescriptor_70947cda59e835fd) } var fileDescriptor_70947cda59e835fd = []byte{ - // 967 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x96, 0xc1, 0x6b, 0xdc, 0xc6, - 0x17, 0xc7, 0x57, 0x59, 0x7b, 0x93, 0x9d, 0x75, 0x7e, 0x0e, 0xc2, 0x3f, 0x2c, 0xaf, 0xeb, 0xd5, - 0x5a, 0xc6, 0xc4, 0x4e, 0xb1, 0x84, 0xb7, 0xb4, 0x01, 0xf7, 0x50, 0xac, 0x94, 0xd0, 0x16, 0x0c, - 0x46, 0x25, 0x97, 0x5c, 0x96, 0x59, 0x69, 0x22, 0x4f, 0x6b, 0x69, 0x16, 0x8d, 0x76, 0xeb, 0xdc, - 0xda, 0x1c, 0x4a, 0x8f, 0x81, 0x5e, 0x7a, 0xec, 0x9f, 0x90, 0x43, 0xff, 0x88, 0x1c, 0x43, 0x0b, - 0xa5, 0xbd, 0x6c, 0x5b, 0xbb, 0x90, 0x4b, 0x4f, 0xfb, 0x17, 0x94, 0x99, 0x79, 0xb3, 0xab, 0xd5, - 0x9a, 0x18, 0x43, 0xe8, 0x4d, 0xf3, 0xde, 0x9b, 0xf7, 0x79, 0xf3, 0x9d, 0xf7, 0x24, 0x21, 0x2b, - 0x24, 0x59, 0xe8, 0xe1, 0x41, 0x98, 0x53, 0x96, 0x7a, 0xc3, 0x7d, 0x2f, 0x3f, 0x73, 0xfb, 0x19, - 0xcb, 0x99, 0xb9, 0x2c, 0x3c, 0x2e, 0x78, 0xdc, 0xe1, 0x7e, 0x73, 0x35, 0x64, 0x3c, 0x61, 0xdc, - 0x4b, 0x78, 0x2c, 0x02, 0x13, 0x1e,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c, 0x40, 0x83, 0xe6, 0xec, - 0x3f, 0xfc, 0x61, 0x1b, 0xc1, 0x32, 0x98, 0x75, 0x36, 0x59, 0x43, 0x46, 0x86, 0x04, 0x9f, 0x16, - 0x6a, 0x58, 0xb8, 0x66, 0x0d, 0xe5, 0x04, 0xba, 0x86, 0x39, 0xbb, 0xaa, 0x01, 0xcc, 0x93, 0x1a, - 0x08, 0x42, 0xaa, 0xac, 0xee, 0x13, 0x42, 0xac, 0x45, 0x80, 0xc3, 0x45, 0x8a, 0x5b, 0x77, 0xe1, - 0xd6, 0xdd, 0x07, 0x8c, 0xa6, 0xfe, 0xbb, 0x00, 0xdf, 0x2a, 0x0a, 0x20, 0xb6, 0xce, 0x1e, 0x5d, - 0x5a, 0x82, 0xba, 0x5a, 0x3c, 0x24, 0x44, 0x60, 0x14, 0x59, 0x62, 0x6a, 0xd7, 0xc4, 0x4c, 0xb7, - 0xce, 0x9e, 0x0e, 0x30, 0x6a, 0x21, 0x30, 0x14, 0x35, 0x12, 0x9a, 0xd2, 0x64, 0x90, 0x74, 0x7b, - 0x34, 0xb2, 0x6e, 0x5e, 0xc5, 0xd9, 0x03, 0xce, 0xb6, 0xe2, 0x14, 0xf6, 0x6a, 0x50, 0xd1, 0x14, - 0x20, 0x58, 0xf9, 0x34, 0x32, 0x31, 0xaa, 0x27, 0xf8, 0xac, 0xdb, 0xcf, 0x68, 0x48, 0xac, 0x5b, - 0x57, 0x81, 0x76, 0x01, 0xb4, 0x09, 0x20, 0xbd, 0x73, 0x82, 0x99, 0x18, 0x82, 0x5b, 0x09, 0x3e, - 0x3b, 0x16, 0x8f, 0xe6, 0x16, 0xba, 0x9d, 0x0e, 0x12, 0x31, 0x5b, 0x43, 0x1a, 0x91, 0x8c, 0x5b, - 0xf5, 0xb6, 0xb1, 0xb3, 0x18, 0x2c, 0xa5, 0x83, 0xe4, 0x58, 0xdb, 0x0e, 0x96, 0xbf, 0xfb, 0xd1, - 0xae, 0x3c, 0x7b, 0xfd, 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96, 0xbb, 0x18, 0xd1, 0xdc, 0xb9, 0x2a, 0x42, 0x17, 0xd0, 0x5c, 0xfc, 0xfa, 0xf5, 0x8b, 0x7b, - 0x86, 0xff, 0xd1, 0xcb, 0xf3, 0x96, 0xf1, 0xea, 0xbc, 0x65, 0xfc, 0x79, 0xde, 0x32, 0x9e, 0x5f, - 0xb4, 0x2a, 0xaf, 0x2e, 0x5a, 0x95, 0xdf, 0x2e, 0x5a, 0x95, 0xc7, 0xdb, 0x31, 0xcd, 0xdd, 0x61, - 0xd4, 0x73, 0xc5, 0x6f, 0x15, 0xc9, 0xc2, 0x3d, 0xca, 0xbc, 0x53, 0x1c, 0xb2, 0x94, 0x86, 0x91, - 0x77, 0xa6, 0x2b, 0xee, 0xd5, 0xe4, 0xff, 0xc1, 0x7b, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0xd2, - 0x88, 0x14, 0x9a, 0x40, 0x0a, 0x00, 0x00, + // 1025 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x4f, 0x6f, 0xe3, 0x44, + 0x14, 0x8f, 0xdb, 0x34, 0xbb, 0x99, 0x74, 0xe9, 0xca, 0x2a, 0xaa, 0x9b, 0xd2, 0x38, 0x75, 0x55, + 0xb6, 0x5d, 0x54, 0x5b, 0x0d, 0x82, 0x95, 0xca, 0x01, 0x35, 0x8b, 0x2a, 0x40, 0xaa, 0x54, 0x19, + 0xed, 0x65, 0x2f, 0xd1, 0xc4, 0x9e, 0xba, 0x03, 0xb1, 0x1d, 0x79, 0x9c, 0xd0, 0xbd, 0x41, 0x0f, + 0x88, 0xe3, 0x4a, 0x5c, 0x38, 0x22, 0xf1, 0x05, 0xf6, 0xc0, 0x87, 0xd8, 0xe3, 0x0a, 0x24, 0x04, + 0x97, 0x80, 0x5a, 0xc4, 0x5e, 0x38, 0xe5, 0x13, 0xa0, 0x99, 0x79, 0xfe, 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0x5c, 0x6d, 0x4e, 0xb8, 0xad, 0x8d, 0x47, 0xfa, 0x8a, 0x74, 0xe3, 0xd2, 0xc4, 0x49, 0x7c, + 0xdb, 0xc2, 0x50, 0xfd, 0x56, 0x41, 0x77, 0x9d, 0xd0, 0xf7, 0x69, 0xcc, 0x3a, 0x49, 0xcd, 0xda, + 0x7c, 0x53, 0xd9, 0xae, 0xb5, 0x56, 0x4d, 0x49, 0x8a, 0x99, 0x90, 0x62, 0x7e, 0x02, 0x06, 0xed, + 0x8f, 0x9e, 0x8f, 0xf4, 0xd2, 0x78, 0xa4, 0x5b, 0x32, 0x78, 0x31, 0x40, 0x02, 0x34, 0x25, 0xff, + 0xf1, 0x2f, 0x5d, 0xb1, 0x97, 0x40, 0x9c, 0x44, 0x13, 0x39, 0x44, 0x64, 0x48, 0x70, 0x2f, 0x97, + 0x43, 0xf9, 0x9a, 0x39, 0x14, 0x03, 0x24, 0x39, 0x4c, 0xc9, 0x65, 0x0e, 0x20, 0x4e, 0x73, 0x20, + 0x08, 0xc9, 0xb4, 0x3a, 0x27, 0x84, 0x68, 0x0b, 0x00, 0x0e, 0x8d, 0xe4, 0x5d, 0x37, 0xa1, 0xeb, + 0xe6, 0xc3, 0x90, 0x06, 0xed, 0xf7, 0x00, 0x7c, 0x33, 0x4f, 0x00, 0x77, 0x9d, 0x2c, 0x5d, 0x48, + 0xec, 0xaa, 0x3c, 0x1c, 0x12, 0xc2, 0x61, 0x24, 0xb2, 0x80, 0xa9, 0x5c, 0x13, 0x26, 0x73, 0x9d, + 0xac, 0x0e, 0x60, 0xe4, 0x81, 0xc3, 0x50, 0x54, 0xf3, 0x69, 0x40, 0xfd, 0x81, 0xdf, 0xe9, 0x52, + 0x57, 0xbb, 0x75, 0x15, 0xce, 0x2e, 0xe0, 0x6c, 0x49, 0x9c, 0x9c, 0x6f, 0x02, 0x94, 0x17, 0xd9, + 0x08, 0x4e, 0x6d, 0xea, 0xaa, 0x18, 0x55, 0x7d, 0x7c, 0x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 0x5a, 0x67, 0x49, 0xe0, 0x6e, 0x45, + 0x3c, 0xe1, 0xde, 0xff, 0x3f, 0x00, 0x00, 0xff, 0xff, 0xcf, 0x56, 0x96, 0xba, 0xe3, 0x0b, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -492,6 +578,8 @@ type MsgClient interface { // UpdateParams defines an operation for updating the x/staking module // parameters. UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + // ReleaseFunds is the command for paying the winners of provider auctions + ReleaseFunds(ctx context.Context, in *MsgReleaseFunds, opts ...grpc.CallOption) (*MsgReleaseFundsResponse, error) } type msgClient struct { @@ -538,6 +626,15 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts return out, nil } +func (c *msgClient) ReleaseFunds(ctx context.Context, in *MsgReleaseFunds, opts ...grpc.CallOption) (*MsgReleaseFundsResponse, error) { + out := new(MsgReleaseFundsResponse) + err := c.cc.Invoke(ctx, "/cerc.auction.v1.Msg/ReleaseFunds", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { // CreateAuction is the command for creating an auction @@ -549,6 +646,8 @@ type MsgServer interface { // UpdateParams defines an operation for updating the x/staking module // parameters. UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + // ReleaseFunds is the command for paying the winners of provider auctions + ReleaseFunds(context.Context, *MsgReleaseFunds) (*MsgReleaseFundsResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -567,6 +666,9 @@ func (*UnimplementedMsgServer) RevealBid(ctx context.Context, req *MsgRevealBid) func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") } +func (*UnimplementedMsgServer) ReleaseFunds(ctx context.Context, req *MsgReleaseFunds) (*MsgReleaseFundsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ReleaseFunds not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -644,6 +746,24 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Msg_ReleaseFunds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgReleaseFunds) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ReleaseFunds(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cerc.auction.v1.Msg/ReleaseFunds", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ReleaseFunds(ctx, req.(*MsgReleaseFunds)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "cerc.auction.v1.Msg", HandlerType: (*MsgServer)(nil), @@ -664,6 +784,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "UpdateParams", Handler: _Msg_UpdateParams_Handler, }, + { + MethodName: "ReleaseFunds", + Handler: _Msg_ReleaseFunds_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cerc/auction/v1/tx.proto", @@ -1023,6 +1147,78 @@ func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *MsgReleaseFunds) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgReleaseFunds) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgReleaseFunds) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x12 + } + if len(m.AuctionId) > 0 { + i -= len(m.AuctionId) + copy(dAtA[i:], m.AuctionId) + i = encodeVarintTx(dAtA, i, uint64(len(m.AuctionId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgReleaseFundsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgReleaseFundsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgReleaseFundsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Auction != nil { + { + size, err := m.Auction.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -1171,6 +1367,36 @@ func (m *MsgUpdateParamsResponse) Size() (n int) { return n } +func (m *MsgReleaseFunds) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.AuctionId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgReleaseFundsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Auction != nil { + l = m.Auction.Size() + n += 1 + l + sovTx(uint64(l)) + } + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2223,6 +2449,206 @@ func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgReleaseFunds) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgReleaseFunds: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgReleaseFunds: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AuctionId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgReleaseFundsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgReleaseFundsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgReleaseFundsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Auction", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Auction == nil { + m.Auction = &Auction{} + } + if err := m.Auction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/auction/tx.pb.gw.go b/x/auction/tx.pb.gw.go index d8378e71..2001582e 100644 --- a/x/auction/tx.pb.gw.go +++ b/x/auction/tx.pb.gw.go @@ -141,6 +141,42 @@ func local_request_Msg_RevealBid_0(ctx context.Context, marshaler runtime.Marsha } +var ( + filter_Msg_ReleaseFunds_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Msg_ReleaseFunds_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq MsgReleaseFunds + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_ReleaseFunds_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ReleaseFunds(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Msg_ReleaseFunds_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq MsgReleaseFunds + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_ReleaseFunds_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ReleaseFunds(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". // UnaryRPC :call MsgServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -216,6 +252,29 @@ func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server }) + mux.Handle("POST", pattern_Msg_ReleaseFunds_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Msg_ReleaseFunds_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Msg_ReleaseFunds_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -317,6 +376,26 @@ func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client }) + mux.Handle("POST", pattern_Msg_ReleaseFunds_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Msg_ReleaseFunds_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Msg_ReleaseFunds_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -326,6 +405,8 @@ var ( pattern_Msg_CommitBid_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cerc", "auction", "v1", "commit_bid"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Msg_RevealBid_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cerc", "auction", "v1", "reveal_bid"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Msg_ReleaseFunds_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cerc", "auction", "v1", "release_funds"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -334,4 +415,6 @@ var ( forward_Msg_CommitBid_0 = runtime.ForwardResponseMessage forward_Msg_RevealBid_0 = runtime.ForwardResponseMessage + + forward_Msg_ReleaseFunds_0 = runtime.ForwardResponseMessage ) -- 2.45.2 From 01bc492371e7186611a079eb39e33cefc0914ab7 Mon Sep 17 00:00:00 2001 From: IshaVenikar Date: Mon, 23 Sep 2024 18:00:15 +0530 Subject: [PATCH 24/29] Add method to release provider funds after auction completion --- x/auction/events.go | 1 + x/auction/keeper/keeper.go | 76 ++++++++++++++++++++++++++-------- x/auction/keeper/msg_server.go | 37 +++++++++++++++++ x/auction/msgs.go | 39 +++++++++++++---- x/auction/types.go | 3 ++ 5 files changed, 129 insertions(+), 27 deletions(-) diff --git a/x/auction/events.go b/x/auction/events.go index b60264f5..3807b3c0 100644 --- a/x/auction/events.go +++ b/x/auction/events.go @@ -4,6 +4,7 @@ const ( EventTypeCreateAuction = "create-auction" EventTypeCommitBid = "commit-bid" EventTypeRevealBid = "reveal-bid" + EventTypeReleaseFunds = "release-funds" AttributeKeyCommitsDuration = "commits-duration" AttributeKeyRevealsDuration = "reveals-duration" diff --git a/x/auction/keeper/keeper.go b/x/auction/keeper/keeper.go index 05e99473..babdebfa 100644 --- a/x/auction/keeper/keeper.go +++ b/x/auction/keeper/keeper.go @@ -886,24 +886,6 @@ func (k Keeper) pickProviderAuctionWinners(ctx sdk.Context, auction *auctiontype } } - // Process winner accounts (if nobody bids, there won't be a winner). - if len(winnerBids) > 0 { - for _, bid := range winnerBids { - winnerAddress, err := sdk.AccAddressFromBech32(bid.BidderAddress) - if err != nil { - k.Logger(ctx).Error(fmt.Sprintf("Invalid winner address. %v", err)) - panic("Invalid winner address.") - } - - // Send winning price to bidders - sdkErr := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, auctiontypes.ModuleName, winnerAddress, sdk.NewCoins(auction.WinningPrice)) - if sdkErr != nil { - k.Logger(ctx).Error(fmt.Sprintf("Auction error sending funds to winner: %v", sdkErr)) - panic(sdkErr) - } - } - } - // Send back any leftover locked amount to auction creator // All of it in case of no winners totalLockedAmount := auction.MaxPrice.Amount.Mul(math.NewInt(int64(auction.NumProviders))) @@ -936,3 +918,61 @@ func (k Keeper) pickProviderAuctionWinners(ctx sdk.Context, auction *auctiontype return nil } + +func (k Keeper) ReleaseFunds(ctx sdk.Context, msg auctiontypes.MsgReleaseFunds) (*auctiontypes.Auction, error) { + if has, err := k.HasAuction(ctx, msg.AuctionId); !has { + if err != nil { + return nil, err + } + return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Auction not found.") + } + + auction, err := k.GetAuctionById(ctx, msg.AuctionId) + if err != nil { + return nil, err + } + + if auction.Kind != auctiontypes.AuctionKindProvider { + return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Auction kind must be provider.") + } + + if auction.Status != auctiontypes.AuctionStatusCompleted { + return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Auction is not completed.") + } + + if auction.Status == auctiontypes.AuctionStatusFundsReleased { + return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Funds have already been released.") + } + + // Only the auction owner can release funds. + if msg.Signer != auction.OwnerAddress { + return nil, errorsmod.Wrap(sdkerrors.ErrUnauthorized, "Auction owner mismatch.") + } + + // Process winner accounts (if nobody bids, there won't be a winner). + if len(auction.WinnerAddresses) > 0 { + for _, winnerAddress := range auction.WinnerAddresses { + winnerAccAddress, err := sdk.AccAddressFromBech32(winnerAddress) + if err != nil { + k.Logger(ctx).Error(fmt.Sprintf("Invalid winner address. %v", err)) + panic("Invalid winner address.") + } + + // Send winning price to bidders + sdkErr := k.bankKeeper.SendCoinsFromModuleToAccount( + ctx, + auctiontypes.ModuleName, + winnerAccAddress, + sdk.NewCoins(auction.WinningPrice), + ) + if sdkErr != nil { + k.Logger(ctx).Error(fmt.Sprintf("Auction error sending funds to winner: %v", sdkErr)) + panic(sdkErr) + } + } + } + + auction.FundsReleased = true + + return &auction, err +} diff --git a/x/auction/keeper/msg_server.go b/x/auction/keeper/msg_server.go index 0a5fc447..7cc9ff30 100644 --- a/x/auction/keeper/msg_server.go +++ b/x/auction/keeper/msg_server.go @@ -149,3 +149,40 @@ func (ms msgServer) UpdateParams(c context.Context, msg *auctiontypes.MsgUpdateP return &auctiontypes.MsgUpdateParamsResponse{}, nil } + +// ReleaseFunds is the command to pay the winning amounts to provider auction winners +// nolint: all +func (ms msgServer) ReleaseFunds(c context.Context, msg *auctiontypes.MsgReleaseFunds) (*auctiontypes.MsgReleaseFundsResponse, error) { + if err := msg.ValidateBasic(); err != nil { + return nil, err + } + + ctx := sdk.UnwrapSDKContext(c) + ctx = *utils.CtxWithCustomKVGasConfig(&ctx) + + signerAddress, err := sdk.AccAddressFromBech32(msg.Signer) + if err != nil { + return nil, err + } + + resp, err := ms.k.ReleaseFunds(ctx, *msg) + if err != nil { + return nil, err + } + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + auctiontypes.EventTypeReleaseFunds, + sdk.NewAttribute(auctiontypes.AttributeKeyAuctionId, msg.AuctionId), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, auctiontypes.AttributeValueCategory), + sdk.NewAttribute(auctiontypes.AttributeKeySigner, signerAddress.String()), + ), + }) + + utils.LogTxGasConsumed(ctx, ms.k.Logger(ctx), "ReleaseFunds") + + return &auctiontypes.MsgReleaseFundsResponse{Auction: resp}, nil +} diff --git a/x/auction/msgs.go b/x/auction/msgs.go index 2945ca35..c35c7eda 100644 --- a/x/auction/msgs.go +++ b/x/auction/msgs.go @@ -49,6 +49,23 @@ func NewMsgCommitBid(auctionId string, commitHash string, signer sdk.AccAddress) } } +// NewMsgRevealBid is the constructor function for MsgRevealBid. +func NewMsgRevealBid(auctionId string, reveal string, signer sdk.AccAddress) MsgRevealBid { + return MsgRevealBid{ + AuctionId: auctionId, + Reveal: reveal, + Signer: signer.String(), + } +} + +// NewMsgReleaseFunds is the constructor function for MsgReleaseFunds. +func NewMsgReleaseFunds(auctionId string, signer sdk.AccAddress) MsgReleaseFunds { + return MsgReleaseFunds{ + AuctionId: auctionId, + Signer: signer.String(), + } +} + // ValidateBasic Implements Msg. func (msg MsgCreateAuction) ValidateBasic() error { if msg.Signer == "" { @@ -101,15 +118,6 @@ func (msg MsgCommitBid) ValidateBasic() error { return nil } -// NewMsgRevealBid is the constructor function for MsgRevealBid. -func NewMsgRevealBid(auctionId string, reveal string, signer sdk.AccAddress) MsgRevealBid { - return MsgRevealBid{ - AuctionId: auctionId, - Reveal: reveal, - Signer: signer.String(), - } -} - // ValidateBasic Implements Msg. func (msg MsgRevealBid) ValidateBasic() error { if msg.Signer == "" { @@ -126,3 +134,16 @@ func (msg MsgRevealBid) ValidateBasic() error { return nil } + +// ValidateBasic Implements Msg. +func (msg MsgReleaseFunds) ValidateBasic() error { + if msg.Signer == "" { + return errorsmod.Wrap(sdkerrors.ErrInvalidAddress, "invalid signer address") + } + + if msg.AuctionId == "" { + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "invalid auction id") + } + + return nil +} diff --git a/x/auction/types.go b/x/auction/types.go index 266f0c32..17eaef2a 100644 --- a/x/auction/types.go +++ b/x/auction/types.go @@ -21,6 +21,9 @@ const ( // Auction has completed (winner selected). AuctionStatusCompleted = "completed" + + // Auction has completed (winner selected). + AuctionStatusFundsReleased = "funds_released" ) // Bid status values. -- 2.45.2 From 552db0322740240346b91f4c93fbee3ee8001de7 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Tue, 24 Sep 2024 11:12:57 +0530 Subject: [PATCH 25/29] Save auction object on releasing funds --- api/cerc/auction/v1/tx.pulsar.go | 3 +- proto/cerc/auction/v1/auction.proto | 6 +-- proto/cerc/auction/v1/tx.proto | 3 +- x/auction/keeper/keeper.go | 75 ++++++++++++++--------------- x/auction/keeper/msg_server.go | 3 -- x/auction/tx.pb.go | 3 +- 6 files changed, 44 insertions(+), 49 deletions(-) diff --git a/api/cerc/auction/v1/tx.pulsar.go b/api/cerc/auction/v1/tx.pulsar.go index 7f679762..6b35dcc4 100644 --- a/api/cerc/auction/v1/tx.pulsar.go +++ b/api/cerc/auction/v1/tx.pulsar.go @@ -5668,7 +5668,8 @@ func (x *MsgReleaseFunds) GetSigner() string { return "" } -// MsgReleaseFundsResponse returns the state of the auction after releasing the funds +// MsgReleaseFundsResponse returns the state of the auction after releasing the +// funds type MsgReleaseFundsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/proto/cerc/auction/v1/auction.proto b/proto/cerc/auction/v1/auction.proto index 91985750..9aea35fa 100644 --- a/proto/cerc/auction/v1/auction.proto +++ b/proto/cerc/auction/v1/auction.proto @@ -95,9 +95,9 @@ message Auction { // Only applicable in provider auctions int32 num_providers = 15; - bool funds_released = 16 [ - (gogoproto.moretags) = - "json:\"funds_released\" yaml:\"funds_released\"" ]; + bool funds_released = 16 + [ (gogoproto.moretags) = + "json:\"funds_released\" yaml:\"funds_released\"" ]; } // Auctions represent all the auctions in the module diff --git a/proto/cerc/auction/v1/tx.proto b/proto/cerc/auction/v1/tx.proto index c93e1be6..27673d96 100644 --- a/proto/cerc/auction/v1/tx.proto +++ b/proto/cerc/auction/v1/tx.proto @@ -192,7 +192,8 @@ message MsgReleaseFunds { [ (gogoproto.moretags) = "json:\"signer\" yaml:\"signer\"" ]; } -// MsgReleaseFundsResponse returns the state of the auction after releasing the funds +// MsgReleaseFundsResponse returns the state of the auction after releasing the +// funds message MsgReleaseFundsResponse { option (gogoproto.goproto_getters) = false; diff --git a/x/auction/keeper/keeper.go b/x/auction/keeper/keeper.go index babdebfa..040517d4 100644 --- a/x/auction/keeper/keeper.go +++ b/x/auction/keeper/keeper.go @@ -892,16 +892,16 @@ func (k Keeper) pickProviderAuctionWinners(ctx sdk.Context, auction *auctiontype totalAmountPaid := auction.WinningPrice.Amount.Mul(math.NewInt(int64(len(auction.WinnerAddresses)))) creatorLeftOverAmount := sdk.NewCoin(auction.MaxPrice.Denom, totalLockedAmount.Sub(totalAmountPaid)) - creatorAddress, err := sdk.AccAddressFromBech32(auction.OwnerAddress) + ownerAccAddress, err := sdk.AccAddressFromBech32(auction.OwnerAddress) if err != nil { - k.Logger(ctx).Error(fmt.Sprintf("Invalid creatorAddress address. %v", err)) - panic("Invalid creator address.") + k.Logger(ctx).Error(fmt.Sprintf("Invalid auction owner address. %v", err)) + panic("Invalid auction owner address.") } sdkErr := k.bankKeeper.SendCoinsFromModuleToAccount( ctx, auctiontypes.ModuleName, - creatorAddress, + ownerAccAddress, sdk.NewCoins(creatorLeftOverAmount), ) if sdkErr != nil { @@ -920,13 +920,6 @@ func (k Keeper) pickProviderAuctionWinners(ctx sdk.Context, auction *auctiontype } func (k Keeper) ReleaseFunds(ctx sdk.Context, msg auctiontypes.MsgReleaseFunds) (*auctiontypes.Auction, error) { - if has, err := k.HasAuction(ctx, msg.AuctionId); !has { - if err != nil { - return nil, err - } - return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Auction not found.") - } - auction, err := k.GetAuctionById(ctx, msg.AuctionId) if err != nil { return nil, err @@ -936,43 +929,45 @@ func (k Keeper) ReleaseFunds(ctx sdk.Context, msg auctiontypes.MsgReleaseFunds) return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Auction kind must be provider.") } - if auction.Status != auctiontypes.AuctionStatusCompleted { - return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Auction is not completed.") - } - - if auction.Status == auctiontypes.AuctionStatusFundsReleased { - return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Funds have already been released.") - } - // Only the auction owner can release funds. if msg.Signer != auction.OwnerAddress { return nil, errorsmod.Wrap(sdkerrors.ErrUnauthorized, "Auction owner mismatch.") } - // Process winner accounts (if nobody bids, there won't be a winner). - if len(auction.WinnerAddresses) > 0 { - for _, winnerAddress := range auction.WinnerAddresses { - winnerAccAddress, err := sdk.AccAddressFromBech32(winnerAddress) - if err != nil { - k.Logger(ctx).Error(fmt.Sprintf("Invalid winner address. %v", err)) - panic("Invalid winner address.") - } + if auction.Status != auctiontypes.AuctionStatusCompleted { + return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Auction is not completed.") + } - // Send winning price to bidders - sdkErr := k.bankKeeper.SendCoinsFromModuleToAccount( - ctx, - auctiontypes.ModuleName, - winnerAccAddress, - sdk.NewCoins(auction.WinningPrice), - ) - if sdkErr != nil { - k.Logger(ctx).Error(fmt.Sprintf("Auction error sending funds to winner: %v", sdkErr)) - panic(sdkErr) - } + if auction.Status == auctiontypes.AuctionStatusFundsReleased { + return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Auction funds already released.") + } + + // Mark funds as released in the stored auction + auction.FundsReleased = true + if err = k.SaveAuction(ctx, &auction); err != nil { + return nil, err + } + + // Process winner accounts. + for _, winnerAddress := range auction.WinnerAddresses { + winnerAccAddress, err := sdk.AccAddressFromBech32(winnerAddress) + if err != nil { + k.Logger(ctx).Error(fmt.Sprintf("Invalid winner address. %v", err)) + panic("Invalid winner address.") + } + + // Send winning price to winning bidders + sdkErr := k.bankKeeper.SendCoinsFromModuleToAccount( + ctx, + auctiontypes.ModuleName, + winnerAccAddress, + sdk.NewCoins(auction.WinningPrice), + ) + if sdkErr != nil { + k.Logger(ctx).Error(fmt.Sprintf("Auction error sending funds to winner: %v", sdkErr)) + panic(sdkErr) } } - auction.FundsReleased = true - return &auction, err } diff --git a/x/auction/keeper/msg_server.go b/x/auction/keeper/msg_server.go index 7cc9ff30..68012679 100644 --- a/x/auction/keeper/msg_server.go +++ b/x/auction/keeper/msg_server.go @@ -56,7 +56,6 @@ func (ms msgServer) CreateAuction(c context.Context, msg *auctiontypes.MsgCreate } // CommitBid is the command for committing a bid -// nolint: all func (ms msgServer) CommitBid(c context.Context, msg *auctiontypes.MsgCommitBid) (*auctiontypes.MsgCommitBidResponse, error) { if err := msg.ValidateBasic(); err != nil { return nil, err @@ -94,7 +93,6 @@ func (ms msgServer) CommitBid(c context.Context, msg *auctiontypes.MsgCommitBid) } // RevealBid is the command for revealing a bid -// nolint: all func (ms msgServer) RevealBid(c context.Context, msg *auctiontypes.MsgRevealBid) (*auctiontypes.MsgRevealBidResponse, error) { if err := msg.ValidateBasic(); err != nil { return nil, err @@ -151,7 +149,6 @@ func (ms msgServer) UpdateParams(c context.Context, msg *auctiontypes.MsgUpdateP } // ReleaseFunds is the command to pay the winning amounts to provider auction winners -// nolint: all func (ms msgServer) ReleaseFunds(c context.Context, msg *auctiontypes.MsgReleaseFunds) (*auctiontypes.MsgReleaseFundsResponse, error) { if err := msg.ValidateBasic(); err != nil { return nil, err diff --git a/x/auction/tx.pb.go b/x/auction/tx.pb.go index 1d4946d7..91cbdc5b 100644 --- a/x/auction/tx.pb.go +++ b/x/auction/tx.pb.go @@ -434,7 +434,8 @@ func (m *MsgReleaseFunds) XXX_DiscardUnknown() { var xxx_messageInfo_MsgReleaseFunds proto.InternalMessageInfo -// MsgReleaseFundsResponse returns the state of the auction after releasing the funds +// MsgReleaseFundsResponse returns the state of the auction after releasing the +// funds type MsgReleaseFundsResponse struct { // Auction details Auction *Auction `protobuf:"bytes,1,opt,name=auction,proto3" json:"auction,omitempty" json:"auction" yaml:"auction"` -- 2.45.2 From 40ece271d0271c1c2ca968575ce242c458444e2b Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Tue, 24 Sep 2024 11:58:52 +0530 Subject: [PATCH 26/29] Fix auction funds release check --- api/cerc/auction/v1/auction.pulsar.go | 6 ++++-- proto/cerc/auction/v1/auction.proto | 2 ++ x/auction/auction.pb.go | 6 ++++-- x/auction/keeper/keeper.go | 4 ++-- x/auction/types.go | 3 --- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/api/cerc/auction/v1/auction.pulsar.go b/api/cerc/auction/v1/auction.pulsar.go index d7851989..97ccb909 100644 --- a/api/cerc/auction/v1/auction.pulsar.go +++ b/api/cerc/auction/v1/auction.pulsar.go @@ -3563,8 +3563,10 @@ type Auction struct { MaxPrice *v1beta1.Coin `protobuf:"bytes,14,opt,name=max_price,json=maxPrice,proto3" json:"max_price,omitempty"` // Number of desired providers (num of auction winners) // Only applicable in provider auctions - NumProviders int32 `protobuf:"varint,15,opt,name=num_providers,json=numProviders,proto3" json:"num_providers,omitempty"` - FundsReleased bool `protobuf:"varint,16,opt,name=funds_released,json=fundsReleased,proto3" json:"funds_released,omitempty"` + NumProviders int32 `protobuf:"varint,15,opt,name=num_providers,json=numProviders,proto3" json:"num_providers,omitempty"` + // Whether funds have been released to providers + // Only applicable in provider auctions + FundsReleased bool `protobuf:"varint,16,opt,name=funds_released,json=fundsReleased,proto3" json:"funds_released,omitempty"` } func (x *Auction) Reset() { diff --git a/proto/cerc/auction/v1/auction.proto b/proto/cerc/auction/v1/auction.proto index 9aea35fa..76e7ac29 100644 --- a/proto/cerc/auction/v1/auction.proto +++ b/proto/cerc/auction/v1/auction.proto @@ -95,6 +95,8 @@ message Auction { // Only applicable in provider auctions int32 num_providers = 15; + // Whether funds have been released to providers + // Only applicable in provider auctions bool funds_released = 16 [ (gogoproto.moretags) = "json:\"funds_released\" yaml:\"funds_released\"" ]; diff --git a/x/auction/auction.pb.go b/x/auction/auction.pb.go index 21a05dfa..65bda830 100644 --- a/x/auction/auction.pb.go +++ b/x/auction/auction.pb.go @@ -102,8 +102,10 @@ type Auction struct { MaxPrice types.Coin `protobuf:"bytes,14,opt,name=max_price,json=maxPrice,proto3" json:"max_price" json:"max_price" yaml:"max_price"` // Number of desired providers (num of auction winners) // Only applicable in provider auctions - NumProviders int32 `protobuf:"varint,15,opt,name=num_providers,json=numProviders,proto3" json:"num_providers,omitempty"` - FundsReleased bool `protobuf:"varint,16,opt,name=funds_released,json=fundsReleased,proto3" json:"funds_released,omitempty" json:"funds_released" yaml:"funds_released"` + NumProviders int32 `protobuf:"varint,15,opt,name=num_providers,json=numProviders,proto3" json:"num_providers,omitempty"` + // Whether funds have been released to providers + // Only applicable in provider auctions + FundsReleased bool `protobuf:"varint,16,opt,name=funds_released,json=fundsReleased,proto3" json:"funds_released,omitempty" json:"funds_released" yaml:"funds_released"` } func (m *Auction) Reset() { *m = Auction{} } diff --git a/x/auction/keeper/keeper.go b/x/auction/keeper/keeper.go index 040517d4..e7d038f4 100644 --- a/x/auction/keeper/keeper.go +++ b/x/auction/keeper/keeper.go @@ -931,14 +931,14 @@ func (k Keeper) ReleaseFunds(ctx sdk.Context, msg auctiontypes.MsgReleaseFunds) // Only the auction owner can release funds. if msg.Signer != auction.OwnerAddress { - return nil, errorsmod.Wrap(sdkerrors.ErrUnauthorized, "Auction owner mismatch.") + return nil, errorsmod.Wrap(sdkerrors.ErrUnauthorized, "Only auction owner can release funds.") } if auction.Status != auctiontypes.AuctionStatusCompleted { return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Auction is not completed.") } - if auction.Status == auctiontypes.AuctionStatusFundsReleased { + if auction.FundsReleased { return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Auction funds already released.") } diff --git a/x/auction/types.go b/x/auction/types.go index 17eaef2a..266f0c32 100644 --- a/x/auction/types.go +++ b/x/auction/types.go @@ -21,9 +21,6 @@ const ( // Auction has completed (winner selected). AuctionStatusCompleted = "completed" - - // Auction has completed (winner selected). - AuctionStatusFundsReleased = "funds_released" ) // Bid status values. -- 2.45.2 From e5f27c246c8bf66de8643568f5fac8ae2a8955c9 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Tue, 24 Sep 2024 12:34:39 +0530 Subject: [PATCH 27/29] Add funds released flag in GQL schema --- gql/cerc-io/laconicd/schema.graphql | 1 + gql/generated.go | 63 +++++++++++++++++++++++++++++ gql/models_gen.go | 1 + gql/util.go | 1 + 4 files changed, 66 insertions(+) diff --git a/gql/cerc-io/laconicd/schema.graphql b/gql/cerc-io/laconicd/schema.graphql index be9f857f..a58159c4 100644 --- a/gql/cerc-io/laconicd/schema.graphql +++ b/gql/cerc-io/laconicd/schema.graphql @@ -174,6 +174,7 @@ type Auction { maxPrice: Coin! # Max bid amount for service provider auction. kind: String! # Auction kind. numProviders: Int # Number of service providers + fundsReleased: Boolean! # Whether funds have been released to providers bids: [AuctionBid!]! # Bids made in the auction. } diff --git a/gql/generated.go b/gql/generated.go index 5ebb69a9..81225cfb 100644 --- a/gql/generated.go +++ b/gql/generated.go @@ -65,6 +65,7 @@ type ComplexityRoot struct { CommitFee func(childComplexity int) int CommitsEndTime func(childComplexity int) int CreateTime func(childComplexity int) int + FundsReleased func(childComplexity int) int ID func(childComplexity int) int Kind func(childComplexity int) int MaxPrice func(childComplexity int) int @@ -349,6 +350,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Auction.CreateTime(childComplexity), true + case "Auction.fundsReleased": + if e.complexity.Auction.FundsReleased == nil { + break + } + + return e.complexity.Auction.FundsReleased(childComplexity), true + case "Auction.id": if e.complexity.Auction.ID == nil { break @@ -2450,6 +2458,50 @@ func (ec *executionContext) fieldContext_Auction_numProviders(ctx context.Contex return fc, nil } +func (ec *executionContext) _Auction_fundsReleased(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Auction_fundsReleased(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.FundsReleased, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Auction_fundsReleased(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Auction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _Auction_bids(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Auction_bids(ctx, field) if err != nil { @@ -3316,6 +3368,8 @@ func (ec *executionContext) fieldContext_AuthorityRecord_auction(ctx context.Con return ec.fieldContext_Auction_kind(ctx, field) case "numProviders": return ec.fieldContext_Auction_numProviders(ctx, field) + case "fundsReleased": + return ec.fieldContext_Auction_fundsReleased(ctx, field) case "bids": return ec.fieldContext_Auction_bids(ctx, field) } @@ -5309,6 +5363,8 @@ func (ec *executionContext) fieldContext_Query_getAuctionsByIds(ctx context.Cont return ec.fieldContext_Auction_kind(ctx, field) case "numProviders": return ec.fieldContext_Auction_numProviders(ctx, field) + case "fundsReleased": + return ec.fieldContext_Auction_fundsReleased(ctx, field) case "bids": return ec.fieldContext_Auction_bids(ctx, field) } @@ -8923,6 +8979,13 @@ func (ec *executionContext) _Auction(ctx context.Context, sel ast.SelectionSet, out.Values[i] = ec._Auction_numProviders(ctx, field, obj) + case "fundsReleased": + + out.Values[i] = ec._Auction_fundsReleased(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } case "bids": out.Values[i] = ec._Auction_bids(ctx, field, obj) diff --git a/gql/models_gen.go b/gql/models_gen.go index e8a62016..5afebccd 100644 --- a/gql/models_gen.go +++ b/gql/models_gen.go @@ -41,6 +41,7 @@ type Auction struct { MaxPrice *Coin `json:"maxPrice"` Kind string `json:"kind"` NumProviders *int `json:"numProviders"` + FundsReleased bool `json:"fundsReleased"` Bids []*AuctionBid `json:"bids"` } diff --git a/gql/util.go b/gql/util.go index bc295fc7..c8c70f09 100644 --- a/gql/util.go +++ b/gql/util.go @@ -250,6 +250,7 @@ func GetGQLAuction(auction *auctiontypes.Auction, bids []*auctiontypes.Bid) (*Au MaxPrice: getGQLCoin(auction.MaxPrice), Kind: auction.Kind, NumProviders: &numProviders, + FundsReleased: auction.FundsReleased, } auctionBids := make([]*AuctionBid, len(bids)) -- 2.45.2 From ee9b10eb005cd40cf32f84477f765d5f2b942045 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Tue, 24 Sep 2024 18:03:34 +0530 Subject: [PATCH 28/29] Return error on max price amount lock in instead of panic --- x/auction/keeper/keeper.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/x/auction/keeper/keeper.go b/x/auction/keeper/keeper.go index e7d038f4..850fa3f0 100644 --- a/x/auction/keeper/keeper.go +++ b/x/auction/keeper/keeper.go @@ -346,8 +346,7 @@ func (k Keeper) CreateAuction(ctx sdk.Context, msg auctiontypes.MsgCreateAuction sdkErr := k.bankKeeper.SendCoinsFromAccountToModule(ctx, signerAddress, auctiontypes.ModuleName, sdk.NewCoins(totalLockedAmount)) if sdkErr != nil { - k.Logger(ctx).Error(fmt.Sprintf("Auction error transferring maximum price amount: %v", sdkErr)) - panic(sdkErr) + return nil, errorsmod.Wrap(sdkErr, "Auction error transferring maximum price amount") } } -- 2.45.2 From b8c353182404cea89a778ed23fc9a092ce7c13f9 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Wed, 25 Sep 2024 12:01:13 +0530 Subject: [PATCH 29/29] Handle chain id commit bid CLI and update create auction CLI --- x/auction/client/cli/tx.go | 12 ++++++++++-- x/auction/module/autocli.go | 12 +++++++----- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/x/auction/client/cli/tx.go b/x/auction/client/cli/tx.go index 4e285f37..7ff1dda0 100644 --- a/x/auction/client/cli/tx.go +++ b/x/auction/client/cli/tx.go @@ -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{}{ diff --git a/x/auction/module/autocli.go b/x/auction/module/autocli.go index b1214695..e22afd8e 100644 --- a/x/auction/module/autocli.go +++ b/x/auction/module/autocli.go @@ -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)"}, }, }, { -- 2.45.2