mirror of
https://github.com/colinear-labs/chain.git
synced 2026-03-05 15:44:24 -08:00
don't tally highest bid in auction struct
This commit is contained in:
@@ -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;
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user