@@ -436,7 +436,7 @@ def test_channel_abandon(node_factory, bitcoind):
436436
437437 # Now it's unreserved, we can doublespend it (as long as we exceed
438438 # previous fee to RBF!).
439- withdraw = l1 .rpc .withdraw (l1 .rpc .newaddr ()['bech32' ], "all" )
439+ withdraw = l1 .rpc .withdraw (l1 .rpc .newaddr ('bech32' )['bech32' ], "all" )
440440
441441 assert bitcoind .rpc .decoderawtransaction (withdraw ['tx' ])['vout' ][0 ]['value' ] > SATS / 10 ** 8
442442 bitcoind .generate_block (1 , wait_for_mempool = withdraw ['txid' ])
@@ -1108,7 +1108,7 @@ def test_funding_fail(node_factory, bitcoind):
11081108
11091109 funds = 1000000
11101110
1111- addr = l1 .rpc .newaddr ()['bech32' ]
1111+ addr = l1 .rpc .newaddr ('bech32' )['bech32' ]
11121112 l1 .bitcoin .rpc .sendtoaddress (addr , funds / 10 ** 8 )
11131113 bitcoind .generate_block (1 )
11141114
@@ -1150,7 +1150,7 @@ def test_funding_toolarge(node_factory, bitcoind):
11501150
11511151 # Send funds.
11521152 amount = 2 ** 24
1153- bitcoind .rpc .sendtoaddress (l1 .rpc .newaddr ()['bech32' ], amount / 10 ** 8 + 0.01 )
1153+ bitcoind .rpc .sendtoaddress (l1 .rpc .newaddr ('bech32' )['bech32' ], amount / 10 ** 8 + 0.01 )
11541154 bitcoind .generate_block (1 )
11551155
11561156 # Wait for it to arrive.
@@ -1172,7 +1172,7 @@ def test_v2_open(node_factory, bitcoind, chainparams):
11721172
11731173 l1 .rpc .connect (l2 .info ['id' ], 'localhost' , l2 .port )
11741174 amount = 2 ** 24
1175- bitcoind .rpc .sendtoaddress (l1 .rpc .newaddr ()['bech32' ], amount / 10 ** 8 + 0.01 )
1175+ bitcoind .rpc .sendtoaddress (l1 .rpc .newaddr ('bech32' )['bech32' ], amount / 10 ** 8 + 0.01 )
11761176 bitcoind .generate_block (1 )
11771177 # Wait for it to arrive.
11781178 wait_for (lambda : len (l1 .rpc .listfunds ()['outputs' ]) > 0 )
@@ -1204,7 +1204,7 @@ def test_funding_push(node_factory, bitcoind, chainparams):
12041204 # Send funds.
12051205 amount = 2 ** 24
12061206 push_msat = 20000 * 1000
1207- bitcoind .rpc .sendtoaddress (l1 .rpc .newaddr ()['bech32' ], amount / 10 ** 8 + 0.01 )
1207+ bitcoind .rpc .sendtoaddress (l1 .rpc .newaddr ('bech32' )['bech32' ], amount / 10 ** 8 + 0.01 )
12081208 bitcoind .generate_block (1 )
12091209
12101210 # Wait for it to arrive.
@@ -1289,7 +1289,7 @@ def test_funding_external_wallet_corners(node_factory, bitcoind):
12891289 l1 .fundwallet (amount + 10000000 )
12901290
12911291 # make sure we can generate PSBTs.
1292- addr = l1 .rpc .newaddr ()['bech32' ]
1292+ addr = l1 .rpc .newaddr ('bech32' )['bech32' ]
12931293 bitcoind .rpc .sendtoaddress (addr , (amount + 1000000 ) / 10 ** 8 )
12941294 bitcoind .generate_block (1 )
12951295 wait_for (lambda : len (l1 .rpc .listfunds ()["outputs" ]) != 0 )
@@ -1320,7 +1320,7 @@ def test_funding_external_wallet_corners(node_factory, bitcoind):
13201320 l1 .rpc .txdiscard (wrongamt ['txid' ])
13211321
13221322 # Can't complete with incorrect address.
1323- wrongaddr = l1 .rpc .txprepare ([{l1 .rpc .newaddr ()['bech32' ]: amount }])
1323+ wrongaddr = l1 .rpc .txprepare ([{l1 .rpc .newaddr ('bech32' )['bech32' ]: amount }])
13241324 with pytest .raises (RpcError , match = r'No output to open channel' ):
13251325 l1 .rpc .fundchannel_complete (l2 .info ['id' ], wrongaddr ['psbt' ])
13261326 l1 .rpc .txdiscard (wrongaddr ['txid' ])
@@ -1406,7 +1406,7 @@ def test_funding_v2_corners(node_factory, bitcoind):
14061406 l1 .fundwallet (amount + 10000000 )
14071407
14081408 # make sure we can generate PSBTs.
1409- addr = l1 .rpc .newaddr ()['bech32' ]
1409+ addr = l1 .rpc .newaddr ('bech32' )['bech32' ]
14101410 bitcoind .rpc .sendtoaddress (addr , (amount + 1000000 ) / 10 ** 8 )
14111411 bitcoind .generate_block (1 )
14121412 wait_for (lambda : len (l1 .rpc .listfunds ()["outputs" ]) != 0 )
@@ -1469,7 +1469,7 @@ def test_funding_cancel_race(node_factory, bitcoind, executor):
14691469 l1 = node_factory .get_node ()
14701470
14711471 # make sure we can generate PSBTs.
1472- addr = l1 .rpc .newaddr ()['bech32' ]
1472+ addr = l1 .rpc .newaddr ('bech32' )['bech32' ]
14731473 bitcoind .rpc .sendtoaddress (addr , 200000 / 10 ** 8 )
14741474 bitcoind .generate_block (1 )
14751475 wait_for (lambda : len (l1 .rpc .listfunds ()["outputs" ]) != 0 )
@@ -1550,7 +1550,7 @@ def test_funding_v2_cancel_race(node_factory, bitcoind, executor):
15501550 l1 = node_factory .get_node ()
15511551
15521552 # make sure we can generate PSBTs.
1553- addr = l1 .rpc .newaddr ()['bech32' ]
1553+ addr = l1 .rpc .newaddr ('bech32' )['bech32' ]
15541554 bitcoind .rpc .sendtoaddress (addr , 2000000 / 10 ** 8 )
15551555 bitcoind .generate_block (1 )
15561556 wait_for (lambda : len (l1 .rpc .listfunds ()["outputs" ]) != 0 )
@@ -1680,7 +1680,7 @@ def _close(src, dst, addr=None):
16801680 _close (l1 , l2 )
16811681
16821682 # check that you can provide a closing address upfront
1683- addr = l1 .rpc .newaddr ()['bech32' ]
1683+ addr = l1 .rpc .newaddr ('bech32' )['bech32' ]
16841684 _fundchannel (l1 , l2 , amt_normal , addr )
16851685 # confirm that it appears in listpeerchannels
16861686 assert addr == l1 .rpc .listpeerchannels ()['channels' ][1 ]['close_to_addr' ]
@@ -1701,7 +1701,7 @@ def _close(src, dst, addr=None):
17011701 assert _close (l2 , l1 ) in ([addr , remote_valid_addr ], [remote_valid_addr , addr ])
17021702
17031703 # check that passing in a different addr to close causes an RPC error
1704- addr2 = l1 .rpc .newaddr ()['bech32' ]
1704+ addr2 = l1 .rpc .newaddr ('bech32' )['bech32' ]
17051705 _fundchannel (l1 , l2 , amt_normal , addr )
17061706 with pytest .raises (RpcError , match = r'does not match previous shutdown script' ):
17071707 l1 .rpc .close (l2 .info ['id' ], destination = addr2 )
@@ -2249,7 +2249,7 @@ def test_lockin_between_restart(node_factory, bitcoind):
22492249@pytest .mark .openchannel ('v2' )
22502250def test_funding_while_offline (node_factory , bitcoind ):
22512251 l1 = node_factory .get_node ()
2252- addr = l1 .rpc .newaddr ()['bech32' ]
2252+ addr = l1 .rpc .newaddr ('bech32' )['bech32' ]
22532253 sync_blockheight (bitcoind , [l1 ])
22542254
22552255 # l1 goes down.
@@ -2889,17 +2889,17 @@ def test_no_fee_estimate(node_factory, bitcoind, executor):
28892889
28902890 # Can't withdraw either.
28912891 with pytest .raises (RpcError , match = r'Cannot estimate fees' ):
2892- l1 .rpc .withdraw (l2 .rpc .newaddr ()['bech32' ], 'all' )
2892+ l1 .rpc .withdraw (l2 .rpc .newaddr ('bech32' )['bech32' ], 'all' )
28932893
28942894 # Can't use feerate names, either.
28952895 with pytest .raises (RpcError , match = r'Cannot estimate fees' ):
2896- l1 .rpc .withdraw (l2 .rpc .newaddr ()['bech32' ], 'all' , 'urgent' )
2896+ l1 .rpc .withdraw (l2 .rpc .newaddr ('bech32' )['bech32' ], 'all' , 'urgent' )
28972897
28982898 with pytest .raises (RpcError , match = r'Cannot estimate fees' ):
2899- l1 .rpc .withdraw (l2 .rpc .newaddr ()['bech32' ], 'all' , 'normal' )
2899+ l1 .rpc .withdraw (l2 .rpc .newaddr ('bech32' )['bech32' ], 'all' , 'normal' )
29002900
29012901 with pytest .raises (RpcError , match = r'Cannot estimate fees' ):
2902- l1 .rpc .withdraw (l2 .rpc .newaddr ()['bech32' ], 'all' , 'slow' )
2902+ l1 .rpc .withdraw (l2 .rpc .newaddr ('bech32' )['bech32' ], 'all' , 'slow' )
29032903
29042904 with pytest .raises (RpcError , match = r'Cannot estimate fees' ):
29052905 l1 .rpc .fundchannel (l2 .info ['id' ], 10 ** 6 , 'urgent' )
@@ -2911,7 +2911,7 @@ def test_no_fee_estimate(node_factory, bitcoind, executor):
29112911 l1 .rpc .fundchannel (l2 .info ['id' ], 10 ** 6 , 'slow' )
29122912
29132913 # With anchors, not even with manual feerate!
2914- l1 .rpc .withdraw (l2 .rpc .newaddr ()['bech32' ], 10000 , '1500perkb' )
2914+ l1 .rpc .withdraw (l2 .rpc .newaddr ('bech32' )['bech32' ], 10000 , '1500perkb' )
29152915 if TEST_NETWORK == 'regtest' :
29162916 with pytest .raises (RpcError , match = r'Cannot estimate fees' ):
29172917 l1 .rpc .fundchannel (l2 .info ['id' ], 10 ** 6 , '2000perkw' , minconf = 0 )
@@ -2951,7 +2951,7 @@ def test_no_fee_estimate(node_factory, bitcoind, executor):
29512951
29522952 # Can withdraw (use urgent feerate). `minconf` may be needed depending on
29532953 # the previous `fundchannel` selecting all confirmed outputs.
2954- l1 .rpc .withdraw (l2 .rpc .newaddr ()['bech32' ], 'all' , 'urgent' , minconf = 0 )
2954+ l1 .rpc .withdraw (l2 .rpc .newaddr ('bech32' )['bech32' ], 'all' , 'urgent' , minconf = 0 )
29552955
29562956
29572957def test_opener_feerate_reconnect (node_factory , bitcoind ):
@@ -3581,7 +3581,7 @@ def test_channel_features(node_factory, bitcoind, anchors):
35813581 opts = {'dev-force-features' : "+23" }
35823582 l1 , l2 = node_factory .line_graph (2 , fundchannel = False , opts = opts )
35833583
3584- bitcoind .rpc .sendtoaddress (l1 .rpc .newaddr ()['bech32' ], 0.1 )
3584+ bitcoind .rpc .sendtoaddress (l1 .rpc .newaddr ('bech32' )['bech32' ], 0.1 )
35853585 bitcoind .generate_block (1 )
35863586 wait_for (lambda : l1 .rpc .listfunds ()['outputs' ] != [])
35873587
@@ -4057,7 +4057,7 @@ def test_multichan_stress(node_factory, executor, bitcoind):
40574057 'dev-no-reconnect' : None })
40584058
40594059 # Now fund *second* channel l2->l3 (slightly larger)
4060- bitcoind .rpc .sendtoaddress (l2 .rpc .newaddr ()['bech32' ], 0.1 )
4060+ bitcoind .rpc .sendtoaddress (l2 .rpc .newaddr ('bech32' )['bech32' ], 0.1 )
40614061 bitcoind .generate_block (1 )
40624062 sync_blockheight (bitcoind , [l2 ])
40634063 l2 .rpc .fundchannel (l3 .info ['id' ], '0.01001btc' )
@@ -4216,7 +4216,7 @@ def test_multichan(node_factory, executor, bitcoind):
42164216 scid23a = l2 .get_channel_scid (l3 )
42174217
42184218 # Now fund *second* channel l2->l3 (slightly larger)
4219- bitcoind .rpc .sendtoaddress (l2 .rpc .newaddr ()['bech32' ], 0.1 )
4219+ bitcoind .rpc .sendtoaddress (l2 .rpc .newaddr ('bech32' )['bech32' ], 0.1 )
42204220 bitcoind .generate_block (1 )
42214221 sync_blockheight (bitcoind , [l1 , l2 , l3 ])
42224222 l2 .rpc .fundchannel (l3 .info ['id' ], '0.01001btc' )
@@ -4725,7 +4725,7 @@ def test_connect_ratelimit(node_factory, bitcoind):
47254725 l1 = nodes [0 ]
47264726 nodes = nodes [1 :]
47274727
4728- addr = l1 .rpc .newaddr ()['bech32' ]
4728+ addr = l1 .rpc .newaddr ('bech32' )['bech32' ]
47294729 for n in nodes :
47304730 bitcoind .rpc .sendtoaddress (addr , (FUNDAMOUNT + 1000000 ) / 10 ** 8 )
47314731 bitcoind .generate_block (1 , wait_for_mempool = len (nodes ))
0 commit comments