From 1948062250aecc510debf012856043372d7c0205 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Sat, 21 Jan 2017 14:10:55 +0100 Subject: [PATCH] pytest: Using python-bitcoinlib instead of python-bitcoinrpc The latter is unmaintained and has a number of problems. --- tests/requirements.txt | 2 +- tests/utils.py | 15 ++------------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/tests/requirements.txt b/tests/requirements.txt index 115c99979..5928dec47 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1 +1 @@ -python-bitcoinrpc==1.0 +python-bitcoinlib==0.7.0 diff --git a/tests/utils.py b/tests/utils.py index b0fdbd8b0..3cad8d277 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -1,4 +1,4 @@ -from bitcoinrpc.authproxy import AuthServiceProxy +from bitcoin.rpc import RawProxy as BitcoinProxy from lightning import LightningRpc import logging @@ -108,17 +108,6 @@ class TailableProc(object): pos += 1 -class ThreadSafeAuthServiceProxy(AuthServiceProxy): - """Thread-safe variant of the AuthServiceProxy. - """ - - lock = threading.RLock() - - def __call__(self, *args): - with ThreadSafeAuthServiceProxy.lock: - AuthServiceProxy.__call__(self, *args) - - class BitcoinD(TailableProc): def __init__(self, bitcoin_dir="/tmp/bitcoind-test", rpcport=18332): @@ -145,7 +134,7 @@ class BitcoinD(TailableProc): BITCOIND_CONFIG['rpcport'] = rpcport write_config(os.path.join(bitcoin_dir, 'bitcoin.conf'), BITCOIND_CONFIG) write_config(os.path.join(regtestdir, 'bitcoin.conf'), BITCOIND_CONFIG) - self.rpc = ThreadSafeAuthServiceProxy( + self.rpc = BitcoinProxy( "http://rpcuser:rpcpass@127.0.0.1:{}".format(self.rpcport)) def start(self):