Add ResultHash to header

This commit is contained in:
Ethan Frey
2017-12-22 16:43:45 +01:00
committed by Ethan Buchman
parent 632cc918b4
commit 58c5df729b
12 changed files with 44 additions and 21 deletions

View File

@ -153,6 +153,7 @@ type Header struct {
ValidatorsHash data.Bytes `json:"validators_hash"` // validators for the current block
ConsensusHash data.Bytes `json:"consensus_hash"` // consensus params for current block
AppHash data.Bytes `json:"app_hash"` // state after txs from the previous block
ResultsHash data.Bytes `json:"results_hash"` // root hash of all results from the txs from the previous block
}
// Hash returns the hash of the header.
@ -173,6 +174,7 @@ func (h *Header) Hash() data.Bytes {
"Validators": h.ValidatorsHash,
"App": h.AppHash,
"Consensus": h.ConsensusHash,
"Results": h.ResultsHash,
})
}
@ -192,7 +194,8 @@ func (h *Header) StringIndented(indent string) string {
%s Data: %v
%s Validators: %v
%s App: %v
%s Conensus: %v
%s Conensus: %v
%s Results: %v
%s}#%v`,
indent, h.ChainID,
indent, h.Height,
@ -205,6 +208,7 @@ func (h *Header) StringIndented(indent string) string {
indent, h.ValidatorsHash,
indent, h.AppHash,
indent, h.ConsensusHash,
indent, h.ResultsHash,
indent, h.Hash())
}