From d15e3a43dd6b8b0c3285d64bdd2e45ba3e8c6fe3 Mon Sep 17 00:00:00 2001 From: Kevin Davis Date: Fri, 2 Oct 2020 12:50:56 -0400 Subject: [PATCH] [R4R] fix: don't panic on expired auctions in init genesis (#668) * fix: close expired auctions in init genesis * fix: initialize variable * remove expired auction invarient --- x/auction/keeper/invariants.go | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/x/auction/keeper/invariants.go b/x/auction/keeper/invariants.go index a3fe7dae..e45757b8 100644 --- a/x/auction/keeper/invariants.go +++ b/x/auction/keeper/invariants.go @@ -2,7 +2,6 @@ package keeper import ( "fmt" - "time" "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" @@ -61,15 +60,6 @@ func ValidAuctionInvariant(k Keeper) sdk.Invariant { panic("stored auction type does not fulfill GenesisAuction interface") } - currentTime := ctx.BlockTime() - if !currentTime.Equal(time.Time{}) { // this avoids a simulator bug where app.InitGenesis is called with blockTime=0 instead of the correct time - if a.GetEndTime().Before(currentTime) { - validationErr = fmt.Errorf("endTime before current block time (%s)", currentTime) - invalidAuction = a - return true - } - } - if err := a.Validate(); err != nil { validationErr = err invalidAuction = a