tests: prepare for bitcoind 0.16.

I noticed some breakage with git master:
1. getinfo no longer supported (for us, use getblockchaininfo)
2. generate no longer supported (use generatetoaddress)

Both these options are supported at least in 0.15, too.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2017-11-28 15:09:22 +10:30
committed by Christian Decker
parent f4a71f9806
commit cfde208e82
3 changed files with 83 additions and 79 deletions

View File

@@ -29,10 +29,10 @@ def bitcoind():
# Make sure we have segwit and some funds
if info['blocks'] < 432:
logging.debug("SegWit not active, generating some more blocks")
bitcoind.rpc.generate(432 - info['blocks'])
bitcoind.generate_block(432 - info['blocks'])
elif info['balance'] < 1:
logging.debug("Insufficient balance, generating 1 block")
bitcoind.rpc.generate(1)
bitcoind.generate_block(1)
yield bitcoind