change use of errors.Wrap to fmt.Errorf with %w verb

Closes #4603

Commands used (VIM):

```
:args `rg -l errors.Wrap`
:argdo normal @q | update
```

where q is a macros rewriting the `errors.Wrap` to `fmt.Errorf`.
This commit is contained in:
Anton Kaliaev
2020-05-12 07:35:47 +04:00
committed by GitHub
parent 8d63d7192f
commit b7b721c484
90 changed files with 321 additions and 391 deletions

View File

@@ -1,12 +1,12 @@
package v0
import (
"fmt"
"os"
"sort"
"testing"
"time"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
dbm "github.com/tendermint/tm-db"
@@ -64,7 +64,7 @@ func newBlockchainReactor(
proxyApp := proxy.NewAppConns(cc)
err := proxyApp.Start()
if err != nil {
panic(errors.Wrap(err, "error start app"))
panic(fmt.Errorf("error start app: %w", err))
}
blockDB := dbm.NewMemDB()
@@ -73,7 +73,7 @@ func newBlockchainReactor(
state, err := sm.LoadStateFromDBOrGenesisDoc(stateDB, genDoc)
if err != nil {
panic(errors.Wrap(err, "error constructing state from genesis file"))
panic(fmt.Errorf("error constructing state from genesis file: %w", err))
}
// Make the BlockchainReactor itself.
@@ -114,7 +114,7 @@ func newBlockchainReactor(
state, _, err = blockExec.ApplyBlock(state, blockID, thisBlock)
if err != nil {
panic(errors.Wrap(err, "error apply block"))
panic(fmt.Errorf("error apply block: %w", err))
}
blockStore.SaveBlock(thisBlock, thisParts, lastCommit)