6 "github.com/bytom/encoding/blockchain"
7 "github.com/bytom/protocol/bc"
10 type BlockCommitment struct {
11 // TransactionsMerkleRoot is the root hash of the Merkle binary hash
12 // tree formed by the hashes of all transactions included in the
14 TransactionsMerkleRoot bc.Hash
16 // AssetsMerkleRoot is the root hash of the Merkle Patricia Tree of
17 // the set of unspent outputs with asset version 1 after applying
19 AssetsMerkleRoot bc.Hash
22 func (bc *BlockCommitment) readFrom(r *blockchain.Reader) error {
23 _, err := bc.TransactionsMerkleRoot.ReadFrom(r)
27 _, err = bc.AssetsMerkleRoot.ReadFrom(r)
34 func (bc *BlockCommitment) writeTo(w io.Writer) error {
35 _, err := bc.TransactionsMerkleRoot.WriteTo(w)
39 _, err = bc.AssetsMerkleRoot.WriteTo(w)