From 0defde75ee41f775cfc9786c7874dc4cdd874c7a Mon Sep 17 00:00:00 2001 From: IshaVenikar Date: Fri, 13 Sep 2024 13:03:09 +0530 Subject: [PATCH] Update authority auction in registry module --- x/registry/keeper/keeper.go | 16 ++++++++++------ x/registry/keeper/record_keeper.go | 4 ++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/x/registry/keeper/keeper.go b/x/registry/keeper/keeper.go index 89540541..e71c9f4d 100644 --- a/x/registry/keeper/keeper.go +++ b/x/registry/keeper/keeper.go @@ -224,13 +224,17 @@ func (k Keeper) PaginatedListRecords(ctx sdk.Context, pagination *query.PageRequ } } else { var err error - records, pageResp, err = query.CollectionPaginate(ctx, k.Records, pagination, func(key string, value registrytypes.Record) (registrytypes.Record, error) { - if err := k.populateRecordNames(ctx, &value); err != nil { - return registrytypes.Record{}, err - } + records, pageResp, err = query.CollectionPaginate( + ctx, + k.Records, + pagination, + func(key string, value registrytypes.Record) (registrytypes.Record, error) { + if err := k.populateRecordNames(ctx, &value); err != nil { + return registrytypes.Record{}, err + } - return value, nil - }) + return value, nil + }) if err != nil { return nil, nil, err } diff --git a/x/registry/keeper/record_keeper.go b/x/registry/keeper/record_keeper.go index db5d71c9..0179fe2c 100644 --- a/x/registry/keeper/record_keeper.go +++ b/x/registry/keeper/record_keeper.go @@ -94,9 +94,9 @@ func (rk RecordKeeper) OnAuctionWinnerSelected(ctx sdk.Context, auctionId string } if auctionObj.Status == auctiontypes.AuctionStatusCompleted { - if auctionObj.WinnerAddress != "" { + if len(auctionObj.WinnerAddresses) == 1 { // Mark authority owner and change status to active. - authority.OwnerAddress = auctionObj.WinnerAddress + authority.OwnerAddress = auctionObj.WinnerAddresses[0] authority.Status = registrytypes.AuthorityActive // Reset bond id if required, as owner has changed.