Skip to content

Commit 0ff4375

Browse files
committed
[qa]: add parsing for '<host>:<port>' argument form to rpc_url()
1 parent 0df9ea4 commit 0ff4375

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

qa/rpc-tests/test_framework/util.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,15 @@ def rpc_auth_pair(n):
171171

172172
def rpc_url(i, rpchost=None):
173173
rpc_u, rpc_p = rpc_auth_pair(i)
174-
return "http://%s:%s@%s:%d" % (rpc_u, rpc_p, rpchost or '127.0.0.1', rpc_port(i))
174+
host = '127.0.0.1'
175+
port = rpc_port(i)
176+
if rpchost:
177+
parts = rpchost.split(':')
178+
if len(parts) == 2:
179+
host, port = parts
180+
else:
181+
host = rpchost
182+
return "http://%s:%s@%s:%d" % (rpc_u, rpc_p, host, int(port))
175183

176184
def wait_for_bitcoind_start(process, url, i):
177185
'''

0 commit comments

Comments
 (0)