pytest: make it work with latest bitcoind master branch.

They seem to have changed the JSON output.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2021-04-18 14:08:22 +09:30
parent f97a51cc0f
commit b352df4179
5 changed files with 28 additions and 18 deletions

View File

@@ -143,3 +143,12 @@ def basic_fee(feerate):
else:
weight = 724
return (weight * feerate) // 1000
def scriptpubkey_addr(scriptpubkey):
if 'addresses' in scriptpubkey:
return scriptpubkey['addresses'][0]
elif 'address' in scriptpubkey:
# Modern bitcoin (at least, git master)
return scriptpubkey['address']
return None