func NewShardChain(rootSlot uint64, genesisBlock *primitives.ShardBlock) *ShardChain {
	genesisHash, err := ssz.HashTreeRoot(genesisBlock)
	if err != nil {
		panic(err)
	}

	return &ShardChain{
		lock:     new(sync.Mutex),
		RootSlot: rootSlot,
		chain: []*index.ShardBlockNode{
			{
				Parent:    nil,
				BlockHash: genesisHash,
				StateRoot: genesisBlock.Header.StateRoot,
				Slot:      0,
				Height:    0,
			},
		},
	}
}
// NewShardChain creates a new shard chain.
NewShardChain creates a new shard chain.
// NewShardChain creates a new shard chain .
func NewShardChain(rootSlot uint64, genesisBlock *primitives.ShardBlock) *ShardChain {
	genesisHash, err := ssz.HashTreeRoot(genesisBlock)
	if err != nil {
		panic(err)
	}
	return &ShardChain{
		lock:     new(sync.Mutex),
		RootSlot: rootSlot,
		chain: []*index.ShardBlockNode{
			{
				Parent:    nil,
				BlockHash: genesisHash,
				StateRoot: genesisBlock.Header.StateRoot,
				Slot:      0,
				Height:    0,
			},
		},
	}
}
func NewShardChain ( rootSlot uint64 , genesisBlock * primitives . ShardBlock ) * ShardChain { genesisHash , err := ssz . HashTreeRoot ( genesisBlock ) if err != nil { panic ( err ) } return & ShardChain { lock : new ( sync . Mutex ) , RootSlot : rootSlot , chain : [ ] * index . ShardBlockNode { { Parent : nil , BlockHash : genesisHash , StateRoot : genesisBlock . Header . StateRoot , Slot : 0 , Height : 0 , } , } , } }
NewShardChain creates a new shard chain.
NewShardChain creates a new shard chain .