Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* Update [email protected]

Simultaneously updates go-ipld-prime-proto, which also has changes to
match that version of go-ipld-prime.

* feat(deps): update ipld-prime near master

update to lastest needed sha for filecoin, reinstitute generated node tests

* feat(deps): update go-ipld-prime-prot

Co-authored-by: hannahhoward <[email protected]>
  • Loading branch information
warpfork and hannahhoward authored Sep 23, 2020
1 parent abebf0f commit a0cc6f0
Show file tree
Hide file tree
Showing 39 changed files with 2,919 additions and 121 deletions.
4 changes: 2 additions & 2 deletions benchmarks/benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func p2pStrestTest(ctx context.Context, b *testing.B, numfiles int, df distFunc,
thisCids := df(ctx, b, instances[:1])
allCids = append(allCids, thisCids...)
}
ssb := builder.NewSelectorSpecBuilder(basicnode.Style.Any)
ssb := builder.NewSelectorSpecBuilder(basicnode.Prototype.Any)

allSelector := ssb.ExploreRecursive(ipldselector.RecursionLimitNone(),
ssb.ExploreAll(ssb.ExploreRecursiveEdge())).Node()
Expand Down Expand Up @@ -140,7 +140,7 @@ func subtestDistributeAndFetch(ctx context.Context, b *testing.B, numnodes int,
i.SetBlockstoreLatency(bstoreLatency)
}
}
ssb := builder.NewSelectorSpecBuilder(basicnode.Style.Any)
ssb := builder.NewSelectorSpecBuilder(basicnode.Prototype.Any)

allSelector := ssb.ExploreRecursive(ipldselector.RecursionLimitNone(),
ssb.ExploreAll(ssb.ExploreRecursiveEdge())).Node()
Expand Down
2 changes: 1 addition & 1 deletion cidset/cidset.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

