collationHeader updated to align w/ phase 1 spec

Former-commit-id: b340430ddb847c52c6e50358a6332354200ccfde [formerly e51bfd83e6ddb4d2a099f5afe6dc8f54eaa40217]
Former-commit-id: db119d9e55981418c8b170d8207fe4f4c6c0c4fe
This commit is contained in:
Terence Tsao 2018-03-20 10:36:30 -07:00
parent 415c7d8b35
commit 84b53b0942

View File

@ -14,19 +14,24 @@ type Collation struct {
}
type CollationHeader struct {
shardID *big.Int
expectedPeriodNumber *big.Int
periodStartPrevHash *common.Hash
parentCollationHash *common.Hash
txListRoot *common.Hash
coinbase *common.Address
postStateRoot *common.Hash
receiptsRoot *common.Hash
sig []byte
shardID *big.Int //the shard ID of the shard
parentHash *common.Hash //the hash of the parent collation
chunkRoot *common.Hash //the root of the chunk tree which identifies collation body
period *big.Int //the period number in which collation to be included
proposerAddress *common.Address //address of the collation proposer
proposerBid *big.Int //the reward from proposer to collator for a winning proposal
proposerSignature []byte //the proposer's signature as part of a proposal
}
func (c *Collation) Header() *CollationHeader { return c.header }
func (c *Collation) Transactions() []*types.Transaction { return c.transactions }
func (c *Collation) ShardID() *big.Int { return c.header.shardID }
func (c *Collation) ParentHash() *common.Hash { return c.header.parentHash }
func (c *Collation) Period() *big.Int { return c.header.period }
func (c *Collation) ProposerAddress() *common.Address { return c.header.proposerAddress }
func (c *Collation) ProposerBid() *big.Int { return c.header.proposerBid }
func (c *Collation) ProposerSignature() []byte{ return c.header.proposerSignature }
func (c *Collation) SetHeader(h *CollationHeader) { c.header = h }
func (c *Collation) AddTransaction(tx *types.Transaction) {