mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-20 15:04:22 +00:00
PrivValidator interface
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user