@@ -84,6 +84,12 @@ def skip_test_if_missing_module(self):
84
84
self .skip_if_no_wallet ()
85
85
86
86
def run_test (self ):
87
+ self .wallet = MiniWallet (self .nodes [0 ])
88
+ # the pre-mined test framework chain contains coinbase outputs to the
89
+ # MiniWallet's default address ADDRESS_BCRT1_P2WSH_OP_TRUE in blocks
90
+ # 76-100 (see method BitcoinTestFramework._initialize_chain())
91
+ self .wallet .scan_blocks (start = 76 , num = 1 )
92
+
87
93
self .log .info ("Running test simple doublespend..." )
88
94
self .test_simple_doublespend ()
89
95
@@ -569,20 +575,18 @@ def test_rpc(self):
569
575
assert_equal (json1 ["vin" ][0 ]["sequence" ], 4294967294 )
570
576
571
577
def test_no_inherited_signaling (self ):
572
- wallet = MiniWallet (self .nodes [0 ])
573
- wallet .scan_blocks (start = 76 , num = 1 )
574
- confirmed_utxo = wallet .get_utxo ()
578
+ confirmed_utxo = self .wallet .get_utxo ()
575
579
576
580
# Create an explicitly opt-in parent transaction
577
- optin_parent_tx = wallet .send_self_transfer (
581
+ optin_parent_tx = self . wallet .send_self_transfer (
578
582
from_node = self .nodes [0 ],
579
583
utxo_to_spend = confirmed_utxo ,
580
584
sequence = BIP125_SEQUENCE_NUMBER ,
581
585
fee_rate = Decimal ('0.01' ),
582
586
)
583
587
assert_equal (True , self .nodes [0 ].getmempoolentry (optin_parent_tx ['txid' ])['bip125-replaceable' ])
584
588
585
- replacement_parent_tx = wallet .create_self_transfer (
589
+ replacement_parent_tx = self . wallet .create_self_transfer (
586
590
from_node = self .nodes [0 ],
587
591
utxo_to_spend = confirmed_utxo ,
588
592
sequence = BIP125_SEQUENCE_NUMBER ,
@@ -596,8 +600,8 @@ def test_no_inherited_signaling(self):
596
600
assert_equal (res ['allowed' ], True )
597
601
598
602
# Create an opt-out child tx spending the opt-in parent
599
- parent_utxo = wallet .get_utxo (txid = optin_parent_tx ['txid' ])
600
- optout_child_tx = wallet .send_self_transfer (
603
+ parent_utxo = self . wallet .get_utxo (txid = optin_parent_tx ['txid' ])
604
+ optout_child_tx = self . wallet .send_self_transfer (
601
605
from_node = self .nodes [0 ],
602
606
utxo_to_spend = parent_utxo ,
603
607
sequence = 0xffffffff ,
@@ -607,7 +611,7 @@ def test_no_inherited_signaling(self):
607
611
# Reports true due to inheritance
608
612
assert_equal (True , self .nodes [0 ].getmempoolentry (optout_child_tx ['txid' ])['bip125-replaceable' ])
609
613
610
- replacement_child_tx = wallet .create_self_transfer (
614
+ replacement_child_tx = self . wallet .create_self_transfer (
611
615
from_node = self .nodes [0 ],
612
616
utxo_to_spend = parent_utxo ,
613
617
sequence = 0xffffffff ,
@@ -626,9 +630,7 @@ def test_no_inherited_signaling(self):
626
630
assert_raises_rpc_error (- 26 , 'txn-mempool-conflict' , self .nodes [0 ].sendrawtransaction , replacement_child_tx ["hex" ], 0 )
627
631
628
632
def test_replacement_relay_fee (self ):
629
- wallet = MiniWallet (self .nodes [0 ])
630
- wallet .scan_blocks (start = 77 , num = 1 )
631
- tx = wallet .send_self_transfer (from_node = self .nodes [0 ])['tx' ]
633
+ tx = self .wallet .send_self_transfer (from_node = self .nodes [0 ])['tx' ]
632
634
633
635
# Higher fee, higher feerate, different txid, but the replacement does not provide a relay
634
636
# fee conforming to node's `incrementalrelayfee` policy of 1000 sat per KB.
0 commit comments