Commit a360c661 authored by vyzo's avatar vyzo

fix tests

parent ea4eec1d
...@@ -17,7 +17,6 @@ import ( ...@@ -17,7 +17,6 @@ import (
peer "github.com/libp2p/go-libp2p-core/peer" peer "github.com/libp2p/go-libp2p-core/peer"
pstoremem "github.com/libp2p/go-libp2p-peerstore/pstoremem" pstoremem "github.com/libp2p/go-libp2p-peerstore/pstoremem"
record "github.com/libp2p/go-libp2p-record" record "github.com/libp2p/go-libp2p-record"
madns "github.com/multiformats/go-multiaddr-dns"
) )
type mockResolver struct { type mockResolver struct {
...@@ -110,7 +109,11 @@ func TestPublishWithCache0(t *testing.T) { ...@@ -110,7 +109,11 @@ func TestPublishWithCache0(t *testing.T) {
"pk": record.PublicKeyValidator{}, "pk": record.PublicKeyValidator{},
}) })
nsys := NewNameSystem(routing, dst, madns.DefaultResolver, 0) nsys, err := NewNameSystem(routing, WithDatastore(dst))
if err != nil {
t.Fatal(err)
}
// CID is arbitrary. // CID is arbitrary.
p, err := path.ParsePath("QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn") p, err := path.ParsePath("QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn")
if err != nil { if err != nil {
...@@ -143,7 +146,11 @@ func TestPublishWithTTL(t *testing.T) { ...@@ -143,7 +146,11 @@ func TestPublishWithTTL(t *testing.T) {
"pk": record.PublicKeyValidator{}, "pk": record.PublicKeyValidator{},
}) })
nsys := NewNameSystem(routing, dst, madns.DefaultResolver, 128) nsys, err := NewNameSystem(routing, WithDatastore(dst), WithCache(128))
if err != nil {
t.Fatal(err)
}
// CID is arbitrary. // CID is arbitrary.
p, err := path.ParsePath("QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn") p, err := path.ParsePath("QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn")
if err != nil { if err != nil {
......
...@@ -22,8 +22,6 @@ import ( ...@@ -22,8 +22,6 @@ import (
ipns_pb "github.com/ipfs/go-ipns/pb" ipns_pb "github.com/ipfs/go-ipns/pb"
path "github.com/ipfs/go-path" path "github.com/ipfs/go-path"
madns "github.com/multiformats/go-multiaddr-dns"
keystore "github.com/ipfs/go-ipfs-keystore" keystore "github.com/ipfs/go-ipfs-keystore"
namesys "github.com/ipfs/go-namesys" namesys "github.com/ipfs/go-namesys"
. "github.com/ipfs/go-namesys/republisher" . "github.com/ipfs/go-namesys/republisher"
...@@ -76,7 +74,10 @@ func TestRepublish(t *testing.T) { ...@@ -76,7 +74,10 @@ func TestRepublish(t *testing.T) {
var nodes []*mockNode var nodes []*mockNode
for i := 0; i < 10; i++ { for i := 0; i < 10; i++ {
n := getMockNode(t, ctx) n := getMockNode(t, ctx)
ns := namesys.NewNameSystem(n.dht, n.store, madns.DefaultResolver, 0) ns, err := namesys.NewNameSystem(n.dht, namesys.WithDatastore(n.store))
if err != nil {
t.Fatal(err)
}
nsystems = append(nsystems, ns) nsystems = append(nsystems, ns)
nodes = append(nodes, n) nodes = append(nodes, n)
...@@ -155,7 +156,10 @@ func TestLongEOLRepublish(t *testing.T) { ...@@ -155,7 +156,10 @@ func TestLongEOLRepublish(t *testing.T) {
var nodes []*mockNode var nodes []*mockNode
for i := 0; i < 10; i++ { for i := 0; i < 10; i++ {
n := getMockNode(t, ctx) n := getMockNode(t, ctx)
ns := namesys.NewNameSystem(n.dht, n.store, madns.DefaultResolver, 0) ns, err := namesys.NewNameSystem(n.dht, namesys.WithDatastore(n.store))
if err != nil {
t.Fatal(err)
}
nsystems = append(nsystems, ns) nsystems = append(nsystems, ns)
nodes = append(nodes, n) nodes = append(nodes, n)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment