mirror of
https://github.com/ipfs/kubo.git
synced 2025-07-01 10:49:24 +08:00
fix(daemon) multiaddr in test
This commit is contained in:
@ -2,11 +2,13 @@ package daemon
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
ma "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
|
||||||
config "github.com/jbenet/go-ipfs/config"
|
config "github.com/jbenet/go-ipfs/config"
|
||||||
core "github.com/jbenet/go-ipfs/core"
|
core "github.com/jbenet/go-ipfs/core"
|
||||||
ci "github.com/jbenet/go-ipfs/crypto"
|
ci "github.com/jbenet/go-ipfs/crypto"
|
||||||
identify "github.com/jbenet/go-ipfs/identify"
|
spipe "github.com/jbenet/go-ipfs/crypto/spipe"
|
||||||
"testing"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestInitializeDaemonListener(t *testing.T) {
|
func TestInitializeDaemonListener(t *testing.T) {
|
||||||
@ -20,7 +22,7 @@ func TestInitializeDaemonListener(t *testing.T) {
|
|||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
ident, _ := identify.IDFromPubKey(pub)
|
ident, _ := spipe.IDFromPubKey(pub)
|
||||||
privKey := base64.StdEncoding.EncodeToString(prbytes)
|
privKey := base64.StdEncoding.EncodeToString(prbytes)
|
||||||
pID := ident.Pretty()
|
pID := ident.Pretty()
|
||||||
|
|
||||||
@ -50,7 +52,11 @@ func TestInitializeDaemonListener(t *testing.T) {
|
|||||||
for _, c := range nodeConfigs {
|
for _, c := range nodeConfigs {
|
||||||
|
|
||||||
node, _ := core.NewIpfsNode(c, false)
|
node, _ := core.NewIpfsNode(c, false)
|
||||||
dl, initErr := NewDaemonListener(node, "localhost:1327")
|
addr, err := ma.NewMultiaddr("/ip4/127.0.0.1/tcp/1327")
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
dl, initErr := NewDaemonListener(node, addr)
|
||||||
if initErr != nil {
|
if initErr != nil {
|
||||||
t.Fatal(initErr)
|
t.Fatal(initErr)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user