Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
12b92f03
Commit
12b92f03
authored
Dec 23, 2014
by
Brian Tiger Chow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add RandPeerOrFatal test helper
parent
b551e45a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
util/testutil/peer.go
util/testutil/peer.go
+10
-0
No files found.
util/testutil/peer.go
View file @
12b92f03
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment