2016-03-15 11:36:05 -07:00
|
|
|
package testutil
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/tendermint/go-crypto"
|
2017-01-12 12:47:55 -08:00
|
|
|
"github.com/tendermint/abci/types"
|
2016-03-15 11:36:05 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
//----------------------------------------
|
|
|
|
|
|
|
|
// UTILITY
|
|
|
|
func Validator(secret string, power uint64) *types.Validator {
|
|
|
|
privKey := crypto.GenPrivKeyEd25519FromSecret([]byte(secret))
|
|
|
|
return &types.Validator{
|
|
|
|
PubKey: privKey.PubKey().Bytes(),
|
|
|
|
Power: power,
|
|
|
|
}
|
|
|
|
}
|