chore(all): replace all fmt.Errorf without paramters with errors.New (#21068)

This commit is contained in:
yukionfire
2024-07-25 14:54:49 +02:00
committed by GitHub
parent 6a2d039e12
commit d6ad92db0f
57 changed files with 127 additions and 103 deletions
+2 -2
View File
@@ -3,7 +3,7 @@ package sims
import (
"bytes"
"encoding/hex"
"fmt"
"errors"
"strconv"
errorsmod "cosmossdk.io/errors"
@@ -108,7 +108,7 @@ func TestAddr(addr, bech string) (sdk.AccAddress, error) {
}
bechexpected := res.String()
if bech != bechexpected {
return nil, fmt.Errorf("bech encoding doesn't match reference")
return nil, errors.New("bech encoding doesn't match reference")
}
bechres, err := sdk.AccAddressFromBech32(bech)
+2 -1
View File
@@ -2,6 +2,7 @@ package sims
import (
"encoding/json"
"errors"
"fmt"
"time"
@@ -164,7 +165,7 @@ func SetupWithConfiguration(appConfig depinject.Config, startupConfig StartupCon
// create validator set
valSet, err := startupConfig.ValidatorSet()
if err != nil {
return nil, fmt.Errorf("failed to create validator set")
return nil, errors.New("failed to create validator set")
}
var (
+2 -2
View File
@@ -3,7 +3,7 @@ package sims
import (
"bufio"
"encoding/json"
"fmt"
"errors"
"io"
"math/rand"
"os"
@@ -289,7 +289,7 @@ func AppStateFromGenesisFileFn(r io.Reader, cdc codec.JSONCodec, genesisFile str
a, ok := acc.GetCachedValue().(sdk.AccountI)
if !ok {
return *genesis, nil, fmt.Errorf("expected account")
return *genesis, nil, errors.New("expected account")
}
// create simulator accounts