Skip to content

Commit

Permalink
Merge pull request #23 from TRON-US/ipfs-0.5.1
Browse files Browse the repository at this point in the history
Upgrade to upstream IPFS 0.5.1 module
  • Loading branch information
Eric Chen authored May 15, 2020
2 parents e6417b7 + 0f257f1 commit 298b2b9
Show file tree
Hide file tree
Showing 9 changed files with 470 additions and 82 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
interface-go-btfs-core
==================

> The CoreAPI interfaces for go-btfs.
## Table of Contents

- [Contribute](#contribute)
- [License](#license)

## Contribute

PRs are welcome!

Small note: If editing the Readme, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification.

## License

MIT © TRON-US
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
module github.com/TRON-US/interface-go-btfs-core

require (
github.com/TRON-US/go-btfs-files v0.1.1
github.com/TRON-US/go-unixfs v0.4.4
github.com/ipfs/go-cid v0.0.2
github.com/TRON-US/go-btfs-files v0.2.0
github.com/TRON-US/go-unixfs v0.6.0
github.com/ipfs/go-cid v0.0.3
github.com/ipfs/go-ipld-cbor v0.0.2
github.com/ipfs/go-ipld-format v0.0.2
github.com/ipfs/go-merkledag v0.2.3
github.com/ipfs/go-path v0.0.3
github.com/libp2p/go-libp2p-core v0.0.3
github.com/libp2p/go-libp2p-core v0.2.2
github.com/multiformats/go-multiaddr v0.0.4
github.com/multiformats/go-multihash v0.0.5
github.com/multiformats/go-multihash v0.0.7
)

go 1.13
141 changes: 70 additions & 71 deletions go.sum

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions tests/dag.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (tp *TestSuite) TestPutWithHash(t *testing.T) {
t.Fatal(err)
}

nd, err := ipldcbor.FromJSON(strings.NewReader(`"Hello"`), mh.ID, -1)
nd, err := ipldcbor.FromJSON(strings.NewReader(`"Hello"`), mh.SHA3_256, -1)
if err != nil {
t.Fatal(err)
}
Expand All @@ -81,7 +81,7 @@ func (tp *TestSuite) TestPutWithHash(t *testing.T) {
t.Fatal(err)
}

if nd.Cid().String() != "bafyqabtfjbswy3dp" {
if nd.Cid().String() != "bafyrmifu7haikttpqqgc5ewvmp76z3z4ebp7h2ph4memw7dq4nt6btmxny" {
t.Errorf("got wrong cid: %s", nd.Cid().String())
}
}
Expand Down
9 changes: 8 additions & 1 deletion tests/dht.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import (
"context"
"io"
"testing"
"time"

"github.com/TRON-US/interface-go-btfs-core"
iface "github.com/TRON-US/interface-go-btfs-core"
"github.com/TRON-US/interface-go-btfs-core/options"
)

Expand Down Expand Up @@ -43,6 +44,8 @@ func (tp *TestSuite) TestDhtFindPeer(t *testing.T) {
t.Fatal("unexpected number of local addrs")
}

time.Sleep(3 * time.Second)

pi, err := apis[2].Dht().FindPeer(ctx, self0.ID())
if err != nil {
t.Fatal(err)
Expand Down Expand Up @@ -88,6 +91,8 @@ func (tp *TestSuite) TestDhtFindProviders(t *testing.T) {
t.Fatal(err)
}

time.Sleep(3 * time.Second)

out, err := apis[2].Dht().FindProviders(ctx, p, options.Dht.NumProviders(1))
if err != nil {
t.Fatal(err)
Expand Down Expand Up @@ -125,6 +130,8 @@ func (tp *TestSuite) TestDhtProvide(t *testing.T) {

p := s.Path()

time.Sleep(3 * time.Second)

out, err := apis[2].Dht().FindProviders(ctx, p, options.Dht.NumProviders(1))
if err != nil {
t.Fatal(err)
Expand Down
2 changes: 1 addition & 1 deletion tests/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func (tp *TestSuite) TestGenerateSize(t *testing.T) {
t.Fatal(err)
}

k, err := api.Key().Generate(ctx, "foo", opt.Key.Size(1024))
k, err := api.Key().Generate(ctx, "foo", opt.Key.Size(2048))
if err != nil {
t.Fatal(err)
return
Expand Down
Loading

0 comments on commit 298b2b9

Please sign in to comment.