tendermint/types/block_meta.go

16 lines
497 B
Go
Raw Normal View History

package types
2017-09-22 09:00:37 -07:00
// BlockMeta contains meta information about a block - namely, it's ID and Header.
type BlockMeta struct {
2017-02-14 12:33:14 -08:00
BlockID BlockID `json:"block_id"` // the block hash and partsethash
Header Header `json:"header"` // The block's Header
}
2017-09-22 09:00:37 -07:00
// NewBlockMeta returns a new BlockMeta from the block and its blockParts.
func NewBlockMeta(block *Block, blockParts *PartSet) *BlockMeta {
return &BlockMeta{
2017-02-14 12:33:14 -08:00
BlockID: BlockID{block.Hash(), blockParts.Header()},
Header: block.Header,
}
}