mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
newaddr: fix return value for deprecated "address" field.
It would always return bech32; fix that, and don't bother printing
it if they use the (new) 'all' parameter.
This API was introduced in 3e67c09d5e,
which means it wasn't in a release so no CHANGELOG entry necessary.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
neil saitug
parent
e902d9af56
commit
ba036b767f
@@ -1402,6 +1402,14 @@ def test_newaddr(node_factory):
|
||||
assert both['bech32'].startswith('bcrt1')
|
||||
|
||||
|
||||
def test_newaddr_deprecated(node_factory):
|
||||
l1 = node_factory.get_node(options={'allow-deprecated-apis': True})
|
||||
p2sh = l1.rpc.newaddr('p2sh-segwit')
|
||||
assert p2sh['address'].startswith('2')
|
||||
bech32 = l1.rpc.newaddr('bech32')
|
||||
assert bech32['address'].startswith('bcrt1')
|
||||
|
||||
|
||||
def test_bitcoind_fail_first(node_factory, bitcoind, executor):
|
||||
"""Make sure we handle spurious bitcoin-cli failures during startup
|
||||
|
||||
|
||||
Reference in New Issue
Block a user