MCPcopy Create free account
hub / github.com/ethstorage/es-node / ReadSample

Method ReadSample

ethstorage/data_shard.go:218–226  ·  view source on GitHub ↗
(sampleIdx uint64)

Source from the content-addressed store, hash-verified

216}
217
218func (ds *DataShard) ReadSample(sampleIdx uint64) (common.Hash, error) {
219
220 for _, df := range ds.dataFiles {
221 if df.ContainsSample(sampleIdx) {
222 return df.ReadSample(sampleIdx)
223 }
224 }
225 return common.Hash{}, fmt.Errorf("chunk not found: the shard is not completed?")
226}
227
228func CalcEncodeKey(commit common.Hash, chunkIdx uint64, miner common.Address) common.Hash {
229 return calcEncodeKey(commit, chunkIdx, miner)

Callers

nothing calls this directly

Calls 2

ReadSampleMethod · 0.65
ContainsSampleMethod · 0.45

Tested by

no test coverage detected