diff --git a/ingest/schema/schema.go b/ingest/schema/schema.go index b7c00e3..d2f41f7 100644 --- a/ingest/schema/schema.go +++ b/ingest/schema/schema.go @@ -7,6 +7,7 @@ import ( "github.com/ipfs/go-cid" "github.com/ipld/go-ipld-prime" _ "github.com/ipld/go-ipld-prime/codec/dagjson" + _ "github.com/ipld/go-ipld-prime/codec/raw" cidlink "github.com/ipld/go-ipld-prime/linking/cid" "github.com/ipld/go-ipld-prime/node/bindnode" "github.com/ipld/go-ipld-prime/schema" diff --git a/ingest/schema/types_test.go b/ingest/schema/types_test.go index aa4a7d4..3e6ced9 100644 --- a/ingest/schema/types_test.go +++ b/ingest/schema/types_test.go @@ -256,6 +256,16 @@ func Test_MismatchingNodeIsError(t *testing.T) { require.True(t, strings.HasPrefix(err.Error(), "faild to convert node prototype")) } +func Test_LinkLoadNoEntries(t *testing.T) { + ls := cidlink.DefaultLinkSystem() + store := &memstore.Store{} + ls.SetReadStorage(store) + ls.SetWriteStorage(store) + + _, err := ls.Load(ipld.LinkContext{}, stischema.NoEntries, stischema.AdvertisementPrototype) + require.Equal(t, "404", err.Error()) +} + func generateAdvertisement() *stischema.Advertisement { mhs := test.RandomMultihashes(7) prev := ipld.Link(cidlink.Link{Cid: cid.NewCidV1(cid.Raw, mhs[0])})