don't tally highest bid in auction struct
parent
fcc85ec520
commit
e33adb1dbf
|
@ -20152,9 +20152,6 @@ paths:
|
|||
type: string
|
||||
amount:
|
||||
type: string
|
||||
highestBid:
|
||||
type: integer
|
||||
format: int64
|
||||
pagination:
|
||||
type: object
|
||||
properties:
|
||||
|
@ -20287,9 +20284,6 @@ paths:
|
|||
type: string
|
||||
amount:
|
||||
type: string
|
||||
highestBid:
|
||||
type: integer
|
||||
format: int64
|
||||
default:
|
||||
description: An unexpected error response.
|
||||
schema:
|
||||
|
@ -47425,9 +47419,6 @@ definitions:
|
|||
type: string
|
||||
amount:
|
||||
type: string
|
||||
highestBid:
|
||||
type: integer
|
||||
format: int64
|
||||
cosmostest.cosmostest.Bid:
|
||||
type: object
|
||||
properties:
|
||||
|
@ -47472,9 +47463,6 @@ definitions:
|
|||
type: string
|
||||
amount:
|
||||
type: string
|
||||
highestBid:
|
||||
type: integer
|
||||
format: int64
|
||||
pagination:
|
||||
type: object
|
||||
properties:
|
||||
|
@ -47521,9 +47509,6 @@ definitions:
|
|||
type: string
|
||||
amount:
|
||||
type: string
|
||||
highestBid:
|
||||
type: integer
|
||||
format: int64
|
||||
cosmostest.cosmostest.QueryGetNextAuctionResponse:
|
||||
type: object
|
||||
properties:
|
||||
|
|
|
@ -10,6 +10,5 @@ message Auction {
|
|||
string name = 2;
|
||||
string description = 3;
|
||||
repeated Bid bids = 4;
|
||||
uint32 highestBid = 5; // INDEX of highest bid
|
||||
}
|
||||
|
||||
|
|
|
@ -14,9 +14,6 @@ export interface CosmostestAuction {
|
|||
name?: string;
|
||||
description?: string;
|
||||
bids?: CosmostestBid[];
|
||||
|
||||
/** @format int64 */
|
||||
highestBid?: number;
|
||||
}
|
||||
|
||||
export interface CosmostestBid {
|
||||
|
|
|
@ -9,16 +9,9 @@ export interface Auction {
|
|||
name: string;
|
||||
description: string;
|
||||
bids: Bid[];
|
||||
/** INDEX of highest bid */
|
||||
highestBid: number;
|
||||
}
|
||||
|
||||
const baseAuction: object = {
|
||||
index: "",
|
||||
name: "",
|
||||
description: "",
|
||||
highestBid: 0,
|
||||
};
|
||||
const baseAuction: object = { index: "", name: "", description: "" };
|
||||
|
||||
export const Auction = {
|
||||
encode(message: Auction, writer: Writer = Writer.create()): Writer {
|
||||
|
@ -34,9 +27,6 @@ export const Auction = {
|
|||
for (const v of message.bids) {
|
||||
Bid.encode(v!, writer.uint32(34).fork()).ldelim();
|
||||
}
|
||||
if (message.highestBid !== 0) {
|
||||
writer.uint32(40).uint32(message.highestBid);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
|
@ -60,9 +50,6 @@ export const Auction = {
|
|||
case 4:
|
||||
message.bids.push(Bid.decode(reader, reader.uint32()));
|
||||
break;
|
||||
case 5:
|
||||
message.highestBid = reader.uint32();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
|
@ -94,11 +81,6 @@ export const Auction = {
|
|||
message.bids.push(Bid.fromJSON(e));
|
||||
}
|
||||
}
|
||||
if (object.highestBid !== undefined && object.highestBid !== null) {
|
||||
message.highestBid = Number(object.highestBid);
|
||||
} else {
|
||||
message.highestBid = 0;
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
|
@ -113,7 +95,6 @@ export const Auction = {
|
|||
} else {
|
||||
obj.bids = [];
|
||||
}
|
||||
message.highestBid !== undefined && (obj.highestBid = message.highestBid);
|
||||
return obj;
|
||||
},
|
||||
|
||||
|
@ -140,11 +121,6 @@ export const Auction = {
|
|||
message.bids.push(Bid.fromPartial(e));
|
||||
}
|
||||
}
|
||||
if (object.highestBid !== undefined && object.highestBid !== null) {
|
||||
message.highestBid = object.highestBid;
|
||||
} else {
|
||||
message.highestBid = 0;
|
||||
}
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
|
|
@ -27,7 +27,6 @@ type Auction struct {
|
|||
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
|
||||
Bids []*Bid `protobuf:"bytes,4,rep,name=bids,proto3" json:"bids,omitempty"`
|
||||
HighestBid uint32 `protobuf:"varint,5,opt,name=highestBid,proto3" json:"highestBid,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Auction) Reset() { *m = Auction{} }
|
||||
|
@ -91,13 +90,6 @@ func (m *Auction) GetBids() []*Bid {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (m *Auction) GetHighestBid() uint32 {
|
||||
if m != nil {
|
||||
return m.HighestBid
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*Auction)(nil), "cosmostest.cosmostest.Auction")
|
||||
}
|
||||
|
@ -105,21 +97,20 @@ func init() {
|
|||
func init() { proto.RegisterFile("cosmostest/auction.proto", fileDescriptor_631f6f59914101d9) }
|
||||
|
||||
var fileDescriptor_631f6f59914101d9 = []byte{
|
||||
// 223 bytes of a gzipped FileDescriptorProto
|
||||
// 200 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,
|
||||
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, 0xa4,
|
||||
0xc7, 0xc5, 0x92, 0x94, 0x99, 0x52, 0x2c, 0xc1, 0xa2, 0xc0, 0xac, 0xc1, 0x6d, 0x24, 0xa5, 0x87,
|
||||
0xd5, 0x4d, 0x7a, 0x4e, 0x99, 0x29, 0x41, 0x60, 0x75, 0x42, 0x72, 0x5c, 0x5c, 0x19, 0x99, 0xe9,
|
||||
0x19, 0xa9, 0xc5, 0x25, 0x4e, 0x99, 0x29, 0x12, 0xac, 0x0a, 0x8c, 0x1a, 0xbc, 0x41, 0x48, 0x22,
|
||||
0x4e, 0x16, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84,
|
||||
0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0x25, 0x07, 0x31, 0x4f,
|
||||
0x17, 0xec, 0xb1, 0x0a, 0x7d, 0x24, 0x5f, 0x96, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x3d,
|
||||
0x6a, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x60, 0x55, 0x70, 0xca, 0x31, 0x01, 0x00, 0x00,
|
||||
0x32, 0x53, 0x20, 0x8a, 0x95, 0x5a, 0x19, 0xb9, 0xd8, 0x1d, 0x21, 0xda, 0x85, 0x44, 0xb8, 0x58,
|
||||
0x33, 0xf3, 0x52, 0x52, 0x2b, 0x24, 0x18, 0x15, 0x18, 0x35, 0x38, 0x83, 0x20, 0x1c, 0x21, 0x21,
|
||||
0x2e, 0x96, 0xbc, 0xc4, 0xdc, 0x54, 0x09, 0x26, 0xb0, 0x20, 0x98, 0x2d, 0xa4, 0xc0, 0xc5, 0x9d,
|
||||
0x92, 0x5a, 0x9c, 0x5c, 0x94, 0x59, 0x00, 0xd2, 0x28, 0xc1, 0x0c, 0x96, 0x42, 0x16, 0x12, 0xd2,
|
||||
0xe3, 0x62, 0x49, 0xca, 0x4c, 0x29, 0x96, 0x60, 0x51, 0x60, 0xd6, 0xe0, 0x36, 0x92, 0xd2, 0xc3,
|
||||
0xea, 0x26, 0x3d, 0xa7, 0xcc, 0x94, 0x20, 0xb0, 0x3a, 0x27, 0x8b, 0x13, 0x8f, 0xe4, 0x18, 0x2f,
|
||||
0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18,
|
||||
0x6e, 0x3c, 0x96, 0x63, 0x88, 0x92, 0x83, 0xa8, 0xd7, 0x05, 0x3b, 0xbc, 0x42, 0x1f, 0xc9, 0x17,
|
||||
0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0x8f, 0x18, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff,
|
||||
0x94, 0x35, 0x9e, 0x85, 0x11, 0x01, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (m *Auction) Marshal() (dAtA []byte, err error) {
|
||||
|
@ -142,11 +133,6 @@ func (m *Auction) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if m.HighestBid != 0 {
|
||||
i = encodeVarintAuction(dAtA, i, uint64(m.HighestBid))
|
||||
i--
|
||||
dAtA[i] = 0x28
|
||||
}
|
||||
if len(m.Bids) > 0 {
|
||||
for iNdEx := len(m.Bids) - 1; iNdEx >= 0; iNdEx-- {
|
||||
{
|
||||
|
@ -220,9 +206,6 @@ func (m *Auction) Size() (n int) {
|
|||
n += 1 + l + sovAuction(uint64(l))
|
||||
}
|
||||
}
|
||||
if m.HighestBid != 0 {
|
||||
n += 1 + sovAuction(uint64(m.HighestBid))
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
|
@ -391,25 +374,6 @@ func (m *Auction) Unmarshal(dAtA []byte) error {
|
|||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
case 5:
|
||||
if wireType != 0 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field HighestBid", wireType)
|
||||
}
|
||||
m.HighestBid = 0
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowAuction
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
m.HighestBid |= uint32(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipAuction(dAtA[iNdEx:])
|
||||
|
|
Loading…
Reference in New Issue