Skip to content

Commit

Permalink
Handle Dutch auction withdrawals in the block processor
Browse files Browse the repository at this point in the history
  • Loading branch information
jessepinho committed May 7, 2024
1 parent 15c0d15 commit 9a4e5f1
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions packages/query/src/block-processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -442,11 +442,19 @@ export class BlockProcessor implements BlockProcessorInterface {
this.indexedDb.saveAssetsMetadata(metadata),
this.indexedDb.upsertAuction(action.value.auctionId, { seqNum }),
]);
} else if (action.case === 'actionDutchAuctionWithdraw') {
const auctionId = action.value.auctionId;
if (!auctionId) return;

const metadata = getAuctionNftMetadata(auctionId, action.value.seq);

await Promise.all([
this.indexedDb.saveAssetsMetadata(metadata),
this.indexedDb.upsertAuction(auctionId, {
seqNum: action.value.seq,
}),
]);
}
/**
* @todo Handle `actionDutchAuctionWithdraw`, and figure out how to
* determine the sequence number if there have been multiple withdrawals.
*/
}

/**
Expand Down

0 comments on commit 9a4e5f1

Please sign in to comment.