diff --git a/x/colinearcore/keeper/auction_state.go b/x/colinearcore/keeper/auction_state.go index 0e2c342..07a827f 100644 --- a/x/colinearcore/keeper/auction_state.go +++ b/x/colinearcore/keeper/auction_state.go @@ -41,14 +41,17 @@ func (k Keeper) FinalizeExpiredAuctions(ctx sdk.Context) { // Remaining Unpaid: Full bid amount auction.Remaining = auction.Best.Amount - // clear auction + // clear auction bids if err := memdb.AuctionDB.ClearAuctionBids(auctionId); err != nil { return errors.Errorf("failed to clear auction from memcache: %s", err) } - if err := memdb.AuctionDB.ClearVerifiedProviders(auctionId); err != nil { - return errors.Errorf("failed to clear verified providers for auction %s: %s", auctionId, err) - } + // clear verified provider list; swallow error since this isn't critical for now + _ = memdb.AuctionDB.ClearVerifiedProviders(auctionId) + + // if err := memdb.AuctionDB.ClearVerifiedProviders(auctionId); err != nil { + // return errors.Errorf("failed to clear verified providers for auction %s: %s", auctionId, err) + // } // pay out unpaid remainder to auction creator ceiling := new(big.Int) diff --git a/x/colinearcore/keeper/msg_server_new_auction.go b/x/colinearcore/keeper/msg_server_new_auction.go index 0b896d3..2311ede 100644 --- a/x/colinearcore/keeper/msg_server_new_auction.go +++ b/x/colinearcore/keeper/msg_server_new_auction.go @@ -8,6 +8,7 @@ import ( "strconv" "colinear/x/colinearcore/auctionconfig" + "colinear/x/colinearcore/memdb" "colinear/x/colinearcore/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -65,6 +66,12 @@ found: } } + if msg.VerifiedProviders != nil { + memdb.AuctionDB.SetVerifiedProviders(index, msg.VerifiedProviders) + } else { + memdb.AuctionDB.SetVerifiedProviders(index, []string{}) + } + auction := types.Auction{ Index: index, Name: msg.Name, diff --git a/x/colinearcore/memdb/biddb.go b/x/colinearcore/memdb/biddb.go index fe60507..fba8500 100644 --- a/x/colinearcore/memdb/biddb.go +++ b/x/colinearcore/memdb/biddb.go @@ -170,8 +170,9 @@ func (b *auctionDB) ForEachAuctionBidList(viewFunc func(string) error) error { item := iter.Item() key := string(item.Key()) // require that this be an auction bids key - if len(key) > 5 && key[len(key)-5:len(key)-1] == "_bids" { - err := viewFunc(key) + if len(key) > 5 && key[len(key)-5:] == "_bids" { + auctionId := key[:len(key)-5] + err := viewFunc(auctionId) if err != nil { return err }