@@ -561,12 +561,12 @@ def test_htlc_in_timeout(node_factory, bitcoind, executor):
561
561
562
562
563
563
@unittest .skipIf (TEST_NETWORK == 'liquid-regtest' , 'must be on bitcoin network' )
564
- def test_bech32_funding (node_factory , chainparams ):
564
+ def test_p2tr_funding (node_factory , chainparams ):
565
565
# Don't get any funds from previous runs.
566
566
l1 , l2 = node_factory .line_graph (2 , opts = {'random_hsm' : True }, fundchannel = False )
567
567
568
- # fund a bech32 address and then open a channel with it
569
- res = l1 .openchannel (l2 , 25000 , 'bech32 ' )
568
+ # fund a p2tr address and then open a channel with it
569
+ res = l1 .openchannel (l2 , 25000 , 'p2tr ' )
570
570
address = res ['address' ]
571
571
assert address .startswith (chainparams ['bip173_prefix' ])
572
572
@@ -576,11 +576,11 @@ def test_bech32_funding(node_factory, chainparams):
576
576
wallettx = l1 .bitcoin .rpc .getrawtransaction (wallettxid , True )
577
577
fundingtx = l1 .bitcoin .rpc .decoderawtransaction (res ['fundingtx' ])
578
578
579
- def is_p2wpkh (output ):
580
- return output ['type' ] == 'witness_v0_keyhash ' and \
579
+ def is_p2tr (output ):
580
+ return output ['type' ] == 'witness_v1_taproot ' and \
581
581
address == scriptpubkey_addr (output )
582
582
583
- assert any (is_p2wpkh (output ['scriptPubKey' ]) for output in wallettx ['vout' ])
583
+ assert any (is_p2tr (output ['scriptPubKey' ]) for output in wallettx ['vout' ])
584
584
assert only_one (fundingtx ['vin' ])['txid' ] == res ['wallettxid' ]
585
585
586
586
@@ -643,7 +643,7 @@ def dont_spend_outputs(n, txid):
643
643
dont_spend_outputs (l1 , out ['txid' ])
644
644
645
645
# Now send some money to l2.
646
- waddr = l2 .rpc .newaddr ('bech32 ' )['bech32 ' ]
646
+ waddr = l2 .rpc .newaddr ('p2tr ' )['p2tr ' ]
647
647
out = l1 .rpc .withdraw (waddr , amount )
648
648
bitcoind .generate_block (1 )
649
649
@@ -731,7 +731,7 @@ def dont_spend_outputs(n, txid):
731
731
l1 .rpc .unreserveinputs (bitcoind .rpc .createpsbt (inputs , []))
732
732
733
733
# Test withdrawal to self.
734
- l1 .rpc .withdraw (l1 .rpc .newaddr ('bech32 ' )['bech32 ' ], 'all' , minconf = 0 )
734
+ l1 .rpc .withdraw (l1 .rpc .newaddr ('p2tr ' )['p2tr ' ], 'all' , minconf = 0 )
735
735
bitcoind .generate_block (1 )
736
736
assert l1 .db_query ('SELECT COUNT(*) as c FROM outputs WHERE status=0' )[0 ]['c' ] == 1
737
737
@@ -746,12 +746,13 @@ def dont_spend_outputs(n, txid):
746
746
sync_blockheight (bitcoind , [l1 ])
747
747
assert account_balance (l1 , 'wallet' ) == 0
748
748
749
+ # randomHsm now uses p2tr addresses and have a different transaction weight than non-p2tr addresses
749
750
external_moves = [
750
751
{'type' : 'chain_mvt' , 'credit_msat' : 2000000000 , 'debit_msat' : 0 , 'tags' : ['deposit' ]},
751
752
{'type' : 'chain_mvt' , 'credit_msat' : 2000000000 , 'debit_msat' : 0 , 'tags' : ['deposit' ]},
752
753
{'type' : 'chain_mvt' , 'credit_msat' : 2000000000 , 'debit_msat' : 0 , 'tags' : ['deposit' ]},
753
754
{'type' : 'chain_mvt' , 'credit_msat' : 2000000000 , 'debit_msat' : 0 , 'tags' : ['deposit' ]},
754
- {'type' : 'chain_mvt' , 'credit_msat' : 11957393000 , 'debit_msat' : 0 , 'tags' : ['deposit' ]},
755
+ {'type' : 'chain_mvt' , 'credit_msat' : 11960055000 , 'debit_msat' : 0 , 'tags' : ['deposit' ]},
755
756
]
756
757
757
758
check_coin_moves (l1 , 'external' , external_moves , chainparams )
@@ -1338,7 +1339,7 @@ def test_blockchaintrack(node_factory, bitcoind):
1338
1339
"""Check that we track the blockchain correctly across reorgs
1339
1340
"""
1340
1341
l1 = node_factory .get_node (random_hsm = True )
1341
- addr = l1 .rpc .newaddr (addresstype = 'all' )['bech32 ' ]
1342
+ addr = l1 .rpc .newaddr (addresstype = 'all' )['p2tr ' ]
1342
1343
1343
1344
######################################################################
1344
1345
# First failure scenario: rollback on startup doesn't work,
0 commit comments