26
26
DUMMY_2_P2WPKH_SCRIPT ,
27
27
)
28
28
from test_framework .wallet import MiniWallet
29
-
29
+ from test_framework . address import ADDRESS_BCRT1_UNSPENDABLE
30
30
31
31
MAX_REPLACEMENT_LIMIT = 100
32
32
class ReplaceByFeeTest (BitcoinTestFramework ):
@@ -44,9 +44,6 @@ def set_test_params(self):
44
44
]
45
45
self .supports_cli = False
46
46
47
- def skip_test_if_missing_module (self ):
48
- self .skip_if_no_wallet ()
49
-
50
47
def run_test (self ):
51
48
self .wallet = MiniWallet (self .nodes [0 ])
52
49
# the pre-mined test framework chain contains coinbase outputs to the
@@ -531,24 +528,26 @@ def test_prioritised_transactions(self):
531
528
assert tx2b_txid in self .nodes [0 ].getrawmempool ()
532
529
533
530
def test_rpc (self ):
534
- us0 = self .nodes [ 0 ]. listunspent ()[ 0 ]
531
+ us0 = self .wallet . get_utxo ()
535
532
ins = [us0 ]
536
- outs = {self . nodes [ 0 ]. getnewaddress () : Decimal (1.0000000 )}
533
+ outs = {ADDRESS_BCRT1_UNSPENDABLE : Decimal (1.0000000 )}
537
534
rawtx0 = self .nodes [0 ].createrawtransaction (ins , outs , 0 , True )
538
535
rawtx1 = self .nodes [0 ].createrawtransaction (ins , outs , 0 , False )
539
536
json0 = self .nodes [0 ].decoderawtransaction (rawtx0 )
540
537
json1 = self .nodes [0 ].decoderawtransaction (rawtx1 )
541
538
assert_equal (json0 ["vin" ][0 ]["sequence" ], 4294967293 )
542
539
assert_equal (json1 ["vin" ][0 ]["sequence" ], 4294967295 )
543
540
544
- rawtx2 = self .nodes [0 ].createrawtransaction ([], outs )
545
- frawtx2a = self .nodes [0 ].fundrawtransaction (rawtx2 , {"replaceable" : True })
546
- frawtx2b = self .nodes [0 ].fundrawtransaction (rawtx2 , {"replaceable" : False })
541
+ if self .is_wallet_compiled ():
542
+ self .init_wallet (0 )
543
+ rawtx2 = self .nodes [0 ].createrawtransaction ([], outs )
544
+ frawtx2a = self .nodes [0 ].fundrawtransaction (rawtx2 , {"replaceable" : True })
545
+ frawtx2b = self .nodes [0 ].fundrawtransaction (rawtx2 , {"replaceable" : False })
547
546
548
- json0 = self .nodes [0 ].decoderawtransaction (frawtx2a ['hex' ])
549
- json1 = self .nodes [0 ].decoderawtransaction (frawtx2b ['hex' ])
550
- assert_equal (json0 ["vin" ][0 ]["sequence" ], 4294967293 )
551
- assert_equal (json1 ["vin" ][0 ]["sequence" ], 4294967294 )
547
+ json0 = self .nodes [0 ].decoderawtransaction (frawtx2a ['hex' ])
548
+ json1 = self .nodes [0 ].decoderawtransaction (frawtx2b ['hex' ])
549
+ assert_equal (json0 ["vin" ][0 ]["sequence" ], 4294967293 )
550
+ assert_equal (json1 ["vin" ][0 ]["sequence" ], 4294967294 )
552
551
553
552
def test_no_inherited_signaling (self ):
554
553
confirmed_utxo = self .wallet .get_utxo ()
0 commit comments