Skip to content

Commit

Permalink
tests: fix to work with bitcoind master branch.
Browse files Browse the repository at this point in the history
E               ConnectionRefusedError: [Errno 111] Connection refused

And in debug.log:

2018-05-17T04:06:35Z Warning: Config setting for -rpcport only applied on regtest network when in [regtest] section.

We don't fix this message though:

2018-05-17T04:06:35Z Config options rpcuser and rpcpassword will soon be deprecated. Locally-run instances may remove rpcuser to use cookie-based auth, or may be replaced with rpcauth. Please see share/rpcuser for rpcauth auth generation.

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell authored and Jan Sarenik committed Jun 11, 2018
1 parent 56046d4 commit 4773176
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ def wait_for(success, timeout=TIMEOUT, interval=0.1):
raise ValueError("Error waiting for {}", success)


def write_config(filename, opts):
def write_config(filename, opts, section=None):
with open(filename, 'w') as f:
if section:
f.write("{}\n".format(section))
for k, v in opts.items():
f.write("{}={}\n".format(k, v))

Expand Down Expand Up @@ -241,7 +243,8 @@ def __init__(self, bitcoin_dir="/tmp/bitcoind-test", rpcport=None):
]
BITCOIND_CONFIG['rpcport'] = rpcport
btc_conf_file = os.path.join(regtestdir, 'bitcoin.conf')
write_config(os.path.join(bitcoin_dir, 'bitcoin.conf'), BITCOIND_CONFIG)
write_config(os.path.join(bitcoin_dir, 'bitcoin.conf'), BITCOIND_CONFIG,
'[regtest]')
write_config(btc_conf_file, BITCOIND_CONFIG)
self.rpc = SimpleBitcoinProxy(btc_conf_file=btc_conf_file)

Expand Down

0 comments on commit 4773176

Please sign in to comment.