PrivValidator interface

This commit is contained in:
Ethan Buchman
2017-09-21 15:51:20 -04:00
parent abe912c610
commit fd1b0b997a
12 changed files with 178 additions and 160 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ func initFiles(cmd *cobra.Command, args []string) {
ChainID: cmn.Fmt("test-chain-%v", cmn.RandStr(6)),
}
genDoc.Validators = []types.GenesisValidator{types.GenesisValidator{
PubKey: privValidator.PubKey,
PubKey: privValidator.PubKey(),
Power: 10,
}}
@@ -46,7 +46,7 @@ func resetPrivValidator(cmd *cobra.Command, args []string) {
func resetPrivValidatorLocal(privValFile string, logger log.Logger) {
// Get PrivValidator
var privValidator *types.PrivValidator
var privValidator types.PrivValidator
if _, err := os.Stat(privValFile); err == nil {
privValidator = types.LoadPrivValidator(privValFile)
privValidator.Reset()
+2 -2
View File
@@ -41,9 +41,9 @@ func AddNodeFlags(cmd *cobra.Command) {
// FuncSignerAndApp takes a config and returns a PrivValidator and ClientCreator.
// It allows other projects to make Tendermint binaries with custom signers and applications.
type FuncSignerAndApp func(*cfg.Config) (*types.PrivValidator, proxy.ClientCreator)
type FuncSignerAndApp func(*cfg.Config) (types.PrivValidator, proxy.ClientCreator)
func DefaultSignerAndApp(config *cfg.Config) (*types.PrivValidator, proxy.ClientCreator) {
func DefaultSignerAndApp(config *cfg.Config) (types.PrivValidator, proxy.ClientCreator) {
privValidator := types.LoadOrGenPrivValidator(config.PrivValidatorFile())
clientCreator := proxy.DefaultClientCreator(config.ProxyApp, config.ABCI, config.DBDir())
return privValidator, clientCreator
+1 -1
View File
@@ -47,7 +47,7 @@ func testnetFiles(cmd *cobra.Command, args []string) {
privValFile := path.Join(dataDir, mach, "priv_validator.json")
privVal := types.LoadPrivValidator(privValFile)
genVals[i] = types.GenesisValidator{
PubKey: privVal.PubKey,
PubKey: privVal.PubKey(),
Power: 1,
Name: mach,
}