Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contrib/msggen/msggen/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -27137,7 +27137,7 @@
"description": [
"It specifies the type of address wanted; currently *bech32* (e.g. `tb1qu9j4lg5f9rgjyfhvfd905vw46eg39czmktxqgg` on bitcoin testnet or `bc1qwqdg6squsna38e46795at95yu9atm8azzmyvckulcc7kytlcckxswvvzej` on bitcoin mainnet), or *p2tr* taproot addresses. The special value *all* generates all known address types for the same underlying key."
],
"default": "*bech32* address",
"default": "*p2tr* address",
"enum": [
"bech32",
"p2tr",
Expand Down
4 changes: 2 additions & 2 deletions contrib/pyln-testing/pyln/testing/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1106,7 +1106,7 @@ def restart(self, timeout=10, clean=True):
def fundchannel(self, l2, amount=FUNDAMOUNT, wait_for_active=True,
announce_channel=True, **kwargs):
# Give yourself some funds to work with
addr = self.rpc.newaddr()['bech32']
addr = self.rpc.newaddr('bech32')['bech32']

def has_funds_on_addr(addr):
"""Check if the given address has funds in the internal wallet.
Expand Down Expand Up @@ -1737,7 +1737,7 @@ def join_nodes(self, nodes, fundchannel=True, fundamount=FUNDAMOUNT, wait_for_an
bitcoind = nodes[0].bitcoin
# If we got here, we want to fund channels
for src, dst in connections:
addr = src.rpc.newaddr()['bech32']
addr = src.rpc.newaddr('bech32')['bech32']
bitcoind.rpc.sendtoaddress(addr, (fundamount + 1000000) / 10**8)

bitcoind.generate_block(1)
Expand Down
3 changes: 2 additions & 1 deletion doc/developers-guide/deprecated-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ hidden: false
| channel_state_changed.null_scid | Notification Field | v25.09 | v26.09 | In channel_state_changed notification, `short_channel_id` will be missing instead of `null` |
| notification.payload | Notification Field | v25.09 | v26.09 | Notifications from plugins used to have fields in `payload` sub-object, now they are not (just like normal notifications) |
| pay_notifications.raw_fields | Field | v25.09 | v26.09 | `channel_hint_update`, `pay_failure` and `pay_success` notifications now wrap members in an object of the same name |
| encrypted_hsm | Config | v25.12 | v26.12 | `hsm-passphrase` is a name which also makes sense for modern hsm_secrets which use BIP 39 |
| encrypted_hsm | Config | v25.12 | v26.12 | `hsm-passphrase` is a name which also makes sense for modern hsm_secrets which use BIP 39 |
| newaddr.addresstype.defaultbech32 | Parameter | v25.12 | v26.12 | Use `p2tr` in the response (present since v23.08 if `addresstype` is `p2tr`, and always present since v24.12). |

Inevitably there are features which need to change: either to be generalized, or removed when they can no longer be supported.

Expand Down
2 changes: 1 addition & 1 deletion doc/schemas/newaddr.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"description": [
"It specifies the type of address wanted; currently *bech32* (e.g. `tb1qu9j4lg5f9rgjyfhvfd905vw46eg39czmktxqgg` on bitcoin testnet or `bc1qwqdg6squsna38e46795at95yu9atm8azzmyvckulcc7kytlcckxswvvzej` on bitcoin mainnet), or *p2tr* taproot addresses. The special value *all* generates all known address types for the same underlying key."
],
"default": "*bech32* address",
"default": "*p2tr* address",
"enum": [
"bech32",
"p2tr",
Expand Down
4 changes: 2 additions & 2 deletions tests/autogenerate-rpc-examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -1205,8 +1205,8 @@ def generate_utils_examples(l1, l2, l3, l4, l5, l6, c23_2, c34_2, inv_l11, inv_l
example_utxos = ['utxo' + ('02' * 30) + ':1']
withdraw_l22 = update_example(node=l2, method='withdraw', params={'destination': address_l22['p2tr'], 'satoshi': 'all', 'feerate': '20000perkb', 'minconf': 0, 'utxos': utxos})
bitcoind.generate_block(4, wait_for_mempool=[withdraw_l22['txid']])
multiwithdraw_res1 = update_example(node=l2, method='multiwithdraw', params={'outputs': [{l1.rpc.newaddr()['bech32']: '2222000msat'}, {l1.rpc.newaddr()['bech32']: '3333000msat'}]})
multiwithdraw_res2 = update_example(node=l2, method='multiwithdraw', params={'outputs': [{l1.rpc.newaddr('p2tr')['p2tr']: 1000}, {l1.rpc.newaddr()['bech32']: 1000}, {l2.rpc.newaddr()['bech32']: 1000}, {l3.rpc.newaddr()['bech32']: 1000}, {l3.rpc.newaddr()['bech32']: 1000}, {l4.rpc.newaddr('p2tr')['p2tr']: 1000}, {l1.rpc.newaddr()['bech32']: 1000}]})
multiwithdraw_res1 = update_example(node=l2, method='multiwithdraw', params={'outputs': [{l1.rpc.newaddr('bech32')['bech32']: '2222000msat'}, {l1.rpc.newaddr('bech32')['bech32']: '3333000msat'}]})
multiwithdraw_res2 = update_example(node=l2, method='multiwithdraw', params={'outputs': [{l1.rpc.newaddr('p2tr')['p2tr']: 1000}, {l1.rpc.newaddr('bech32')['bech32']: 1000}, {l2.rpc.newaddr()['bech32']: 1000}, {l3.rpc.newaddr()['bech32']: 1000}, {l3.rpc.newaddr()['bech32']: 1000}, {l4.rpc.newaddr('p2tr')['p2tr']: 1000}, {l1.rpc.newaddr('bech32')['bech32']: 1000}]})
l2.rpc.connect(l4.info['id'], 'localhost', l4.port)
l2.rpc.connect(l5.info['id'], 'localhost', l5.port)
update_example(node=l2, method='disconnect', params={'id': l4.info['id'], 'force': False})
Expand Down
6 changes: 3 additions & 3 deletions tests/test_bookkeeper.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def test_bookkeeping_external_withdraws(node_factory, bitcoind):
""" Withdrawals to an external address shouldn't be included
in the income statements until confirmed"""
l1 = node_factory.get_node()
addr = l1.rpc.newaddr()['bech32']
addr = l1.rpc.newaddr()['p2tr']

amount = 1111111
amount_msat = Millisatoshi(amount * 1000)
Expand Down Expand Up @@ -210,7 +210,7 @@ def test_bookkeeping_rbf_withdraw(node_factory, bitcoind):
(but it will show up in our account events)
"""
l1 = node_factory.get_node()
addr = l1.rpc.newaddr()['bech32']
addr = l1.rpc.newaddr()['p2tr']

amount = 1111111
event_counter = 0
Expand Down Expand Up @@ -1167,7 +1167,7 @@ def test_migration_no_bkpr(node_factory, bitcoind):
@unittest.skipIf(TEST_NETWORK != 'regtest', "External wallet support doesn't work with elements yet.")
def test_listincome_timebox(node_factory, bitcoind):
l1 = node_factory.get_node()
addr = l1.rpc.newaddr()['bech32']
addr = l1.rpc.newaddr()['p2tr']

amount = 1111111
bitcoind.rpc.sendtoaddress(addr, amount / 10**8)
Expand Down
24 changes: 12 additions & 12 deletions tests/test_closing.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def test_closing_different_fees(node_factory, bitcoind, executor):
balance = [False, True]
num_peers = len(feerates) * len(balance)

addr = l1.rpc.newaddr()['bech32']
addr = l1.rpc.newaddr()['p2tr']
bitcoind.rpc.sendtoaddress(addr, 1)
numfunds = len(l1.rpc.listfunds()['outputs'])
bitcoind.generate_block(1)
Expand Down Expand Up @@ -1014,17 +1014,17 @@ def test_channel_lease_unilat_closes(node_factory, bitcoind):

# we *shouldn't* be able to spend it, there's a lock on it
with pytest.raises(RpcError, match='UTXO .* is csv locked'):
l2.rpc.withdraw(l2.rpc.newaddr()['bech32'], "all", utxos=[utxo1])
l2.rpc.withdraw(l2.rpc.newaddr()['p2tr'], "all", utxos=[utxo1])

# we *can* spend the 1csv lock one
l2.rpc.withdraw(l2.rpc.newaddr()['bech32'], "all", utxos=[utxo3])
l2.rpc.withdraw(l2.rpc.newaddr()['p2tr'], "all", utxos=[utxo3])

# This can timeout, so do it in easy stages.
for i in range(16):
bitcoind.generate_block(4032 // 16)
sync_blockheight(bitcoind, [l2, l3])

l2.rpc.withdraw(l2.rpc.newaddr()['bech32'], "all", utxos=[utxo1])
l2.rpc.withdraw(l2.rpc.newaddr()['p2tr'], "all", utxos=[utxo1])

# We actually mined this many blocks already, so we should see this message:
l3.daemon.wait_for_log('waiting confirmation that we spent DELAYED_OUTPUT_TO_US .* using OUR_DELAYED_RETURN_TO_WALLET')
Expand Down Expand Up @@ -1803,7 +1803,7 @@ def test_onchain_unwatch(node_factory, bitcoind, chainparams):

# Now test unrelated onchain churn.
# Daemon gets told about wallet; says it doesn't care.
l1.rpc.withdraw(l1.rpc.newaddr()['bech32'], 'all')
l1.rpc.withdraw(l1.rpc.newaddr('bech32')['bech32'], 'all')
bitcoind.generate_block(1)

l1.daemon.wait_for_log("but we don't care")
Expand All @@ -1813,7 +1813,7 @@ def test_onchain_unwatch(node_factory, bitcoind, chainparams):

# So these should not generate further messages
for i in range(5):
l1.rpc.withdraw(l1.rpc.newaddr()['bech32'], 'all')
l1.rpc.withdraw(l1.rpc.newaddr('bech32')['bech32'], 'all')
bitcoind.generate_block(1)
# Make sure it digests the block
sync_blockheight(bitcoind, [l1])
Expand Down Expand Up @@ -3366,7 +3366,7 @@ def test_segwit_shutdown_script(node_factory, bitcoind, executor):
# Give it one UTXO to spend for each node.
addresses = {}
for n in nodes:
addresses[l1.rpc.newaddr()['bech32']] = (10**6 + 100000) / 10**8
addresses[l1.rpc.newaddr('bech32')['bech32']] = (10**6 + 100000) / 10**8
bitcoind.rpc.sendmany("", addresses)
bitcoind.generate_block(1)
wait_for(lambda: len(l1.rpc.listfunds()['outputs']) == len(addresses))
Expand Down Expand Up @@ -3787,7 +3787,7 @@ def test_closing_anchorspend_htlc_tx_rbf(node_factory, bitcoind):
fundsats = int(Millisatoshi(only_one(l1.rpc.listfunds()['outputs'])['amount_msat']).to_satoshi())
psbt = l1.rpc.fundpsbt("all", "1000perkw", 1000)['psbt']
# Pay 5k sats in fees, send most to l2
psbt = l1.rpc.addpsbtoutput(fundsats - 24000 - 5000, psbt, destination=l2.rpc.newaddr()['bech32'])['psbt']
psbt = l1.rpc.addpsbtoutput(fundsats - 24000 - 5000, psbt, destination=l2.rpc.newaddr()['p2tr'])['psbt']
# 12x2000 sat outputs for l1 to use.
for i in range(12):
psbt = l1.rpc.addpsbtoutput(2000, psbt)['psbt']
Expand Down Expand Up @@ -4005,7 +4005,7 @@ def test_peer_anchor_push(node_factory, bitcoind, executor, chainparams):
NUM_OUTPUTS = 10
psbt = l2.rpc.fundpsbt("all", "1000perkw", 1000)['psbt']
# Pay 5k sats in fees.
psbt = l2.rpc.addpsbtoutput(fundsats - OUTPUT_SAT * NUM_OUTPUTS - 5000, psbt, destination=l3.rpc.newaddr()['bech32'])['psbt']
psbt = l2.rpc.addpsbtoutput(fundsats - OUTPUT_SAT * NUM_OUTPUTS - 5000, psbt, destination=l3.rpc.newaddr()['p2tr'])['psbt']
for _ in range(NUM_OUTPUTS):
psbt = l2.rpc.addpsbtoutput(OUTPUT_SAT, psbt)['psbt']
l2.rpc.sendpsbt(l2.rpc.signpsbt(psbt)['signed_psbt'])
Expand Down Expand Up @@ -4090,12 +4090,12 @@ def test_closing_cpfp(node_factory, bitcoind):

l1out = only_one([o for o in l1.rpc.listfunds()['outputs'] if o != change])
assert l1out['txid'] == close_txid
l1.rpc.withdraw(l1.rpc.newaddr()['bech32'], 'all', '20000perkb', minconf=0, utxos=["{}:{}".format(l1out['txid'], l1out['output'])])
l1.rpc.withdraw(l1.rpc.newaddr('bech32')['bech32'], 'all', '20000perkb', minconf=0, utxos=["{}:{}".format(l1out['txid'], l1out['output'])])

# l2 should be able to do this too!
l2out = only_one(l2.rpc.listfunds()['outputs'])
assert l2out['txid'] == close_txid
l2.rpc.withdraw(l2.rpc.newaddr()['bech32'], 'all', '20000perkb', minconf=0, utxos=["{}:{}".format(l2out['txid'], l2out['output'])])
l2.rpc.withdraw(l2.rpc.newaddr('bech32')['bech32'], 'all', '20000perkb', minconf=0, utxos=["{}:{}".format(l2out['txid'], l2out['output'])])

# There should be *three* transactions in mempool now!
bitcoind.generate_block(1, wait_for_mempool=3)
Expand Down Expand Up @@ -4148,7 +4148,7 @@ def test_closing_no_anysegwit_retry(node_factory, bitcoind):
with pytest.raises(RpcError, match=r'Peer does not allow v1\+ shutdown addresses'):
l1.rpc.close(l2.info['id'], destination='bcrt1pw508d6qejxtdg4y5r3zarvary0c5xw7kw508d6qejxtdg4y5r3zarvary0c5xw7k0ylj56')

oldaddr = l1.rpc.newaddr()['bech32']
oldaddr = l1.rpc.newaddr('bech32')['bech32']
l1.rpc.close(l2.info['id'], destination=oldaddr)


Expand Down
8 changes: 4 additions & 4 deletions tests/test_coinmoves.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def test_coinmoves(node_factory, bitcoind):
check_chain_moves(l2, expected_chain2)

# MVT_DEPOSIT
addr = l1.rpc.newaddr()['bech32']
addr = l1.rpc.newaddr('bech32')['bech32']
txid_deposit = bitcoind.rpc.sendtoaddress(addr, 200000000 / 10**8)
bitcoind.generate_block(1, wait_for_mempool=1)
sync_blockheight(bitcoind, [l1])
Expand All @@ -140,7 +140,7 @@ def test_coinmoves(node_factory, bitcoind):
first_rowid = only_one(only_one(l1.rpc.sql("SELECT rowid FROM chainmoves;")['rows']))

# MVT_WITHDRAWAL
addr = l3.rpc.newaddr()['bech32']
addr = l3.rpc.newaddr('bech32')['bech32']
withdraw = l1.rpc.withdraw(addr, 100000000)
bitcoind.generate_block(1, wait_for_mempool=1)
sync_blockheight(bitcoind, [l1])
Expand Down Expand Up @@ -395,7 +395,7 @@ def setup_channel(bitcoind, l1, l2):
expected_chain1 = []
expected_chain2 = []

addr = l1.rpc.newaddr()['bech32']
addr = l1.rpc.newaddr('bech32')['bech32']
txid_deposit = bitcoind.rpc.sendtoaddress(addr, 100000000 / 10**8)
bitcoind.generate_block(1, wait_for_mempool=1)
sync_blockheight(bitcoind, [l1])
Expand Down Expand Up @@ -1916,7 +1916,7 @@ def test_wait(node_factory, bitcoind, executor):

fut = executor.submit(l1.rpc.wait, subsystem='chainmoves', indexname='created', nextvalue=1)

addr = l1.rpc.newaddr()['bech32']
addr = l1.rpc.newaddr('bech32')['bech32']
bitcoind.rpc.sendtoaddress(addr, 200000000 / 10**8)
bitcoind.generate_block(1, wait_for_mempool=1)

Expand Down
Loading
Loading