mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-07 13:55:17 +00:00
Calculate validator hash from genesis doc
This commit is contained in:
@@ -39,6 +39,15 @@ func (genDoc *GenesisDoc) SaveAs(file string) error {
|
||||
return cmn.WriteFile(file, genDocBytes, 0644)
|
||||
}
|
||||
|
||||
func (genDoc *GenesisDoc) ValidatorHash() []byte {
|
||||
vals := make([]*Validator, len(genDoc.Validators))
|
||||
for i, v := range genDoc.Validators {
|
||||
vals[i] = NewValidator(v.PubKey, v.Amount)
|
||||
}
|
||||
vset := NewValidatorSet(vals)
|
||||
return vset.Hash()
|
||||
}
|
||||
|
||||
//------------------------------------------------------------
|
||||
// Make genesis state from file
|
||||
|
||||
|
||||
Reference in New Issue
Block a user