Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
rvagg committed Aug 14, 2023
1 parent 1af7439 commit bb7d54a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/internal/itest/trustless_fetch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/filecoin-project/lassie/pkg/lassie"
httpserver "github.com/filecoin-project/lassie/pkg/server/http"
"github.com/google/uuid"
"github.com/ipfs/go-log/v2"
"github.com/ipfs/go-unixfsnode"
"github.com/ipld/go-car/v2"
cidlink "github.com/ipld/go-ipld-prime/linking/cid"
Expand All @@ -26,6 +27,12 @@ import (
func TestTrustlessUnixfsFetch(t *testing.T) {
req := require.New(t)

lvl, err := log.LevelFromString("debug")
if err != nil {
panic(err)
}
log.SetAllLoggers(lvl)

testCases, err := trustlesspathing.Unixfs20mVarietyCases()
req.NoError(err)
storage, closer, err := trustlesspathing.Unixfs20mVarietyReadableStorage()
Expand Down
3 changes: 3 additions & 0 deletions pkg/retriever/bitswapretriever.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ func (br *bitswapRetrieval) RetrieveFromAsyncCandidates(ayncCandidates types.Inb

func loaderForSession(retrievalID types.RetrievalID, inProgressCids InProgressCids, bs blockservice.BlockGetter) linking.BlockReadOpener {
return func(lctx linking.LinkContext, lnk datamodel.Link) (io.Reader, error) {
fmt.Println("loaderForSession", lnk.String())
cidLink, ok := lnk.(cidlink.Link)
if !ok {
return nil, fmt.Errorf("invalid link type for loading: %v", lnk)
Expand All @@ -294,7 +295,9 @@ func loaderForSession(retrievalID types.RetrievalID, inProgressCids InProgressCi
return nil, lctx.Ctx.Err()
default:
}
fmt.Println("bs.GetBlock()", cidLink.Cid.String())
blk, err := bs.GetBlock(lctx.Ctx, cidLink.Cid)
fmt.Println("bs.GetBlock() done", cidLink.Cid.String(), err)
inProgressCids.Dec(cidLink.Cid, retrievalID)
if err != nil {
return nil, err
Expand Down

0 comments on commit bb7d54a

Please sign in to comment.