2018-02-21 04:57:52 +00:00
|
|
|
package sharding
|
|
|
|
|
|
|
|
import (
|
|
|
|
"math/big"
|
|
|
|
|
|
|
|
"github.com/ethereum/go-ethereum/common"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Collation struct {
|
2018-05-03 15:22:28 +00:00
|
|
|
header *CollationHeader
|
|
|
|
body []byte
|
2018-02-21 04:57:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type CollationHeader struct {
|
2018-03-21 04:10:41 +00:00
|
|
|
shardID *big.Int //the shard ID of the shard
|
|
|
|
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
|
2018-04-12 16:38:52 +00:00
|
|
|
proposerSignature []byte //the proposer's signature for calculating collation hash
|
2018-02-21 04:57:52 +00:00
|
|
|
}
|
|
|
|
|
2018-05-03 15:22:28 +00:00
|
|
|
func (c *Collation) Header() *CollationHeader { return c.header }
|
|
|
|
func (c *Collation) ShardID() *big.Int { return c.header.shardID }
|
|
|
|
func (c *Collation) Period() *big.Int { return c.header.period }
|
|
|
|
func (c *Collation) ProposerAddress() *common.Address { return c.header.proposerAddress }
|
2018-02-22 03:39:51 +00:00
|
|
|
|
2018-02-23 14:54:36 +00:00
|
|
|
func (c *Collation) SetHeader(h *CollationHeader) { c.header = h }
|