don't tally highest bid in auction struct

This commit is contained in:
2022-08-28 02:37:27 +00:00
parent fcc85ec520
commit e33adb1dbf
5 changed files with 12 additions and 91 deletions

View File

@@ -14,9 +14,6 @@ export interface CosmostestAuction {
name?: string;
description?: string;
bids?: CosmostestBid[];
/** @format int64 */
highestBid?: number;
}
export interface CosmostestBid {

View File

@@ -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;
},
};