mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-04 08:44:28 +00:00
sharding: rename methods, tests pass.
Former-commit-id: 55e22985980afb8538adcf13eae7242484c6466e [formerly 207348ebbfe33d343019fff3f47c5fbc7d7ea28a] Former-commit-id: c8543ee2327f9bb1863a90d9538ff302f3db09f2
This commit is contained in:
parent
eb9c82b581
commit
256892e6b7
@ -38,7 +38,7 @@ func NewCollationHeader(shardID *big.Int, chunkRoot *common.Hash, period *big.In
|
||||
ProposerAddress: proposerAddress,
|
||||
ProposerSignature: proposerSignature,
|
||||
}
|
||||
return &CollationHeader{data: data}
|
||||
return &CollationHeader{data}
|
||||
}
|
||||
|
||||
// Hash takes the keccak256 of the collation header's contents.
|
||||
@ -93,8 +93,9 @@ func (c *Collation) AddTransaction(tx *types.Transaction) {
|
||||
c.transactions = append(c.transactions, tx)
|
||||
}
|
||||
|
||||
// SetChunkRoot updates the collation header's chunk root.
|
||||
func (c *Collation) SetChunkRoot() {
|
||||
// CalculateChunkRoot updates the collation header's chunk root based on the body.
|
||||
func (c *Collation) CalculateChunkRoot() {
|
||||
// TODO: this needs to be based on blob serialization.
|
||||
chunkRoot := common.BytesToHash(c.body)
|
||||
c.header.data.ChunkRoot = &chunkRoot
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ func TestShard_CollationByHash(t *testing.T) {
|
||||
}
|
||||
|
||||
// We set the chunk root.
|
||||
collation.SetChunkRoot()
|
||||
collation.CalculateChunkRoot()
|
||||
|
||||
shardDB := makeShardKV()
|
||||
shard := MakeShard(big.NewInt(1), shardDB)
|
||||
|
Loading…
Reference in New Issue
Block a user