swarm/network: Make stream package pass tests

This commit is contained in:
lash 2019-03-13 08:58:47 +01:00
parent 52995f7117
commit ece9df034b

View file

@ -30,6 +30,7 @@ import (
"sync/atomic"
"time"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/p2p/enode"
"github.com/ethereum/go-ethereum/p2p/simulations/adapters"
@ -183,7 +184,13 @@ func newStreamerTester(registryOptions *RegistryOptions) (*p2ptest.ProtocolTeste
streamer.Close()
removeDataDir()
}
protocolTester := p2ptest.NewProtocolTester(addr.ID(), 1, streamer.runProtocol)
prvkey, err := crypto.GenerateKey()
if err != nil {
removeDataDir()
return nil, nil, nil, nil, err
}
protocolTester := p2ptest.NewProtocolTester(prvkey, 1, streamer.runProtocol)
err = waitForPeers(streamer, 10*time.Second, 1)
if err != nil {