6 "github.com/vapor/encoding/blockchain"
7 "github.com/vapor/protocol/bc"
10 // BlockCommitment store the TransactionsMerkleRoot && TransactionStatusHash
11 type BlockCommitment struct {
12 // TransactionsMerkleRoot is the root hash of the Merkle binary hash tree
13 // formed by the hashes of all transactions included in the block.
14 TransactionsMerkleRoot bc.Hash `json:"transaction_merkle_root"`
16 // TransactionStatusHash is the root hash of the Merkle binary hash tree
17 // formed by the hashes of all transaction verify results
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 {
26 _, err := bc.TransactionStatusHash.ReadFrom(r)
30 func (bc *BlockCommitment) writeTo(w io.Writer) error {
31 if _, err := bc.TransactionsMerkleRoot.WriteTo(w); err != nil {
35 _, err := bc.TransactionStatusHash.WriteTo(w)