Skip to content

Commit

Permalink
revert: integration of graphsync-v0.9.0 until we are ready to test th…
Browse files Browse the repository at this point in the history
…e whole stack with it (#249)
  • Loading branch information
dirkmc authored Sep 2, 2021
1 parent 4472a8e commit b0599c7
Show file tree
Hide file tree
Showing 24 changed files with 138 additions and 206 deletions.
11 changes: 7 additions & 4 deletions benchmarks/testinstance/testinstance.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ func Close(instances []Instance) error {
// Instance is a test instance of bitswap + dependencies for integration testing
type Instance struct {
Peer peer.ID
LinkSystem ipld.LinkSystem
Loader ipld.Loader
Storer ipld.Storer
BlockStore blockstore.Blockstore
Graphsync graphsync.GraphExchange
Manager datatransfer.Manager
Expand Down Expand Up @@ -163,8 +164,9 @@ func NewInstance(ctx context.Context, net tn.Network, tempDir string, diskBasedD
return Instance{}, err
}

linkSystem := storeutil.LinkSystemForBlockstore(bstore)
gs := gsimpl.New(ctx, gsNet, linkSystem, gsimpl.RejectAllRequestsByDefault())
loader := storeutil.LoaderForBlockstore(bstore)
storer := storeutil.StorerForBlockstore(bstore)
gs := gsimpl.New(ctx, gsNet, loader, storer, gsimpl.RejectAllRequestsByDefault())
transport := gstransport.NewTransport(p, gs)
dt, err := dtimpl.NewDataTransfer(namespace.Wrap(dstore, datastore.NewKey("/data-transfers/transfers")), os.TempDir(), dtNet, transport)
if err != nil {
Expand Down Expand Up @@ -196,7 +198,8 @@ func NewInstance(ctx context.Context, net tn.Network, tempDir string, diskBasedD
Peer: p,
Graphsync: gs,
Manager: dt,
LinkSystem: linkSystem,
Loader: loader,
Storer: storer,
BlockStore: bstore,
blockstoreDelay: bsdelay,
ds: dstore,
Expand Down
2 changes: 1 addition & 1 deletion channels/channel_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (c channelState) BaseCID() cid.Cid { return c.baseCid }
func (c channelState) Selector() ipld.Node {
builder := basicnode.Prototype.Any.NewBuilder()
reader := bytes.NewReader(c.selector.Raw)
err := dagcbor.Decode(builder, reader)
err := dagcbor.Decoder(builder, reader)
if err != nil {
log.Error(err)
}
Expand Down
4 changes: 2 additions & 2 deletions channels/channels_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ func TestMigrationsV0(t *testing.T) {

allSelector := builder.NewSelectorSpecBuilder(basicnode.Prototype.Any).Matcher().Node()
allSelectorBuf := new(bytes.Buffer)
err := dagcbor.Encode(allSelector, allSelectorBuf)
err := dagcbor.Encoder(allSelector, allSelectorBuf)
require.NoError(t, err)
allSelectorBytes := allSelectorBuf.Bytes()

Expand Down Expand Up @@ -556,7 +556,7 @@ func TestMigrationsV1(t *testing.T) {
receivedCids := make([][]cid.Cid, numChannels)
allSelector := builder.NewSelectorSpecBuilder(basicnode.Prototype.Any).Matcher().Node()
allSelectorBuf := new(bytes.Buffer)
err := dagcbor.Encode(allSelector, allSelectorBuf)
err := dagcbor.Encoder(allSelector, allSelectorBuf)
require.NoError(t, err)
allSelectorBytes := allSelectorBuf.Bytes()
selfPeer := testutil.GeneratePeers(1)[0]
Expand Down
13 changes: 3 additions & 10 deletions channels/internal/internalchannel_cbor_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions channels/internal/migrations/v0/v0_cbor_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions channels/internal/migrations/v1/v1_cbor_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions encoding/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func Encode(value Encodable) ([]byte, error) {
}
if ipldEncodable, ok := value.(ipld.Node); ok {
buf := new(bytes.Buffer)
err := dagcbor.Encode(ipldEncodable, buf)
err := dagcbor.Encoder(ipldEncodable, buf)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -79,7 +79,7 @@ type ipldDecoder struct {
func (decoder *ipldDecoder) DecodeFromCbor(encoded []byte) (Encodable, error) {
builder := decoder.style.NewBuilder()
buf := bytes.NewReader(encoded)
err := dagcbor.Decode(builder, buf)
err := dagcbor.Decoder(builder, buf)
if err != nil {
return nil, err
}
Expand Down
20 changes: 9 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,31 @@ require (
github.com/filecoin-project/go-statemachine v0.0.0-20200925024713-05bd7c71fbfe
github.com/hannahhoward/cbor-gen-for v0.0.0-20200817222906-ea96cece81f1
github.com/hannahhoward/go-pubsub v0.0.0-20200423002714-8d62886cc36e
github.com/ipfs/go-block-format v0.0.3
github.com/ipfs/go-block-format v0.0.2
github.com/ipfs/go-blockservice v0.1.3
github.com/ipfs/go-cid v0.0.7
github.com/ipfs/go-datastore v0.4.5
github.com/ipfs/go-ds-badger v0.2.6
github.com/ipfs/go-graphsync v0.9.0
github.com/ipfs/go-ds-badger v0.2.3
github.com/ipfs/go-graphsync v0.6.8
github.com/ipfs/go-ipfs-blockstore v1.0.1
github.com/ipfs/go-ipfs-blocksutil v0.0.1
github.com/ipfs/go-ipfs-chunker v0.0.5
github.com/ipfs/go-ipfs-delay v0.0.1
github.com/ipfs/go-ipfs-exchange-offline v0.0.1
github.com/ipfs/go-ipfs-files v0.0.8
github.com/ipfs/go-ipld-cbor v0.0.5
github.com/ipfs/go-ipld-cbor v0.0.4
github.com/ipfs/go-ipld-format v0.2.0
github.com/ipfs/go-log/v2 v2.1.1
github.com/ipfs/go-merkledag v0.3.2
github.com/ipfs/go-unixfs v0.2.4
github.com/ipld/go-ipld-prime v0.12.0
github.com/ipld/go-ipld-prime v0.5.1-0.20201021195245-109253e8a018
github.com/jbenet/go-random v0.0.0-20190219211222-123a90aedc0c
github.com/jpillora/backoff v1.0.0
github.com/libp2p/go-libp2p v0.13.0
github.com/libp2p/go-libp2p-core v0.8.5
github.com/libp2p/go-libp2p-record v0.1.1 // indirect
github.com/libp2p/go-libp2p v0.12.0
github.com/libp2p/go-libp2p-core v0.7.0
github.com/stretchr/testify v1.6.1
github.com/whyrusleeping/cbor-gen v0.0.0-20210219115102-f37d292932f2
github.com/whyrusleeping/cbor-gen v0.0.0-20200826160007-0b9f6c5fb163
go.uber.org/atomic v1.6.0
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9
golang.org/x/tools v0.1.1-0.20210225150353-54dc8c5edb56 // indirect
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
)
Loading

0 comments on commit b0599c7

Please sign in to comment.