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

Function TestStorageManager_CommitBlobs

ethstorage/storage_manager_test.go:211–235  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

209}
210
211func TestStorageManager_CommitBlobs(t *testing.T) {
212 setup(t)
213
214 kvIndex := uint64(2)
215 b, h := createBlob(kvIndex)
216 successCommitted, err := storageManager.CommitBlobs([]uint64{kvIndex}, [][]byte{b}, []common.Hash{h})
217 if err != nil {
218 t.Fatal("failed to commit blob", err)
219 }
220
221 if len(successCommitted) < 1 {
222 t.Fatal("should commit all the blobs")
223 }
224
225 bs, success, err := storageManager.TryReadMeta(kvIndex)
226 if err != nil || !success {
227 t.Fatal("failed to read meta", err)
228 }
229
230 meta := common.Hash{}
231 copy(meta[:], bs)
232 if meta != PrepareCommit(h) {
233 t.Fatal("failed to write meta", err)
234 }
235}
236
237func TestStorageManager_DownloadAllMeta(t *testing.T) {
238 setup(t)

Callers

nothing calls this directly

Calls 5

createBlobFunction · 0.85
PrepareCommitFunction · 0.85
setupFunction · 0.70
CommitBlobsMethod · 0.65
TryReadMetaMethod · 0.65

Tested by

no test coverage detected