From 9696ea6fb7f769a4f6e7340804b5d786dcb5cc90 Mon Sep 17 00:00:00 2001 From: Dirk McCormick Date: Thu, 4 Feb 2021 11:58:08 +0100 Subject: [PATCH] fix: replace panic with err in OnDealExpiredOrSlashed --- markets/storageadapter/ondealexpired.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/markets/storageadapter/ondealexpired.go b/markets/storageadapter/ondealexpired.go index 2d13c04b53b..e57b396343c 100644 --- a/markets/storageadapter/ondealexpired.go +++ b/markets/storageadapter/ondealexpired.go @@ -114,7 +114,7 @@ func (mgr *DealExpiryManager) OnDealExpiredOrSlashed(ctx context.Context, publis changedDeals, ok := states.(state.ChangedDeals) if !ok { - panic("Expected state.ChangedDeals") + return false, xerrors.Errorf("OnDealExpireOrSlashed stateChanged: Expected state.ChangedDeals") } deal, ok := changedDeals[res.DealID]