You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
366 B

8 years ago
  1. package testutil
  2. import (
  3. "github.com/tendermint/go-crypto"
  4. "github.com/tendermint/abci/types"
  5. )
  6. //----------------------------------------
  7. // UTILITY
  8. func Validator(secret string, power uint64) *types.Validator {
  9. privKey := crypto.GenPrivKeyEd25519FromSecret([]byte(secret))
  10. return &types.Validator{
  11. PubKey: privKey.PubKey().Bytes(),
  12. Power: power,
  13. }
  14. }