(t *testing.T)
| 209 | } |
| 210 | |
| 211 | func 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 | |
| 237 | func TestStorageManager_DownloadAllMeta(t *testing.T) { |
| 238 | setup(t) |
nothing calls this directly
no test coverage detected