Merge remote-tracking branch 'origin/develop' into jae/literefactor4

This commit is contained in:
Ethan Buchman
2018-08-02 19:12:22 -04:00
111 changed files with 5359 additions and 3140 deletions

View File

@ -25,7 +25,7 @@ type Block struct {
// MakeBlock returns a new block with an empty header, except what can be computed from itself.
// It populates the same set of fields validated by ValidateBasic
func MakeBlock(height int64, txs []Tx, commit *Commit) *Block {
func MakeBlock(height int64, txs []Tx, commit *Commit, evidence []Evidence) *Block {
block := &Block{
Header: Header{
Height: height,
@ -35,20 +35,13 @@ func MakeBlock(height int64, txs []Tx, commit *Commit) *Block {
Data: Data{
Txs: txs,
},
Evidence: EvidenceData{Evidence: evidence},
LastCommit: commit,
}
block.fillHeader()
return block
}
// AddEvidence appends the given evidence to the block
func (b *Block) AddEvidence(evidence []Evidence) {
if b == nil {
return
}
b.Evidence.Evidence = append(b.Evidence.Evidence, evidence...)
}
// ValidateBasic performs basic validation that doesn't involve state data.
// It checks the internal consistency of the block.
func (b *Block) ValidateBasic() error {