Skip to content

Commit

Permalink
Merge pull request #59 from nisainan/master
Browse files Browse the repository at this point in the history
update go-libp2p to v0.22.0
  • Loading branch information
MarcoPolo authored Sep 13, 2022
2 parents e74499d + 884fbea commit 33d2f82
Show file tree
Hide file tree
Showing 14 changed files with 131 additions and 243 deletions.
5 changes: 2 additions & 3 deletions bootstrap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import (
"errors"
"testing"

"github.com/libp2p/go-libp2p-core/routing"

errwrap "github.com/hashicorp/errwrap"
"github.com/hashicorp/errwrap"
"github.com/libp2p/go-libp2p/core/routing"
)

type bootstrapRouter struct {
Expand Down
11 changes: 5 additions & 6 deletions composed.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ package routinghelpers
import (
"context"

ci "github.com/libp2p/go-libp2p-core/crypto"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/routing"

multierror "github.com/hashicorp/go-multierror"
cid "github.com/ipfs/go-cid"
"github.com/hashicorp/go-multierror"
"github.com/ipfs/go-cid"
ci "github.com/libp2p/go-libp2p/core/crypto"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/libp2p/go-libp2p/core/routing"
)

// Compose composes the components into a single router. Not specifying a
Expand Down
7 changes: 3 additions & 4 deletions dummy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ import (
"strings"
"sync"

"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/routing"

"github.com/ipfs/go-cid"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/libp2p/go-libp2p/core/routing"
)

type testCloser struct {
Expand All @@ -23,7 +22,7 @@ func (closer *testCloser) Close() error {

type failValueStore struct{}

var errFailValue = errors.New("fail valuestore error")
var errFailValue = errors.New("fail value-store error")

func (f failValueStore) PutValue(ctx context.Context, key string, value []byte, opts ...routing.Option) error {
return errFailValue
Expand Down
52 changes: 25 additions & 27 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,36 +1,34 @@
module github.com/libp2p/go-libp2p-routing-helpers

go 1.18

require (
github.com/hashicorp/errwrap v1.0.0
github.com/hashicorp/go-multierror v1.1.0
github.com/ipfs/go-cid v0.0.5
github.com/libp2p/go-libp2p-core v0.5.3
github.com/libp2p/go-libp2p-record v0.1.2
github.com/multiformats/go-multihash v0.0.13
github.com/hashicorp/errwrap v1.1.0
github.com/hashicorp/go-multierror v1.1.1
github.com/ipfs/go-cid v0.3.0
github.com/libp2p/go-libp2p v0.22.0
github.com/libp2p/go-libp2p-record v0.2.0
github.com/multiformats/go-multihash v0.2.1
)

require (
github.com/btcsuite/btcd v0.20.1-beta // indirect
github.com/gogo/protobuf v1.3.1 // indirect
github.com/ipfs/go-log v0.0.1 // indirect
github.com/libp2p/go-buffer-pool v0.0.2 // indirect
github.com/libp2p/go-openssl v0.0.4 // indirect
github.com/mattn/go-colorable v0.1.1 // indirect
github.com/mattn/go-isatty v0.0.5 // indirect
github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 // indirect
github.com/minio/sha256-simd v0.1.1 // indirect
github.com/mr-tron/base58 v1.1.3 // indirect
github.com/multiformats/go-base32 v0.0.3 // indirect
github.com/multiformats/go-multiaddr v0.2.1 // indirect
github.com/multiformats/go-multibase v0.0.1 // indirect
github.com/multiformats/go-varint v0.0.5 // indirect
github.com/opentracing/opentracing-go v1.0.2 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/klauspost/cpuid/v2 v2.1.0 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/libp2p/go-openssl v0.1.0 // indirect
github.com/mattn/go-pointer v0.0.1 // indirect
github.com/minio/sha256-simd v1.0.0 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/multiformats/go-base32 v0.0.4 // indirect
github.com/multiformats/go-base36 v0.1.0 // indirect
github.com/multiformats/go-multiaddr v0.6.0 // indirect
github.com/multiformats/go-multibase v0.1.1 // indirect
github.com/multiformats/go-multicodec v0.5.0 // indirect
github.com/multiformats/go-varint v0.0.6 // indirect
github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/whyrusleeping/go-logging v0.0.0-20170515211332-0457bb6b88fc // indirect
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 // indirect
golang.org/x/net v0.0.0-20190620200207-3b0461eec859 // indirect
golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb // indirect
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab // indirect
lukechampine.com/blake3 v1.1.7 // indirect
)

go 1.18
246 changes: 73 additions & 173 deletions go.sum

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions limited.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"io"
"strings"

ci "github.com/libp2p/go-libp2p-core/crypto"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/routing"
ci "github.com/libp2p/go-libp2p/core/crypto"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/libp2p/go-libp2p/core/routing"
)

// LimitedValueStore limits the internal value store to the given namespaces.
Expand Down
2 changes: 1 addition & 1 deletion limited_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"testing"

"github.com/libp2p/go-libp2p-core/routing"
"github.com/libp2p/go-libp2p/core/routing"
)

func TestLimitedValueStore(t *testing.T) {
Expand Down
5 changes: 2 additions & 3 deletions null.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ package routinghelpers
import (
"context"

"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/routing"

"github.com/ipfs/go-cid"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/libp2p/go-libp2p/core/routing"
)

// Null is a router that doesn't do anything.
Expand Down
7 changes: 3 additions & 4 deletions null_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ import (
"context"
"testing"

"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/routing"

cid "github.com/ipfs/go-cid"
"github.com/ipfs/go-cid"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/libp2p/go-libp2p/core/routing"
)

func TestNull(t *testing.T) {
Expand Down
7 changes: 3 additions & 4 deletions parallel.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ import (
"reflect"
"sync"

ci "github.com/libp2p/go-libp2p-core/crypto"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/routing"

"github.com/hashicorp/go-multierror"
"github.com/ipfs/go-cid"
record "github.com/libp2p/go-libp2p-record"
ci "github.com/libp2p/go-libp2p/core/crypto"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/libp2p/go-libp2p/core/routing"
)

// Parallel operates on the slice of routers in parallel.
Expand Down
9 changes: 4 additions & 5 deletions parallel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ import (
"testing"
"time"

"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/routing"

errwrap "github.com/hashicorp/errwrap"
cid "github.com/ipfs/go-cid"
"github.com/hashicorp/errwrap"
"github.com/ipfs/go-cid"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/libp2p/go-libp2p/core/routing"
mh "github.com/multiformats/go-multihash"
)

Expand Down
4 changes: 2 additions & 2 deletions pubkey_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"
"testing"

"github.com/libp2p/go-libp2p-core/routing"
"github.com/libp2p/go-libp2p-core/test"
"github.com/libp2p/go-libp2p/core/routing"
"github.com/libp2p/go-libp2p/core/test"
)

func TestGetPublicKey(t *testing.T) {
Expand Down
7 changes: 3 additions & 4 deletions tiered.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ import (
"context"
"io"

ci "github.com/libp2p/go-libp2p-core/crypto"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/routing"

"github.com/hashicorp/go-multierror"
"github.com/ipfs/go-cid"
record "github.com/libp2p/go-libp2p-record"
ci "github.com/libp2p/go-libp2p/core/crypto"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/libp2p/go-libp2p/core/routing"
)

// Tiered is like the Parallel except that GetValue and FindPeer
Expand Down
6 changes: 2 additions & 4 deletions tiered_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ import (
"context"
"testing"

"github.com/libp2p/go-libp2p-core/routing"

record "github.com/libp2p/go-libp2p-record"

"github.com/hashicorp/errwrap"
"github.com/ipfs/go-cid"
record "github.com/libp2p/go-libp2p-record"
"github.com/libp2p/go-libp2p/core/routing"
)

type testValidator struct{}
Expand Down

0 comments on commit 33d2f82

Please sign in to comment.