privval

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 9, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SavePvKey

func SavePvKey(pvKey privval.FilePVKey, keyFilePath string)

func SavePvState

func SavePvState(pvKey privval.FilePVLastSignState, stateFilePath string)

Types

type OldFilePV

type OldFilePV struct {
	Address       types.Address    `json:"address"`
	PubKey        crypto.PubKey    `json:"pub_key"`
	LastHeight    int64            `json:"last_height"`
	LastRound     int              `json:"last_round"`
	LastStep      int8             `json:"last_step"`
	LastSignature []byte           `json:"last_signature,omitempty"`
	LastSignBytes tmbytes.HexBytes `json:"last_signbytes,omitempty"`
	PrivKey       crypto.PrivKey   `json:"priv_key"`
	// contains filtered or unexported fields
}

OldFilePV is the old version of the FilePV, pre v0.28.0.

func LoadOldFilePV

func LoadOldFilePV(filePath string) (*OldFilePV, error)

LoadOldFilePV loads an OldFilePV from the filePath.

func (*OldFilePV) Upgrade

func (oldFilePV *OldFilePV) Upgrade(keyFilePath, stateFilePath string) *privval.FilePV

Upgrade convets the OldFilePV to the new FilePV, separating the immutable and mutable components, and persisting them to the keyFilePath and stateFilePath, respectively. It renames the original file by adding ".bak".

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL