Merge PR #5938: x/genutil: fix InitializeNodeValidatorFiles

This commit is contained in:
Federico Kunze 2020-04-06 12:33:15 -04:00 committed by GitHub
parent 5098548b8c
commit 7d6033ea58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -98,6 +98,7 @@ when method receivers are offline/multisig keys.
types (eg. keys) to the `auth` module internal amino codec.
* (rest) [\#5906](https://github.com/cosmos/cosmos-sdk/pull/5906) Fix an issue that make some REST calls panic when sending
invalid or incomplete requests.
* (x/genutil) [\#5938](https://github.com/cosmos/cosmos-sdk/pull/5938) Fix `InitializeNodeValidatorFiles` error handling.
### State Machine Breaking

View File

@ -52,7 +52,7 @@ func InitializeNodeValidatorFiles(config *cfg.Config,
nodeKey, err := p2p.LoadOrGenNodeKey(config.NodeKeyFile())
if err != nil {
return nodeID, valPubKey, err
return "", nil, err
}
nodeID = string(nodeKey.ID())
@ -60,12 +60,12 @@ func InitializeNodeValidatorFiles(config *cfg.Config,
pvKeyFile := config.PrivValidatorKeyFile()
if err := tmos.EnsureDir(filepath.Dir(pvKeyFile), 0777); err != nil {
return nodeID, valPubKey, nil
return "", nil, err
}
pvStateFile := config.PrivValidatorStateFile()
if err := tmos.EnsureDir(filepath.Dir(pvStateFile), 0777); err != nil {
return nodeID, valPubKey, nil
return "", nil, err
}
valPubKey = privval.LoadOrGenFilePV(pvKeyFile, pvStateFile).GetPubKey()