remove noop Stop() in address book.

This commit is contained in:
Raúl Kripalani 2018-09-18 18:01:10 +01:00
parent 4b2c1212e7
commit 5b9ad98cc2
2 changed files with 5 additions and 14 deletions

View File

@ -80,11 +80,6 @@ func NewAddrBook(ctx context.Context, store ds.TxnDatastore, opts Options) (*dsA
return mgr, nil
}
// Stop will signal the TTL manager to stop and block until it returns.
func (mgr *dsAddrBook) Stop() {
// noop
}
func keysAndAddrs(p peer.ID, addrs []ma.Multiaddr) ([]ds.Key, []ma.Multiaddr, error) {
var (
keys = make([]ds.Key, len(addrs))

View File

@ -172,9 +172,9 @@ func badgerStore(t testing.TB) (ds.TxnDatastore, func()) {
func peerstoreFactory(tb testing.TB, opts Options) pt.PeerstoreFactory {
return func() (pstore.Peerstore, func()) {
ds, closeFunc := badgerStore(tb)
store, closeFunc := badgerStore(tb)
ps, err := NewPeerstore(context.Background(), ds, opts)
ps, err := NewPeerstore(context.Background(), store, opts)
if err != nil {
tb.Fatal(err)
}
@ -185,17 +185,13 @@ func peerstoreFactory(tb testing.TB, opts Options) pt.PeerstoreFactory {
func addressBookFactory(tb testing.TB, opts Options) pt.AddrBookFactory {
return func() (pstore.AddrBook, func()) {
ds, closeDB := badgerStore(tb)
store, closeFunc := badgerStore(tb)
mgr, err := NewAddrBook(context.Background(), ds, opts)
ab, err := NewAddrBook(context.Background(), store, opts)
if err != nil {
tb.Fatal(err)
}
closeFunc := func() {
mgr.Stop()
closeDB()
}
return mgr, closeFunc
return ab, closeFunc
}
}