From 432706bd099dfbb5e308146de730378c893bf2d3 Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Fri, 15 Nov 2019 02:40:16 +0100 Subject: [PATCH] Don't use pkg/errors License: MIT Signed-off-by: Jakub Sztandera --- chain/messagepool.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/chain/messagepool.go b/chain/messagepool.go index 1160a5e57..53f6f282e 100644 --- a/chain/messagepool.go +++ b/chain/messagepool.go @@ -5,9 +5,10 @@ import ( "sync" "time" + "errors" + lru "github.com/hashicorp/golang-lru" pubsub "github.com/libp2p/go-libp2p-pubsub" - "github.com/pkg/errors" "go.uber.org/multierr" "golang.org/x/xerrors" @@ -356,7 +357,7 @@ func (mp *MessagePool) HeadChange(revert []*types.TipSet, apply []*types.TipSet) for _, b := range ts.Blocks() { bmsgs, smsgs, err := mp.sm.ChainStore().MessagesForBlock(b) if err != nil { - return errors.Wrapf(err, "failed to get messages for revert block %s(height %d)", b.Cid(), b.Height) + return xerrors.Errorf("failed to get messages for revert block %s(height %d): %w", b.Cid(), b.Height, err) } for _, msg := range smsgs { if err := mp.Add(msg); err != nil { @@ -381,7 +382,7 @@ func (mp *MessagePool) HeadChange(revert []*types.TipSet, apply []*types.TipSet) for _, b := range ts.Blocks() { bmsgs, smsgs, err := mp.sm.ChainStore().MessagesForBlock(b) if err != nil { - return errors.Wrapf(err, "failed to get messages for apply block %s(height %d) (msgroot = %s)", b.Cid(), b.Height, b.Messages) + return xerrors.Errorf("failed to get messages for apply block %s(height %d) (msgroot = %s): %w", b.Cid(), b.Height, b.Messages, err) } for _, msg := range smsgs { mp.Remove(msg.Message.From, msg.Message.Nonce)