mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-27 10:24:36 +00:00
val set changes
This commit is contained in:
+4
-4
@@ -154,10 +154,10 @@ type Header struct {
|
||||
Time time.Time `json:"time"`
|
||||
NumTxs int `json:"num_txs"`
|
||||
LastBlockID BlockID `json:"last_block_id"`
|
||||
LastCommitHash []byte `json:"last_commit_hash"`
|
||||
DataHash []byte `json:"data_hash"`
|
||||
ValidatorsHash []byte `json:"validators_hash"`
|
||||
AppHash []byte `json:"app_hash"` // state merkle root of txs from the previous block
|
||||
LastCommitHash []byte `json:"last_commit_hash"` // commit from validators from the last block
|
||||
ValidatorsHash []byte `json:"validators_hash"` // validators for the current block
|
||||
DataHash []byte `json:"data_hash"` // transactions
|
||||
AppHash []byte `json:"app_hash"` // state after txs from the previous block
|
||||
}
|
||||
|
||||
// NOTE: hash is nil if required fields are missing.
|
||||
|
||||
@@ -20,6 +20,15 @@ type Validator struct {
|
||||
Accum int64 `json:"accum"`
|
||||
}
|
||||
|
||||
func NewValidator(pubKey crypto.PubKey, votingPower int64) *Validator {
|
||||
return &Validator{
|
||||
Address: pubKey.Address(),
|
||||
PubKey: pubKey,
|
||||
VotingPower: votingPower,
|
||||
Accum: 0,
|
||||
}
|
||||
}
|
||||
|
||||
// Creates a new copy of the validator so we can mutate accum.
|
||||
// Panics if the validator is nil.
|
||||
func (v *Validator) Copy() *Validator {
|
||||
|
||||
Reference in New Issue
Block a user