Skip to content

Commit

Permalink
add promises
Browse files Browse the repository at this point in the history
  • Loading branch information
justraman committed Oct 13, 2023
1 parent a26a28d commit 07688e3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/mappings/marketplace/events/bid_placed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export async function bidPlaced(
}
}

Promise.all([ctx.store.save(bid), ctx.store.save(listing)])
await Promise.all([ctx.store.save(bid), ctx.store.save(listing)])

if (!skipSave) syncCollectionStats(listing.makeAssetId.collection.id)

Expand Down
2 changes: 1 addition & 1 deletion src/mappings/marketplace/events/listing_cancelled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export async function listingCancelled(
ctx.store.save(listing.makeAssetId)
}

Promise.all([ctx.store.insert(ListingStatus, listingStatus as any), ctx.store.save(listing)])
await Promise.all([ctx.store.insert(ListingStatus, listingStatus as any), ctx.store.save(listing)])

if (!skipSave) syncCollectionStats(listing.makeAssetId.collection.id)

Expand Down
2 changes: 1 addition & 1 deletion src/mappings/marketplace/events/listing_created.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export async function listingCreated(
}
makeAssetId.recentListing = listing

Promise.all([
await Promise.all([
ctx.store.insert(Listing, listing as any),
ctx.store.insert(ListingStatus, listingStatus as any),
ctx.store.save(makeAssetId),
Expand Down
4 changes: 2 additions & 2 deletions src/mappings/marketplace/events/listing_filled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export async function listingFilled(
height: block.height,
createdAt: new Date(block.timestamp),
})
ctx.store.insert(ListingStatus, listingStatus as any)
await ctx.store.insert(ListingStatus, listingStatus as any)
}

const sale = new ListingSale({
Expand All @@ -120,7 +120,7 @@ export async function listingFilled(
ctx.store.save(listing.makeAssetId)
}

Promise.all([ctx.store.save(listing), ctx.store.save(sale)])
await Promise.all([ctx.store.save(listing), ctx.store.save(sale)])

if (!skipSave) syncCollectionStats(listing.makeAssetId.collection.id)

Expand Down

0 comments on commit 07688e3

Please sign in to comment.