github.com/Finschia/finschia-sdk@v0.48.1/x/staking/teststaking/validator.go (about) 1 package teststaking 2 3 import ( 4 "testing" 5 6 "github.com/stretchr/testify/require" 7 8 cryptotypes "github.com/Finschia/finschia-sdk/crypto/types" 9 sdk "github.com/Finschia/finschia-sdk/types" 10 "github.com/Finschia/finschia-sdk/x/staking/types" 11 ) 12 13 // NewValidator is a testing helper method to create validators in tests 14 func NewValidator(t testing.TB, operator sdk.ValAddress, pubKey cryptotypes.PubKey) types.Validator { 15 v, err := types.NewValidator(operator, pubKey, types.Description{}) 16 require.NoError(t, err) 17 return v 18 }