Skip to content

Commit

Permalink
time check added
Browse files Browse the repository at this point in the history
  • Loading branch information
Chandragupta Singh authored and Chandragupta Singh committed Jun 15, 2022
1 parent 1d78763 commit 5b9b880
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions x/auction/keeper/debt.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,9 @@ func (k Keeper) PlaceDebtAuctionBid(ctx sdk.Context, appId, auctionMappingId, au
auction.CurrentBidAmount = bid
auction.ExpectedMintedToken = bid
auction.BidEndTime = ctx.BlockTime().Add(time.Second * time.Duration(auctionParam.BidDurationSeconds))
if auction.BidEndTime.After((auction.EndTime)){
auction.BidEndTime = auction.EndTime
}
err = k.SetDebtAuction(ctx, auction)
if err != nil {
return err
Expand Down
3 changes: 3 additions & 0 deletions x/auction/keeper/surplus.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,9 @@ func (k Keeper) PlaceSurplusAuctionBid(ctx sdk.Context, appId, auctionMappingId,
auction.Bidder = bidder
auction.Bid = bid
auction.BidEndTime = ctx.BlockTime().Add(time.Second * time.Duration(auctionParam.BidDurationSeconds))
if auction.BidEndTime.After((auction.EndTime)){
auction.BidEndTime = auction.EndTime
}
err = k.SetSurplusAuction(ctx, auction)
if err != nil {
return err
Expand Down

0 comments on commit 5b9b880

Please sign in to comment.