github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/cmd/bootstrap/run/cluster_block.go (about) 1 package run 2 3 import ( 4 "fmt" 5 6 "github.com/onflow/flow-go/model/cluster" 7 "github.com/onflow/flow-go/model/flow" 8 clusterstate "github.com/onflow/flow-go/state/cluster" 9 ) 10 11 func GenerateRootClusterBlocks(epoch uint64, clusters flow.ClusterList) []*cluster.Block { 12 clusterBlocks := make([]*cluster.Block, len(clusters)) 13 for i := range clusterBlocks { 14 cluster, ok := clusters.ByIndex(uint(i)) 15 if !ok { 16 panic(fmt.Sprintf("failed to get cluster by index: %v", i)) 17 } 18 19 clusterBlocks[i] = clusterstate.CanonicalRootBlock(epoch, cluster) 20 } 21 return clusterBlocks 22 }