Skip to content

Commit 10095f8

Browse files
committed
test fix
1 parent 34573d8 commit 10095f8

File tree

1 file changed

+10
-27
lines changed

1 file changed

+10
-27
lines changed

block/namespace_test.go

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -233,49 +233,32 @@ func TestLegacyNamespaceDetection(t *testing.T) {
233233
} else if tt.namespace != "" {
234234
assert.Equal(t, tt.namespace, dataNS)
235235
} else {
236-
assert.Equal(t, "rollkit-data", dataNS) // Default
236+
assert.Equal(t, "rollkit-headers", dataNS) // Falls back to default namespace
237237
}
238238

239239
// Test actual behavior in fetchBlobs
240240
manager, mockDA, _, cancel := setupManagerForNamespaceTest(t, daConfig)
241241
daManager := newDARetriever(manager)
242242
defer cancel()
243243

244-
// Check if we should expect a namespace check
245-
if tt.namespace != "" {
246-
// When namespace is the same as data namespaces,
247-
// only one call is expected
248-
if headerNS == dataNS {
249-
// All 2 namespaces are the same, so we'll get 1 call.
250-
mockDA.On("GetIDs", mock.Anything, uint64(100), []byte(tt.namespace)).Return(&coreda.GetIDsResult{
251-
IDs: []coreda.ID{},
252-
}, coreda.ErrBlobNotFound).Once()
253-
} else if tt.namespace != dataNS {
254-
mockDA.On("GetIDs", mock.Anything, uint64(100), []byte(tt.namespace)).Return(&coreda.GetIDsResult{
255-
IDs: []coreda.ID{},
256-
}, coreda.ErrBlobNotFound).Once()
257-
258-
mockDA.On("GetIDs", mock.Anything, uint64(100), []byte(tt.dataNamespace)).Return(&coreda.GetIDsResult{
259-
IDs: []coreda.ID{},
260-
}, coreda.ErrBlobNotFound).Once()
261-
262-
} else {
263-
t.Fatalf("Should never happen, forbidden by config")
264-
}
244+
// When namespace is the same as data namespaces,
245+
// only one call is expected
246+
if headerNS == dataNS {
247+
// All 2 namespaces are the same, so we'll get 1 call.
248+
mockDA.On("GetIDs", mock.Anything, uint64(100), []byte(headerNS)).Return(&coreda.GetIDsResult{
249+
IDs: []coreda.ID{},
250+
}, coreda.ErrBlobNotFound).Once()
265251
} else {
266-
// No namespace configured, just use default
267-
268252
mockDA.On("GetIDs", mock.Anything, uint64(100), []byte(headerNS)).Return(&coreda.GetIDsResult{
269253
IDs: []coreda.ID{},
270254
}, coreda.ErrBlobNotFound).Once()
255+
271256
mockDA.On("GetIDs", mock.Anything, uint64(100), []byte(dataNS)).Return(&coreda.GetIDsResult{
272257
IDs: []coreda.ID{},
273258
}, coreda.ErrBlobNotFound).Once()
274259
}
275260

276-
ctx := context.Background()
277-
err := daManager.processNextDAHeaderAndData(ctx)
278-
261+
err := daManager.processNextDAHeaderAndData(context.Background())
279262
// Should succeed with no data found (returns nil on StatusNotFound)
280263
require.NoError(t, err)
281264

0 commit comments

Comments
 (0)