Skip to content

Commit

Permalink
fix: trust most linksystems
Browse files Browse the repository at this point in the history
  • Loading branch information
rvagg committed Sep 19, 2023
1 parent eab31ac commit 948b6a9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/internal/itest/http_fetch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,7 @@ func TestHttpFetch(t *testing.T) {
lsys := cidlink.DefaultLinkSystem()
lsys.SetReadStorage(store)
lsys.SetWriteStorage(store)
lsys.TrustedStorage = true
_, err := traversal.Config{
Root: srcData.Root,
Selector: selectorparse.CommonSelector_ExploreAllRecursively,
Expand Down Expand Up @@ -645,6 +646,7 @@ func TestHttpFetch(t *testing.T) {
lsys := cidlink.DefaultLinkSystem()
lsys.SetReadStorage(store)
lsys.SetWriteStorage(store)
lsys.TrustedStorage = true
_, err := traversal.Config{
Root: srcData.Root,
Selector: selectorparse.CommonSelector_ExploreAllRecursively,
Expand Down Expand Up @@ -701,6 +703,7 @@ func TestHttpFetch(t *testing.T) {
lsys := cidlink.DefaultLinkSystem()
lsys.SetReadStorage(store)
lsys.SetWriteStorage(store)
lsys.TrustedStorage = true
_, err := traversal.Config{
Root: srcData.Root,
Selector: selectorparse.CommonSelector_ExploreAllRecursively,
Expand Down
2 changes: 2 additions & 0 deletions pkg/net/client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func TestClient(t *testing.T) {
}
p := peer.ID("testpeer")
linkSys := cidlink.DefaultLinkSystem()
linkSys.TrustedStorage = true
gotLoadFor := cid.Undef
linkSys.StorageReadOpener = func(linkCtx ipld.LinkContext, lnk ipld.Link) (io.Reader, error) {
gotLoadFor = lnk.(cidlink.Link).Cid
Expand Down Expand Up @@ -89,6 +90,7 @@ func TestClient_BadSelector(t *testing.T) {
}
p := peer.ID("testpeer")
linkSys := cidlink.DefaultLinkSystem()
linkSys.TrustedStorage = true
selector := basicnode.NewFloat(100.2)
proposal := &retrievaltypes.DealProposal{
PayloadCID: cid.MustParse("bafyreibdoxfay27gf4ye3t5a7aa5h4z2azw7hhhz36qrbf5qleldj76qfa"),
Expand Down
2 changes: 2 additions & 0 deletions pkg/retriever/bitswapretriever_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ func TestBitswapRetriever(t *testing.T) {
lsys := cidlink.DefaultLinkSystem()
lsys.SetReadStorage(store)
lsys.SetWriteStorage(store)
lsys.TrustedStorage = true
tbc1 := gstestutil.SetupBlockChain(ctx, t, lsys, 1000, 100)
tbc2 := gstestutil.SetupBlockChain(ctx, t, lsys, 1000, 100)
var tbc1Cids []cid.Cid
Expand Down Expand Up @@ -600,6 +601,7 @@ func makeLsys(blocks []blocks.Block, threadsafe bool) *linking.LinkSystem {
}
lsys.SetReadStorage(store)
lsys.SetWriteStorage(store)
lsys.TrustedStorage = true
return &lsys
}

Expand Down
1 change: 1 addition & 0 deletions pkg/retriever/httpretriever_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ func TestHTTPRetriever(t *testing.T) {
lsys := cidlink.DefaultLinkSystem()
lsys.SetReadStorage(store)
lsys.SetWriteStorage(store)
lsys.TrustedStorage = true
tbc1 := gstestutil.SetupBlockChain(ctx, t, lsys, 1000, 100)
tbc2 := gstestutil.SetupBlockChain(ctx, t, lsys, 1000, 100)
var tbc1Cids []cid.Cid
Expand Down

0 comments on commit 948b6a9

Please sign in to comment.