6 "github.com/bytom/encoding/blockchain"
7 "github.com/bytom/protocol/bc"
10 // BlockCommitment store the TransactionsMerkleRoot && TransactionStatusHash
11 type BlockCommitment struct {
12 // TransactionsMerkleRoot is the root hash of the Merkle binary hash
13 // tree formed by the hashes of all transactions included in the
15 TransactionsMerkleRoot bc.Hash `json:"transaction_merkle_root"`
17 // TransactionStatusHash is the hash of transaction status bitmap
18 TransactionStatusHash bc.Hash `json:"transaction_status_hash"`
21 func (bc *BlockCommitment) readFrom(r *blockchain.Reader) error {
22 if _, err := bc.TransactionsMerkleRoot.ReadFrom(r); err != nil {
25 _, err := bc.TransactionStatusHash.ReadFrom(r)
29 func (bc *BlockCommitment) writeTo(w io.Writer) error {
30 _, err := bc.TransactionsMerkleRoot.WriteTo(w)
34 _, err = bc.TransactionStatusHash.WriteTo(w)