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

Function GenerateMetadata

ethstorage/p2p/protocol/sync_test.go:67–77  ·  view source on GitHub ↗
(idx, size uint64, hash []byte)

Source from the content-addressed store, hash-verified

65}
66
67func GenerateMetadata(idx, size uint64, hash []byte) common.Hash {
68 meta := make([]byte, 0)
69 idx_bs := make([]byte, 8)
70 binary.BigEndian.PutUint64(idx_bs, idx)
71 meta = append(meta, idx_bs[3:]...)
72 size_bs := make([]byte, 8)
73 binary.BigEndian.PutUint64(size_bs, size)
74 meta = append(meta, size_bs[5:]...)
75 meta = append(meta, hash[:24]...)
76 return common.BytesToHash(meta)
77}
78
79type mockL1Source struct {
80 lastBlobIndex uint64

Callers 1

makeKVStorageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected