Skip to content

Commit

Permalink
call the routing interface BasicRouting, alias to top level type
Browse files Browse the repository at this point in the history
  • Loading branch information
vyzo committed Oct 23, 2018
1 parent a41a933 commit 5c21f1c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ type AddrsFactory = bhost.AddrsFactory
// NATManagerC is a NATManager constructor.
type NATManagerC func(inet.Network) bhost.NATManager

type Routing interface {
type BasicRouting interface {
routing.ContentRouting
routing.PeerRouting
}

type RoutingC func(host.Host) (Routing, error)
type RoutingC func(host.Host) (BasicRouting, error)

// Config describes a set of settings for a libp2p node
//
Expand Down
3 changes: 3 additions & 0 deletions libp2p.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ type Config = config.Config
// (`libp2p.New`).
type Option = config.Option

// BasicRouting is the combination of PeerRouting and ContentRouting
type BasicRouting = config.BasicRouting

// ChainOptions chains multiple options into a single option.
func ChainOptions(opts ...Option) Option {
return func(cfg *Config) error {
Expand Down
3 changes: 1 addition & 2 deletions p2p/host/relay/autorelay_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"time"

libp2p "github.com/libp2p/go-libp2p"
config "github.com/libp2p/go-libp2p/config"
relay "github.com/libp2p/go-libp2p/p2p/host/relay"

ggio "github.com/gogo/protobuf/io"
Expand Down Expand Up @@ -137,7 +136,7 @@ func TestAutoRelay(t *testing.T) {
defer cancel()

mtab := newMockRoutingTable()
makeRouting := func(h host.Host) (config.Routing, error) {
makeRouting := func(h host.Host) (libp2p.BasicRouting, error) {
mr := newMockRouting(h, mtab)
return mr, nil
}
Expand Down

0 comments on commit 5c21f1c

Please sign in to comment.