(node, user, method)
| 16 | import urllib.parse |
| 17 | |
| 18 | def rpccall(node, user, method): |
| 19 | url = urllib.parse.urlparse(node.url) |
| 20 | headers = {"Authorization": "Basic " + str_to_b64str('{}:{}'.format(user[0], user[3]))} |
| 21 | conn = http.client.HTTPConnection(url.hostname, url.port) |
| 22 | conn.connect() |
| 23 | conn.request('POST', '/', '{"method": "' + method + '"}', headers) |
| 24 | resp = conn.getresponse() |
| 25 | conn.close() |
| 26 | return resp |
| 27 | |
| 28 | |
| 29 | class RPCWhitelistTest(BitcoinTestFramework): |