Former-commit-id: 0dfd8ae44d6bf896b9d0c43f7cd656c47291fb77 [formerly 37a4fe6edcc9447d8233c05cb06888bc33e8ac20]
Former-commit-id: 1fdb96e7d1dab081c685f705120f270285c4cc84
This commit is contained in:
Terence Tsao
2018-03-20 21:10:41 -07:00
parent d625475a96
commit 009a96f8c2

View File

@@ -9,30 +9,29 @@ import (
)
type Collation struct {
header *CollationHeader
header *CollationHeader
//TODO: Tx to blob
transactions []*types.Transaction
}
type CollationHeader struct {
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
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) 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 }