mockselector.go 478 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
package testbridge

import (
	"github.com/ipfs/go-cid"
	ipldbridge "github.com/ipfs/go-graphsync/ipldbridge"
	ipld "github.com/ipld/go-ipld-prime"
)

type mockSelector struct {
	cidsVisited []cid.Cid
}

func newMockSelector(mss *mockSelectorSpec) ipldbridge.Selector {
	return &mockSelector{mss.cidsVisited}
}

func (ms *mockSelector) Explore(ipld.Node) (ipld.KeyIterator, ipldbridge.Selector) {
	return nil, ms
}
func (ms *mockSelector) Decide(ipld.Node) bool { return false }