Skip to content

Commit

Permalink
fix: init issue
Browse files Browse the repository at this point in the history
  • Loading branch information
orionstardust committed Mar 21, 2024
1 parent 1c8b085 commit ec12631
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,14 @@ export function getOrCreateAuction(
auction = new Auction(id);
let contract = Contract.bind(event.address);
let result = contract.try_getAuctionInfo(auctionId);
if (result.reverted) {
return auction;
if (!result.reverted) {
let value = result.value;
auction.bidDecimals = value.presets.bidDecimals;
auction.bidMultiplier = value.presets.bidMultiplier;
auction.claimed = value.claimed;
}

let value = result.value;
auction.bidDecimals = value.presets.bidDecimals;
auction.bidMultiplier = value.presets.bidMultiplier;
// auction.bids = [];
auction.cancelled = false;
auction.claimed = value.claimed;
auction.claimAt = BIGINT_ZERO;
auction.contractAddress = event.address;
auction.totalBidsVolume = BIGINT_ZERO;
Expand Down
2 changes: 2 additions & 0 deletions src/mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,8 @@ export function handleAuction_Initialized(
auction.startsAt = auctionInfo.info.startTime;
auction.endsAt = auctionInfo.info.endTime;
auction.endsAtOriginal = auctionInfo.info.endTime;
auction.buyNowPrice = auctionInfo.info.buyItNowPrice;
auction.startBidPrice = auctionInfo.info.startingBid;

// auction.claimAt =
auction.highestBidder = auctionInfo.highestBidder;
Expand Down

0 comments on commit ec12631

Please sign in to comment.