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
+3 -3
View File
@@ -2,7 +2,7 @@ package runtime
import (
"context"
"fmt"
"errors"
"testing"
"github.com/stretchr/testify/require"
@@ -52,7 +52,7 @@ func TestBranchService(t *testing.T) {
ctx := testutil.DefaultContext(sk, tsk)
err := bs.Execute(ctx, func(ctx context.Context) error {
doStateChange(ctx)
return fmt.Errorf("failure")
return errors.New("failure")
})
require.Error(t, err)
assertRollback(ctx, true)
@@ -76,7 +76,7 @@ func TestBranchService(t *testing.T) {
ctx := testutil.DefaultContext(sk, tsk)
gasUsed, err := bs.ExecuteWithGasLimit(ctx, 4_000, func(ctx context.Context) error {
doStateChange(ctx)
return fmt.Errorf("failure")
return errors.New("failure")
})
require.Error(t, err)
// assert gas used
+1 -1
View File
@@ -410,7 +410,7 @@ func (m *MM[T]) RunMigrations(ctx context.Context, fromVM appmodulev2.VersionMap
// The module manager assumes only one module will update the validator set, and it can't be a new module.
if len(moduleValUpdates) > 0 {
return nil, fmt.Errorf("validator InitGenesis update is already set by another module")
return nil, errors.New("validator InitGenesis update is already set by another module")
}
}
}