github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/model/verification/chunkStatus.go (about) 1 package verification 2 3 import ( 4 "github.com/onflow/flow-go/model/chunks" 5 "github.com/onflow/flow-go/model/flow" 6 ) 7 8 // ChunkStatus is a data struct represents the current status of fetching chunk data pack for the chunk. 9 type ChunkStatus struct { 10 ChunkIndex uint64 11 BlockHeight uint64 12 ExecutionResult *flow.ExecutionResult 13 } 14 15 func (s ChunkStatus) Chunk() *flow.Chunk { 16 return s.ExecutionResult.Chunks[s.ChunkIndex] 17 } 18 19 func (s ChunkStatus) ChunkLocatorID() flow.Identifier { 20 return chunks.ChunkLocatorID(s.ExecutionResult.ID(), s.ChunkIndex) 21 } 22 23 type ChunkStatusList []*ChunkStatus 24 25 func (l ChunkStatusList) Chunks() flow.ChunkList { 26 chunks := make(flow.ChunkList, 0, len(l)) 27 for _, status := range l { 28 chunks = append(chunks, status.ExecutionResult.Chunks[status.ChunkIndex]) 29 } 30 31 return chunks 32 }