p2p/simulations, swarm/network: Make exec disc test pass

This commit is contained in:
lash 2019-03-21 11:13:37 +01:00
parent 5edbf3ce74
commit d8b4e7acde
2 changed files with 6 additions and 7 deletions

View file

@ -411,14 +411,13 @@ func startExecNodeStack() (*node.Node, error) {
if err := json.Unmarshal([]byte(confEnv), &conf); err != nil {
return nil, fmt.Errorf("error decoding %s: %v", envNodeConfig, err)
}
// TODO verify that ListenAddr will contain the correct tcp addr
// if we should start using exec adapters with other host than local
// create enode record
nodeTcpConn, err := net.ResolveTCPAddr("tcp", conf.Stack.P2P.ListenAddr)
if err != nil {
conf.Node.initDummyEnode()
} else {
conf.Node.initEnode(nodeTcpConn.IP, nodeTcpConn.Port, nodeTcpConn.Port)
if nodeTcpConn.IP == nil {
nodeTcpConn.IP = net.IPv4(127, 0, 0, 1)
}
conf.Node.initEnode(nodeTcpConn.IP, nodeTcpConn.Port, nodeTcpConn.Port)
conf.Stack.P2P.PrivateKey = conf.Node.PrivateKey
conf.Stack.Logger = log.New("node.id", conf.Node.ID.String())

View file

@ -131,7 +131,7 @@ func BenchmarkDiscovery_128_4(b *testing.B) { benchmarkDiscovery(b, 128, 4) }
func BenchmarkDiscovery_256_4(b *testing.B) { benchmarkDiscovery(b, 256, 4) }
func TestDiscoverySimulationExecAdapter(t *testing.T) {
t.Skip("This is left broken pending ENR preparations for swarm binary. Execadapter is not currently in use, so a short pause won't hurt")
//t.Skip("This is left broken pending ENR preparations for swarm binary. Execadapter is not currently in use, so a short pause won't hurt")
testDiscoverySimulationExecAdapter(t, *nodeCount, *initCount)
}