mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-23 09:04:22 +01:00
newaddr: support getting both bech32 and p2sh addresses.
Higher layers consume less addresses this way. Fixes: #2390 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
5518c7cba8
commit
3e67c09d5e
@@ -1232,3 +1232,16 @@ def test_bad_onion(node_factory, bitcoind):
|
||||
assert err.value.error['data']['failcode'] == WIRE_INVALID_ONION_HMAC
|
||||
assert err.value.error['data']['erring_node'] == mangled_nodeid
|
||||
assert err.value.error['data']['erring_channel'] == route[1]['channel']
|
||||
|
||||
|
||||
def test_newaddr(node_factory):
|
||||
l1 = node_factory.get_node()
|
||||
p2sh = l1.rpc.newaddr('p2sh-segwit')
|
||||
assert 'bech32' not in p2sh
|
||||
assert p2sh['p2sh-segwit'].startswith('2')
|
||||
bech32 = l1.rpc.newaddr('bech32')
|
||||
assert 'p2sh-segwit' not in bech32
|
||||
assert bech32['bech32'].startswith('bcrt1')
|
||||
both = l1.rpc.newaddr('all')
|
||||
assert both['p2sh-segwit'].startswith('2')
|
||||
assert both['bech32'].startswith('bcrt1')
|
||||
|
||||
Reference in New Issue
Block a user