chore(all): replace all fmt.Errorf without paramters with errors.New (#21068)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user