mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-04 08:44:28 +00:00
sharding: make shard func
Former-commit-id: bbb2c9cf92add01dd21480ddf76d14d93c5ca193 [formerly 8a52bd1e5370434ac174968a4767f47ae310a35f] Former-commit-id: 31256de9b910d8e4131b19ef69d7815df025f362
This commit is contained in:
parent
1793e7d21d
commit
b524c0eab5
@ -14,6 +14,17 @@ type Shard struct {
|
||||
shardID *big.Int
|
||||
}
|
||||
|
||||
// MakeShard creates an instance of a Shard struct given a shardID.
|
||||
func MakeShard(shardID *big.Int) *Shard {
|
||||
// Swappable.
|
||||
shardDB := &shardKV{kv: make(map[common.Hash][]byte)}
|
||||
|
||||
return &Shard{
|
||||
shardID: shardID,
|
||||
shardDB: shardDB,
|
||||
}
|
||||
}
|
||||
|
||||
// ValidateShardID checks if header belongs to shard.
|
||||
func (s *Shard) ValidateShardID(h *CollationHeader) error {
|
||||
if s.shardID.Cmp(h.shardID) != 0 {
|
||||
|
Loading…
Reference in New Issue
Block a user