cosmos-sdk/x/staking/testutil/validator.go
Julien Robert 80ce491734
refactor: move x/{moduleName}/test{ModuleName} to x/{moduleName}/testutil (#13427)
* refactor: move `x/{moduleName}/test{ModuleName}` to `x/{moduleName}/testutil`

* updates

* updates
2022-10-02 10:42:52 -04:00

19 lines
510 B
Go

package testutil
import (
"testing"
"github.com/stretchr/testify/require"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/staking/types"
)
// NewValidator is a testing helper method to create validators in tests
func NewValidator(t testing.TB, operator sdk.ValAddress, pubKey cryptotypes.PubKey) types.Validator {
v, err := types.NewValidator(operator, pubKey, types.Description{})
require.NoError(t, err)
return v
}