make bids for lowest rather than highest

This commit is contained in:
2022-09-01 02:02:23 +00:00
parent 0d1513e35d
commit 8f4f5d270a
7 changed files with 30 additions and 30 deletions

View File

@@ -26,7 +26,7 @@ type Auction struct {
Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
TopBid *Bid `protobuf:"bytes,4,opt,name=topBid,proto3" json:"topBid,omitempty"`
Best *Bid `protobuf:"bytes,4,opt,name=best,proto3" json:"best,omitempty"`
Deadline uint64 `protobuf:"varint,5,opt,name=deadline,proto3" json:"deadline,omitempty"`
}
@@ -84,9 +84,9 @@ func (m *Auction) GetDescription() string {
return ""
}
func (m *Auction) GetTopBid() *Bid {
func (m *Auction) GetBest() *Bid {
if m != nil {
return m.TopBid
return m.Best
}
return nil
}
@@ -105,21 +105,21 @@ func init() {
func init() { proto.RegisterFile("cosmostest/auction.proto", fileDescriptor_631f6f59914101d9) }
var fileDescriptor_631f6f59914101d9 = []byte{
// 223 bytes of a gzipped FileDescriptorProto
// 221 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x48, 0xce, 0x2f, 0xce,
0xcd, 0x2f, 0x2e, 0x49, 0x2d, 0x2e, 0xd1, 0x4f, 0x2c, 0x4d, 0x2e, 0xc9, 0xcc, 0xcf, 0xd3, 0x2b,
0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x45, 0xc8, 0xe8, 0x21, 0x98, 0x52, 0x22, 0x48, 0x1a, 0x92,
0x32, 0x53, 0x20, 0x8a, 0x95, 0x96, 0x32, 0x72, 0xb1, 0x3b, 0x42, 0xb4, 0x0b, 0x89, 0x70, 0xb1,
0x32, 0x53, 0x20, 0x8a, 0x95, 0x16, 0x32, 0x72, 0xb1, 0x3b, 0x42, 0xb4, 0x0b, 0x89, 0x70, 0xb1,
0x66, 0xe6, 0xa5, 0xa4, 0x56, 0x48, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x06, 0x41, 0x38, 0x42, 0x42,
0x5c, 0x2c, 0x79, 0x89, 0xb9, 0xa9, 0x12, 0x4c, 0x60, 0x41, 0x30, 0x5b, 0x48, 0x81, 0x8b, 0x3b,
0x25, 0xb5, 0x38, 0xb9, 0x28, 0xb3, 0x00, 0xa4, 0x51, 0x82, 0x19, 0x2c, 0x85, 0x2c, 0x24, 0x64,
0xc4, 0xc5, 0x56, 0x92, 0x5f, 0xe0, 0x94, 0x99, 0x22, 0xc1, 0xa2, 0xc0, 0xa8, 0xc1, 0x6d, 0x24,
0xa5, 0x87, 0xd5, 0x55, 0x7a, 0x4e, 0x99, 0x29, 0x41, 0x50, 0x95, 0x42, 0x52, 0x5c, 0x1c, 0x29,
0xa9, 0x89, 0x29, 0x39, 0x99, 0x79, 0xa9, 0x12, 0xac, 0x0a, 0x8c, 0x1a, 0x2c, 0x41, 0x70, 0xbe,
0x93, 0xc5, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1,
0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0xc9, 0x41, 0x4c, 0xd3,
0x05, 0x7b, 0xac, 0x42, 0x1f, 0xc9, 0x97, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0x8f,
0x1a, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x84, 0x5a, 0xc2, 0xfb, 0x31, 0x01, 0x00, 0x00,
0x25, 0xb5, 0x38, 0xb9, 0x28, 0xb3, 0x00, 0xa4, 0x51, 0x82, 0x19, 0x2c, 0x85, 0x2c, 0x24, 0xa4,
0xc7, 0xc5, 0x92, 0x94, 0x5a, 0x5c, 0x22, 0xc1, 0xa2, 0xc0, 0xa8, 0xc1, 0x6d, 0x24, 0xa5, 0x87,
0xd5, 0x4d, 0x7a, 0x4e, 0x99, 0x29, 0x41, 0x60, 0x75, 0x42, 0x52, 0x5c, 0x1c, 0x29, 0xa9, 0x89,
0x29, 0x39, 0x99, 0x79, 0xa9, 0x12, 0xac, 0x0a, 0x8c, 0x1a, 0x2c, 0x41, 0x70, 0xbe, 0x93, 0xc5,
0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c,
0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0xc9, 0x41, 0xcc, 0xd2, 0x05, 0x7b,
0xaa, 0x42, 0x1f, 0xc9, 0x87, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0x4f, 0x1a, 0x03,
0x02, 0x00, 0x00, 0xff, 0xff, 0xb5, 0xb0, 0xd9, 0xd2, 0x2d, 0x01, 0x00, 0x00,
}
func (m *Auction) Marshal() (dAtA []byte, err error) {
@@ -147,9 +147,9 @@ func (m *Auction) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i--
dAtA[i] = 0x28
}
if m.TopBid != nil {
if m.Best != nil {
{
size, err := m.TopBid.MarshalToSizedBuffer(dAtA[:i])
size, err := m.Best.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
@@ -212,8 +212,8 @@ func (m *Auction) Size() (n int) {
if l > 0 {
n += 1 + l + sovAuction(uint64(l))
}
if m.TopBid != nil {
l = m.TopBid.Size()
if m.Best != nil {
l = m.Best.Size()
n += 1 + l + sovAuction(uint64(l))
}
if m.Deadline != 0 {
@@ -355,7 +355,7 @@ func (m *Auction) Unmarshal(dAtA []byte) error {
iNdEx = postIndex
case 4:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field TopBid", wireType)
return fmt.Errorf("proto: wrong wireType = %d for field Best", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -382,10 +382,10 @@ func (m *Auction) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.TopBid == nil {
m.TopBid = &Bid{}
if m.Best == nil {
m.Best = &Bid{}
}
if err := m.TopBid.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
if err := m.Best.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex