e2e: fix light client generator (#6236)

This commit is contained in:
Callum Waters
2021-03-15 13:04:33 +01:00
committed by GitHub
parent 6ffdf181f2
commit fa781e6bb7
3 changed files with 41 additions and 25 deletions
+7 -1
View File
@@ -349,7 +349,13 @@ func rpcEndpoints(peers string) []string {
}
// use RPC port instead
addr.Port = 26657
rpcEndpoint := "http://" + addr.Hostname + ":" + fmt.Sprint(addr.Port)
var rpcEndpoint string
// for ipv6 addresses
if strings.Contains(addr.Hostname, ":") {
rpcEndpoint = "http://[" + addr.Hostname + "]:" + fmt.Sprint(addr.Port)
} else { // for ipv4 addresses
rpcEndpoint = "http://" + addr.Hostname + ":" + fmt.Sprint(addr.Port)
}
endpoints[i] = rpcEndpoint
}
return endpoints