Skip to content

Commit 43a2f5d

Browse files
committed
test: wrap root manifest on bzz lookup
1 parent 42b65a3 commit 43a2f5d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

pkg/api/bzz_test.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -794,16 +794,21 @@ func TestFeedIndirection(t *testing.T) {
794794
t.Fatalf("expected file reference, did not got any")
795795
}
796796

797+
// get root chunk of data
798+
// and wrap it in a feed
799+
rootChunk, err := storer.ChunkStore().Get(context.Background(), resp.Reference)
800+
if err != nil {
801+
t.Fatal(err)
802+
}
803+
797804
// now use the "content" to mock the feed lookup
798805
// also, use the mocked mantaray chunks that unmarshal
799806
// into a real manifest with the mocked feed values when
800807
// called from the bzz endpoint. then call the bzz endpoint with
801808
// the pregenerated feed root manifest hash
802809

803-
feedUpdate := toChunk(t, 121212, resp.Reference.Bytes())
804-
805810
var (
806-
look = newMockLookup(-1, 0, feedUpdate, nil, &id{}, nil)
811+
look = newMockLookup(-1, 0, rootChunk, nil, &id{}, nil)
807812
factory = newMockFactory(look)
808813
bzzDownloadResource = func(addr, path string) string { return "/bzz/" + addr + "/" + path }
809814
ctx = context.Background()
@@ -813,7 +818,6 @@ func TestFeedIndirection(t *testing.T) {
813818
Logger: logger,
814819
Feeds: factory,
815820
})
816-
err := storer.Cache().Put(ctx, feedUpdate)
817821
if err != nil {
818822
t.Fatal(err)
819823
}

0 commit comments

Comments
 (0)