// EncodeCidSet encodes a cid set into bytes for the do-no-send-cids extension
func EncodeCidSet(cids *cid.Set) ([]byte, error) {
list := fluent.MustBuildList(basicnode.Style.List, cids.Len(), func(la fluent.ListAssembler) {
list := fluent.MustBuildList(basicnode.Prototype.List, cids.Len(), func(la fluent.ListAssembler) {
_ = cids.ForEach(func(c cid.Cid) error {
la.AssembleValue().AssignLink(cidlink.Link{Cid: c})
return nil
Expand Down
2 changes: 1 addition & 1 deletion dedupkey/dedupkey.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

// EncodeDedupKey returns encoded cbor data for string key
func EncodeDedupKey(key string) ([]byte, error) {
nb := basicnode.Style.String.NewBuilder()
nb := basicnode.Prototype.String.NewBuilder()
err := nb.AssignString(key)
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion docs/go-graphsync.puml
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ package "go-filecoin" {
"go-filecoin" .. goGraphSyncNetworkPF
"go-filecoin" *-- RawLoader
"go-filecoin" *-- MulticodecDecodeTable
"go-filecoin" *-- LinkTargetNodeStyleChooser
"go-filecoin" *-- LinkTargetNodePrototypeChooser

}

Expand Down
5 changes: 2 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ require (
github.com/ipfs/go-merkledag v0.3.1
github.com/ipfs/go-peertaskqueue v0.2.0
github.com/ipfs/go-unixfs v0.2.4
github.com/ipld/go-ipld-prime v0.0.4-0.20200828224805-5ff8c8b0b6ef
github.com/ipld/go-ipld-prime-proto v0.0.0-20200828231332-ae0aea07222b
github.com/ipld/go-ipld-prime v0.5.1-0.20200828233916-988837377a7f
github.com/ipld/go-ipld-prime-proto v0.0.0-20200922192210-9a2bfd4440a6
github.com/jbenet/go-random v0.0.0-20190219211222-123a90aedc0c
github.com/jbenet/goprocess v0.1.4 // indirect
github.com/libp2p/go-libp2p v0.6.0
Expand All @@ -39,7 +39,6 @@ require (
github.com/multiformats/go-multihash v0.0.13
github.com/polydawn/refmt v0.0.0-20190809202753-05966cbd336a // indirect
github.com/smartystreets/assertions v1.0.1 // indirect
github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337 // indirect
github.com/stretchr/testify v1.5.1
github.com/whyrusleeping/cbor-gen v0.0.0-20200710004633-5379fc63235d
go.uber.org/multierr v1.4.0 // indirect
Expand Down
14 changes: 6 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,10 @@ github.com/ipfs/go-unixfs v0.2.4 h1:6NwppOXefWIyysZ4LR/qUBPvXd5//8J3jiMdvpbw6Lo=
github.com/ipfs/go-unixfs v0.2.4/go.mod h1:SUdisfUjNoSDzzhGVxvCL9QO/nKdwXdr+gbMUdqcbYw=
github.com/ipfs/go-verifcid v0.0.1 h1:m2HI7zIuR5TFyQ1b79Da5N9dnnCP1vcu2QqawmWlK2E=
github.com/ipfs/go-verifcid v0.0.1/go.mod h1:5Hrva5KBeIog4A+UpqlaIU+DEstipcJYQQZc0g37pY0=
github.com/ipld/go-ipld-prime v0.0.2-0.20200428162820-8b59dc292b8e h1:ZISbJlM0urTANR9KRfRaqlBmyOj5uUtxs2r4Up9IXsA=
github.com/ipld/go-ipld-prime v0.0.2-0.20200428162820-8b59dc292b8e/go.mod h1:uVIwe/u0H4VdKv3kaN1ck7uCb6yD9cFLS9/ELyXbsw8=
github.com/ipld/go-ipld-prime v0.0.4-0.20200828224805-5ff8c8b0b6ef h1:/yPelt/0CuzZsmRkYzBBnJ499JnAOGaIaAXHujx96ic=
github.com/ipld/go-ipld-prime v0.0.4-0.20200828224805-5ff8c8b0b6ef/go.mod h1:uVIwe/u0H4VdKv3kaN1ck7uCb6yD9cFLS9/ELyXbsw8=
github.com/ipld/go-ipld-prime-proto v0.0.0-20200828231332-ae0aea07222b h1:ZtlW6pubN17TDaStlxgrwEXXwwUfJaXu9RobwczXato=
github.com/ipld/go-ipld-prime-proto v0.0.0-20200828231332-ae0aea07222b/go.mod h1:OAV6xBmuTLsPZ+epzKkPB1e25FHk/vCtyatkdHcArLs=
github.com/ipld/go-ipld-prime v0.5.1-0.20200828233916-988837377a7f h1:XpOuNQ5GbXxUcSukbQcW9jkE7REpaFGJU2/T00fo9kA=
github.com/ipld/go-ipld-prime v0.5.1-0.20200828233916-988837377a7f/go.mod h1:0xEgdD6MKbZ1vF0GC+YcR/C4SQCAlRuOjIJ2i0HxqzM=
github.com/ipld/go-ipld-prime-proto v0.0.0-20200922192210-9a2bfd4440a6 h1:6Mq+tZGSEMEoJJ1NbJRhddeelkXZcU8yfH/ZRYUo/Es=
github.com/ipld/go-ipld-prime-proto v0.0.0-20200922192210-9a2bfd4440a6/go.mod h1:3pHYooM9Ea65jewRwrb2u5uHZCNkNTe9ABsVB+SrkH0=
github.com/jackpal/gateway v1.0.5 h1:qzXWUJfuMdlLMtt0a3Dgt+xkWQiA5itDEITVJtuSwMc=
github.com/jackpal/gateway v1.0.5/go.mod h1:lTpwd4ACLXmpyiCTRtfiNyVnUmqT9RivzCDQetPfnjA=
github.com/jackpal/go-nat-pmp v1.0.1 h1:i0LektDkO1QlrTm/cSuP+PyBCDnYvjPLGl4LdWEMiaA=
Expand Down Expand Up @@ -545,8 +543,8 @@ github.com/smartystreets/assertions v1.0.1/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUr
github.com/smartystreets/goconvey v0.0.0-20190222223459-a17d461953aa/go.mod h1:2RVY1rIf+2J2o/IM9+vPq9RzmHDSseB7FoXiSNIUsoU=
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a h1:pa8hGb/2YqsZKovtsgrwcDH1RZhVbTKCjLp47XpqCDs=
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337 h1:WN9BUFbdyOsSH/XohnWpXOlq9NBD5sGAB2FciQMUEe8=
github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s=
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/smola/gocompat v0.2.0/go.mod h1:1B0MlxbmoZNo3h8guHp8HztB3BSYR5itql9qtVc0ypY=
github.com/spacemonkeygo/openssl v0.0.0-20181017203307-c2dcc5cca94a h1:/eS3yfGjQKG+9kayBkj0ip1BGhq6zJ3eaVksphxAaek=
github.com/spacemonkeygo/openssl v0.0.0-20181017203307-c2dcc5cca94a/go.mod h1:7AyxJNCJ7SBZ1MfVQCWD6Uqo2oubI2Eq2y2eqf+A5r0=
Expand Down
4 changes: 2 additions & 2 deletions graphsync.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ type BlockData interface {
type IncomingRequestHookActions interface {
SendExtensionData(ExtensionData)
UsePersistenceOption(name string)
UseLinkTargetNodeStyleChooser(traversal.LinkTargetNodeStyleChooser)
UseLinkTargetNodePrototypeChooser(traversal.LinkTargetNodePrototypeChooser)
TerminateWithError(error)
ValidateRequest()
PauseResponse()
Expand All @@ -221,7 +221,7 @@ type OutgoingBlockHookActions interface {
// to change the execution of a request
type OutgoingRequestHookActions interface {
UsePersistenceOption(name string)
UseLinkTargetNodeStyleChooser(traversal.LinkTargetNodeStyleChooser)
UseLinkTargetNodePrototypeChooser(traversal.LinkTargetNodePrototypeChooser)
}

// IncomingResponseHookActions are actions that incoming response hook can take
Expand Down
8 changes: 4 additions & 4 deletions impl/graphsync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ func TestGraphsyncRoundTripPartial(t *testing.T) {
}
})
// create a selector to traverse the whole tree
ssb := builder.NewSelectorSpecBuilder(basicnode.Style.Any)
ssb := builder.NewSelectorSpecBuilder(basicnode.Prototype.Any)
allSelector := ssb.ExploreRecursive(selector.RecursionLimitDepth(10),
ssb.ExploreAll(ssb.ExploreRecursiveEdge())).Node()

Expand Down Expand Up @@ -587,14 +587,14 @@ func TestGraphsyncRoundTripAlternatePersistenceAndNodes(t *testing.T) {
requestor.RegisterOutgoingRequestHook(func(p peer.ID, requestData graphsync.RequestData, hookActions graphsync.OutgoingRequestHookActions) {
_, has := requestData.Extension(extensionName)
if has {
hookActions.UseLinkTargetNodeStyleChooser(blockChain.Chooser)
hookActions.UseLinkTargetNodePrototypeChooser(blockChain.Chooser)
hookActions.UsePersistenceOption("chainstore")
}
})
responder.RegisterIncomingRequestHook(func(p peer.ID, requestData graphsync.RequestData, hookActions graphsync.IncomingRequestHookActions) {
_, has := requestData.Extension(extensionName)
if has {
hookActions.UseLinkTargetNodeStyleChooser(blockChain.Chooser)
hookActions.UseLinkTargetNodePrototypeChooser(blockChain.Chooser)
hookActions.UsePersistenceOption("chainstore")
}
})
Expand Down Expand Up @@ -828,7 +828,7 @@ func TestUnixFSFetch(t *testing.T) {
clink := cidlink.Link{Cid: nd.Cid()}

// create a selector for the whole UnixFS dag
ssb := builder.NewSelectorSpecBuilder(basicnode.Style.Any)
ssb := builder.NewSelectorSpecBuilder(basicnode.Prototype.Any)

allSelector := ssb.ExploreRecursive(ipldselector.RecursionLimitNone(),
ssb.ExploreAll(ssb.ExploreRecursiveEdge())).Node()
Expand Down
10 changes: 5 additions & 5 deletions ipldutil/ipldutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ import (
)

var (
defaultChooser traversal.LinkTargetNodeStyleChooser = dagpb.AddDagPBSupportToChooser(func(ipld.Link, ipld.LinkContext) (ipld.NodeStyle, error) {
return basicnode.Style.Any, nil
defaultChooser traversal.LinkTargetNodePrototypeChooser = dagpb.AddDagPBSupportToChooser(func(ipld.Link, ipld.LinkContext) (ipld.NodePrototype, error) {
return basicnode.Prototype.Any, nil
})
)

func Traverse(ctx context.Context, loader ipld.Loader, chooser traversal.LinkTargetNodeStyleChooser, root ipld.Link, s selector.Selector, fn traversal.AdvVisitFn) error {
func Traverse(ctx context.Context, loader ipld.Loader, chooser traversal.LinkTargetNodePrototypeChooser, root ipld.Link, s selector.Selector, fn traversal.AdvVisitFn) error {
if chooser == nil {
chooser = defaultChooser
}
Expand All @@ -38,7 +38,7 @@ func Traverse(ctx context.Context, loader ipld.Loader, chooser traversal.LinkTar
Cfg: &traversal.Config{
Ctx: ctx,
LinkLoader: loader,
LinkTargetNodeStyleChooser: chooser,
LinkTargetNodePrototypeChooser: chooser,
},
}.WalkAdv(node, s, fn)
}
Expand All @@ -57,7 +57,7 @@ func EncodeNode(node ipld.Node) ([]byte, error) {
}

func DecodeNode(encoded []byte) (ipld.Node, error) {
nb := basicnode.Style.Any.NewBuilder()
nb := basicnode.Prototype.Any.NewBuilder()
if err := dagcbor.Decoder(nb, bytes.NewReader(encoded)); err != nil {
return nil, err
}
Expand Down
6 changes: 3 additions & 3 deletions ipldutil/traverser.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type TraversalBuilder struct {
Root ipld.Link
Selector ipld.Node
Visitor traversal.AdvVisitFn
Chooser traversal.LinkTargetNodeStyleChooser
Chooser traversal.LinkTargetNodePrototypeChooser
}

// Traverser is an interface for performing a selector traversal that operates iteratively --
Expand Down Expand Up @@ -91,7 +91,7 @@ type traverser struct {
root ipld.Link
selector ipld.Node
visitor traversal.AdvVisitFn
chooser traversal.LinkTargetNodeStyleChooser
chooser traversal.LinkTargetNodePrototypeChooser
currentLink ipld.Link
currentContext ipld.LinkContext
isDone bool
Expand Down Expand Up @@ -169,7 +169,7 @@ func (t *traverser) start() {
Cfg: &traversal.Config{
Ctx: t.ctx,
LinkLoader: loader,
LinkTargetNodeStyleChooser: t.chooser,
LinkTargetNodePrototypeChooser: t.chooser,
},
}.WalkAdv(nd, sel, t.visitor)
t.writeDone(err)
Expand Down
2 changes: 1 addition & 1 deletion ipldutil/traverser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestTraverser(t *testing.T) {

t.Run("traverses correctly, simple struct", func(t *testing.T) {
testdata := testutil.NewTestIPLDTree()
ssb := builder.NewSelectorSpecBuilder(basicnode.Style.Any)
ssb := builder.NewSelectorSpecBuilder(basicnode.Prototype.Any)
sel := ssb.ExploreRecursive(selector.RecursionLimitNone(), ssb.ExploreAll(ssb.ExploreRecursiveEdge())).Node()
traverser := TraversalBuilder{
Root: testdata.RootNodeLnk,
Expand Down
8 changes: 4 additions & 4 deletions message/message_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func TestAppendingRequests(t *testing.T) {
Data: testutil.RandomBytes(100),
}
root := testutil.GenerateCids(1)[0]
ssb := builder.NewSelectorSpecBuilder(basicnode.Style.Any)
ssb := builder.NewSelectorSpecBuilder(basicnode.Prototype.Any)
selector := ssb.Matcher().Node()
id := graphsync.RequestID(rand.Int31())
priority := graphsync.Priority(rand.Int31())
Expand Down Expand Up @@ -145,7 +145,7 @@ func contains(strs []string, x string) bool {
}

func TestRequestCancel(t *testing.T) {
ssb := builder.NewSelectorSpecBuilder(basicnode.Style.Any)
ssb := builder.NewSelectorSpecBuilder(basicnode.Prototype.Any)
selector := ssb.Matcher().Node()
id := graphsync.RequestID(rand.Int31())
priority := graphsync.Priority(rand.Int31())
Expand Down Expand Up @@ -218,7 +218,7 @@ func TestRequestUpdate(t *testing.T) {

func TestToNetFromNetEquivalency(t *testing.T) {
root := testutil.GenerateCids(1)[0]
ssb := builder.NewSelectorSpecBuilder(basicnode.Style.Any)
ssb := builder.NewSelectorSpecBuilder(basicnode.Prototype.Any)
selector := ssb.Matcher().Node()
extensionName := graphsync.ExtensionName("graphsync/awesome")
extension := graphsync.ExtensionData{
Expand Down Expand Up @@ -311,7 +311,7 @@ func TestMergeExtensions(t *testing.T) {
return []byte(string(oldData) + " " + string(newData)), nil
}
root := testutil.GenerateCids(1)[0]
ssb := builder.NewSelectorSpecBuilder(basicnode.Style.Any)
ssb := builder.NewSelectorSpecBuilder(basicnode.Prototype.Any)
selector := ssb.Matcher().Node()
id := graphsync.RequestID(rand.Int31())
priority := graphsync.Priority(rand.Int31())
Expand Down
6 changes: 3 additions & 3 deletions messagequeue/messagequeue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func TestStartupAndShutdown(t *testing.T) {
messageQueue.Startup()
id := graphsync.RequestID(rand.Int31())
priority := graphsync.Priority(rand.Int31())
ssb := builder.NewSelectorSpecBuilder(basicnode.Style.Any)
ssb := builder.NewSelectorSpecBuilder(basicnode.Prototype.Any)
selector := ssb.Matcher().Node()
root := testutil.GenerateCids(1)[0]

Expand Down Expand Up @@ -104,7 +104,7 @@ func TestShutdownDuringMessageSend(t *testing.T) {
messageQueue.Startup()
id := graphsync.RequestID(rand.Int31())
priority := graphsync.Priority(rand.Int31())
ssb := builder.NewSelectorSpecBuilder(basicnode.Style.Any)
ssb := builder.NewSelectorSpecBuilder(basicnode.Prototype.Any)
selector := ssb.Matcher().Node()
root := testutil.GenerateCids(1)[0]

Expand Down Expand Up @@ -198,7 +198,7 @@ func TestDedupingMessages(t *testing.T) {
waitGroup.Add(1)
id := graphsync.RequestID(rand.Int31())
priority := graphsync.Priority(rand.Int31())
ssb := builder.NewSelectorSpecBuilder(basicnode.Style.Any)
ssb := builder.NewSelectorSpecBuilder(basicnode.Prototype.Any)
selector := ssb.Matcher().Node()
root := testutil.GenerateCids(1)[0]

Expand Down
6 changes: 3 additions & 3 deletions metadata/metadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
func TestDecodeEncodeMetadata(t *testing.T) {
cids := testutil.GenerateCids(10)
initialMetadata := make(Metadata, 0, 10)
nd := fluent.MustBuildList(basicnode.Style.List, 10, func(fla fluent.ListAssembler) {
nd := fluent.MustBuildList(basicnode.Prototype.List, 10, func(fla fluent.ListAssembler) {
for _, k := range cids {
blockPresent := rand.Int31()%2 == 0
initialMetadata = append(initialMetadata, Item{k, blockPresent})
Expand All @@ -44,12 +44,12 @@ func TestDecodeEncodeMetadata(t *testing.T) {
require.NoError(t, err)
require.Equal(t, decodedMetadata, decodedMetadataFromNode, "metadata not equal to IPLD encoding")

nb := basicnode.Style.List.NewBuilder()
nb := basicnode.Prototype.List.NewBuilder()
err = dagcbor.Decoder(nb, encodedNode)
require.NoError(t, err)
decodedNode := nb.Build()
require.Equal(t, nd, decodedNode)
nb = basicnode.Style.List.NewBuilder()
nb = basicnode.Prototype.List.NewBuilder()
err = dagcbor.Decoder(nb, bytes.NewReader(encoded))
require.NoError(t, err)
decodedNodeFromMetadata := nb.Build()
Expand Down
2 changes: 1 addition & 1 deletion network/libp2p_impl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func TestMessageSendAndReceive(t *testing.T) {
gsnet2.SetDelegate(r)

root := testutil.GenerateCids(1)[0]
ssb := builder.NewSelectorSpecBuilder(basicnode.Style.Any)
ssb := builder.NewSelectorSpecBuilder(basicnode.Prototype.Any)
selector := ssb.Matcher().Node()
extensionName := graphsync.ExtensionName("graphsync/awesome")
extension := graphsync.ExtensionData{
Expand Down
2 changes: 1 addition & 1 deletion peermanager/peermessagemanager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func TestSendingMessagesToPeers(t *testing.T) {
id := graphsync.RequestID(rand.Int31())
priority := graphsync.Priority(rand.Int31())
root := testutil.GenerateCids(1)[0]
ssb := builder.NewSelectorSpecBuilder(basicnode.Style.Any)
ssb := builder.NewSelectorSpecBuilder(basicnode.Prototype.Any)
selector := ssb.Matcher().Node()

peerManager := NewMessageManager(ctx, peerQueueFactory)
Expand Down
6 changes: 3 additions & 3 deletions requestmanager/executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type RequestExecution struct {
Request gsmsg.GraphSyncRequest
LastResponse *atomic.Value
DoNotSendCids *cid.Set
NodeStyleChooser traversal.LinkTargetNodeStyleChooser
NodePrototypeChooser traversal.LinkTargetNodePrototypeChooser
ResumeMessages chan []graphsync.ExtensionData
PauseMessages chan struct{}
}
Expand All @@ -58,7 +58,7 @@ func (ee ExecutionEnv) Start(re RequestExecution) (chan graphsync.ResponseProgre
request: re.Request,
lastResponse: re.LastResponse,
doNotSendCids: re.DoNotSendCids,
nodeStyleChooser: re.NodeStyleChooser,
nodeStyleChooser: re.NodePrototypeChooser,
resumeMessages: re.ResumeMessages,
pauseMessages: re.PauseMessages,
env: ee,
Expand All @@ -76,7 +76,7 @@ type requestExecutor struct {
networkError chan error
request gsmsg.GraphSyncRequest
lastResponse *atomic.Value
nodeStyleChooser traversal.LinkTargetNodeStyleChooser
nodeStyleChooser traversal.LinkTargetNodePrototypeChooser
resumeMessages chan []graphsync.ExtensionData
pauseMessages chan struct{}
doNotSendCids *cid.Set
Expand Down
6 changes: 3 additions & 3 deletions requestmanager/executor/executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,9 @@ func (ree *requestExecutionEnv) sendRequest(p peer.ID, request gsmsg.GraphSyncRe
}
}

func (ree *requestExecutionEnv) nodeStyleChooser(ipld.Link, ipld.LinkContext) (ipld.NodeStyle, error) {
func (ree *requestExecutionEnv) nodeStyleChooser(ipld.Link, ipld.LinkContext) (ipld.NodePrototype, error) {
ree.nodeStyleChooserCalled = true
return basicnode.Style.Any, nil
return basicnode.Prototype.Any, nil
}

func (ree *requestExecutionEnv) checkPause(requestID graphsync.RequestID, link ipld.Link, result <-chan types.AsyncLoadResult) {
Expand Down Expand Up @@ -435,7 +435,7 @@ func (ree *requestExecutionEnv) requestExecution() (chan graphsync.ResponseProgr
LastResponse: &lastResponse,
Request: ree.request,
DoNotSendCids: ree.doNotSendCids,
NodeStyleChooser: ree.nodeStyleChooser,
NodePrototypeChooser: ree.nodeStyleChooser,
ResumeMessages: ree.resumeMessages,
PauseMessages: ree.pauseMessages,
})
Expand Down
8 changes: 4 additions & 4 deletions requestmanager/hooks/hooks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
)

func TestRequestHookProcessing(t *testing.T) {
fakeChooser := func(ipld.Link, ipld.LinkContext) (ipld.NodeStyle, error) {
return basicnode.Style.Any, nil
fakeChooser := func(ipld.Link, ipld.LinkContext) (ipld.NodePrototype, error) {
return basicnode.Prototype.Any, nil
}
extensionData := testutil.RandomBytes(100)
extensionName := graphsync.ExtensionName("AppleSauce/McGee")
Expand All @@ -30,7 +30,7 @@ func TestRequestHookProcessing(t *testing.T) {

root := testutil.GenerateCids(1)[0]
requestID := graphsync.RequestID(rand.Int31())
ssb := builder.NewSelectorSpecBuilder(basicnode.Style.Any)
ssb := builder.NewSelectorSpecBuilder(basicnode.Prototype.Any)
request := gsmsg.NewRequest(requestID, root, ssb.Matcher().Node(), graphsync.Priority(0), extension)
p := testutil.GeneratePeers(1)[0]
testCases := map[string]struct {
Expand All @@ -47,7 +47,7 @@ func TestRequestHookProcessing(t *testing.T) {
configure: func(t *testing.T, hooks *hooks.OutgoingRequestHooks) {
hooks.Register(func(p peer.ID, requestData graphsync.RequestData, hookActions graphsync.OutgoingRequestHookActions) {
if _, found := requestData.Extension(extensionName); found {
hookActions.UseLinkTargetNodeStyleChooser(fakeChooser)
hookActions.UseLinkTargetNodePrototypeChooser(fakeChooser)
}
})
},
Expand Down
Loading

0 comments on commit a0cc6f0

Please sign in to comment.