1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-09-09 19:32:24 +08:00

p2p/test: bogus key pair for faster tests

This commit is contained in:
Juan Batiz-Benet
2015-01-05 05:21:05 -08:00
parent 41af4f4ea1
commit 1ab9588cba
5 changed files with 181 additions and 14 deletions

View File

@ -10,12 +10,14 @@ import (
exchange "github.com/jbenet/go-ipfs/exchange"
tn "github.com/jbenet/go-ipfs/exchange/bitswap/testnet"
peer "github.com/jbenet/go-ipfs/p2p/peer"
p2ptestutil "github.com/jbenet/go-ipfs/p2p/test/util"
datastore2 "github.com/jbenet/go-ipfs/util/datastore2"
delay "github.com/jbenet/go-ipfs/util/delay"
testutil "github.com/jbenet/go-ipfs/util/testutil"
)
func NewSessionGenerator(
// WARNING: this uses RandTestBogusIdentity DO NOT USE for NON TESTS!
func NewTestSessionGenerator(
net tn.Network) SessionGenerator {
ctx, cancel := context.WithCancel(context.TODO())
return SessionGenerator{
@ -41,7 +43,7 @@ func (g *SessionGenerator) Close() error {
func (g *SessionGenerator) Next() Instance {
g.seq++
p, err := testutil.RandIdentity()
p, err := p2ptestutil.RandTestBogusIdentity()
if err != nil {
panic("FIXME") // TODO change signature
}