Skip to content

Commit

Permalink
fix: proper category
Browse files Browse the repository at this point in the history
  • Loading branch information
froid1911 committed Apr 26, 2023
1 parent 7ce4ff9 commit 46746da
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type Auction @entity {
claimed: Boolean!

#Auction Settings
hammerTimeDuration: BigInt!
hammerTimeDuration: BigInt
bidDecimals: BigInt!
stepMin: BigInt!
incMin: BigInt!
Expand Down
8 changes: 6 additions & 2 deletions src/mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ export function handleAuction_Initialized(

// @todo: seller, createdAt, startsAt, endsAt, claimAt,
// contractId quantity, presetId, cancelled, ercType, bids objects
if (!result.reverted && !resultHammerTime.reverted) {
if (!result.reverted) {
let auctionInfo = result.value;

auction.category = auctionInfo.info.category;
Expand All @@ -330,7 +330,7 @@ export function handleAuction_Initialized(
let presets = auctionInfo.presets;
auction.bidDecimals = presets.bidDecimals;
auction.bidMultiplier = presets.bidMultiplier;
auction.hammerTimeDuration = resultHammerTime.value;

auction.incMax = presets.incMax;
auction.incMin = presets.incMin;
auction.stepMin = presets.stepMin;
Expand All @@ -351,6 +351,10 @@ export function handleAuction_Initialized(
auction = updateProceeds(auction);
}

if (!resultHammerTime.reverted) {
auction.hammerTimeDuration = resultHammerTime.value;
}

auction.save();

let contractEntity = ContractEntity.load(
Expand Down

0 comments on commit 46746da

Please sign in to comment.