Commit 12b92f03 authored by Brian Tiger Chow's avatar Brian Tiger Chow

add RandPeerOrFatal test helper

parent b551e45a
package testutil
import (
"testing"
ma "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
ci "github.com/jbenet/go-ipfs/crypto"
peer "github.com/jbenet/go-ipfs/peer"
......@@ -21,6 +23,14 @@ func RandPeer() (Peer, error) {
return &testpeer{*p}, nil
}
func RandPeerOrFatal(t *testing.T) Peer {
p, err := RandPeerNetParams()
if err != nil {
t.Fatal(err)
}
return &testpeer{*p}
}
// peer is a temporary shim to delay binding of PeerNetParams.
type testpeer struct {
PeerNetParams
......
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