From 9682865d77cc5d63e7014155f24cca539d92846f Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Sat, 20 Jul 2024 12:11:00 +0530 Subject: [PATCH] Remove authority expiry queue entry if there is no auction winner --- x/registry/keeper/record_keeper.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/x/registry/keeper/record_keeper.go b/x/registry/keeper/record_keeper.go index e6fb2638..c80a7e34 100644 --- a/x/registry/keeper/record_keeper.go +++ b/x/registry/keeper/record_keeper.go @@ -111,6 +111,14 @@ func (rk RecordKeeper) OnAuctionWinnerSelected(ctx sdk.Context, auctionId string // Mark as expired. authority.Status = registrytypes.AuthorityExpired logger(ctx).Info(fmt.Sprintf("No winner, marking authority as expired: %s", name)) + + logger(ctx).Info(fmt.Sprintf("Deleting the expiry queue entry: %s", name)) + if err = rk.k.deleteAuthorityExpiryQueue(ctx, name, authority); err != nil { + panic(err) + } + + // TODO: Set expiry time in authority as the auction's reveals end time + // authority.ExpiryTime = auctionObj.RevealsEndTime } // Forget about this auction now, we no longer need it.