Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Make voter electing staisfy finality #124

Merged
merged 14 commits into from
Oct 13, 2020
Prev Previous commit
Next Next commit
fix: golang ci error
  • Loading branch information
Woosang Son committed Oct 6, 2020
commit 6f5e4f71933b4577fd1f93d43a10e5c2ad4499b5
7 changes: 4 additions & 3 deletions privval/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,12 @@ type FilePV struct {
// and sets the filePaths, but does not call Save().
func GenFilePV(keyFilePath, stateFilePath, privKeyType string) (filePV *FilePV, err error) {
var privKey crypto.PrivKey
if strings.EqualFold(privKeyType, PrevKeyTypeEd25519) {
switch strings.ToLower(privKeyType) {
case PrevKeyTypeEd25519:
privKey = ed25519.GenPrivKey()
} else if strings.EqualFold(privKeyType, PrevKeyTypeComposite) {
case PrevKeyTypeComposite:
privKey = composite.NewPrivKeyComposite(bls.GenPrivKey(), ed25519.GenPrivKey())
} else {
default:
return nil, fmt.Errorf("undefined private key type: %s", privKeyType)
}

Expand Down