Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
rvagg committed Jul 12, 2023
1 parent 6c8a3dd commit de861dc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions pkg/internal/itest/mocknet/mocknet.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package mocknet
import (
"context"
"errors"
"fmt"
"sync"
"testing"
"time"
Expand Down Expand Up @@ -162,6 +163,10 @@ func (mcf *mockCandidateFinder) FindCandidates(ctx context.Context, cid cid.Cid)
candidates = append(candidates, types.RetrievalCandidate{MinerPeer: *h.AddrInfo(), RootCid: cid, Metadata: md})
}
}
fmt.Println("Returning candidates:", len(candidates))
for _, c := range candidates {
fmt.Println("\tCandidate:", c.MinerPeer.Addrs[0])
}
return candidates, nil
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/internal/itest/trustless_fetch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ func TestTrustlessUnixfsFetch(t *testing.T) {
case "bitswap":
mrn.AddBitswapPeers(1)
}
require.NoError(t, mrn.MN.LinkAll())
var finishedChan chan []datatransfer.Event
if proto == "graphsync" {
finishedChan = mocknet.SetupRetrieval(t, mrn.Remotes[0])
}

mrn.Remotes[0].Blockstore().UseLinkSystem(lsys)
mrn.Remotes[0].Cids[tc.Root] = struct{}{}
require.NoError(t, mrn.MN.LinkAll())

lassie, err := lassie.NewLassie(
ctx,
Expand Down
4 changes: 4 additions & 0 deletions pkg/retriever/bitswapretriever.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ func (br *bitswapRetrieval) RetrieveFromAsyncCandidates(ayncCandidates types.Inb
return nil, nil
}

fmt.Println("hasCandidates", hasCandidates, "nextCandidates", len(nextCandidates))
for _, c := range nextCandidates {
fmt.Println("\tnextCandidates", c.MinerPeer.Addrs)
}
br.events(events.StartedRetrieval(br.clock.Now(), br.request.RetrievalID, bitswapCandidate, multicodec.TransportBitswap))

// set initial providers, then start a goroutine to add more as they come in
Expand Down

0 comments on commit de861dc

Please sign in to comment.