@@ -80,7 +80,7 @@ def create_taproot_utxo(self):
8080 self .nodes [0 ].sendrawtransaction (signed_raw_tx ['hex' ])
8181 tx = tx_from_hex (signed_raw_tx ['hex' ])
8282 tx .rehash ()
83- self .nodes [0 ]. generate ( 1 )
83+ self .generate ( self . nodes [0 ], 1 )
8484 last_blk = self .nodes [0 ].getblock (self .nodes [0 ].getbestblockhash ())
8585 assert (tx .hash in last_blk ['tx' ])
8686
@@ -95,7 +95,7 @@ def pegin_test(self, sighash_ty):
9595 peg_id = self .nodes [0 ].sendtoaddress (fund_info ["mainchain_address" ], 1 )
9696 raw_peg_tx = self .nodes [0 ].gettransaction (peg_id )["hex" ]
9797 peg_txid = self .nodes [0 ].sendrawtransaction (raw_peg_tx )
98- self .nodes [0 ]. generate ( 101 )
98+ self .generate ( self . nodes [0 ], 101 )
9999 peg_prf = self .nodes [0 ].gettxoutproof ([peg_txid ])
100100 claim_script = fund_info ["claim_script" ]
101101
@@ -126,7 +126,7 @@ def pegin_test(self, sighash_ty):
126126 assert (verify_schnorr (pub_tweak , sig , msg ))
127127 # Since we add in/outputs the min feerate is no longer maintained.
128128 self .nodes [0 ].sendrawtransaction (hexstring = raw_claim .serialize ().hex ())
129- self .nodes [0 ]. generate ( 1 )
129+ self .generate ( self . nodes [0 ], 1 )
130130 last_blk = self .nodes [0 ].getblock (self .nodes [0 ].getbestblockhash ())
131131 raw_claim .rehash ()
132132 assert (raw_claim .hash in last_blk ['tx' ])
@@ -166,15 +166,18 @@ def issuance_test(self, sighash_ty):
166166 assert (verify_schnorr (pub_tweak , sig , msg ))
167167 # Since we add in/outputs the min feerate is no longer maintained.
168168 self .nodes [0 ].sendrawtransaction (hexstring = issued_tx .serialize ().hex ())
169- self .nodes [0 ]. generate ( 1 )
169+ self .generate ( self . nodes [0 ], 1 )
170170 last_blk = self .nodes [0 ].getblock (self .nodes [0 ].getbestblockhash ())
171171 issued_tx .rehash ()
172172 assert (issued_tx .hash in last_blk ['tx' ])
173173
174174
175175 def run_test (self ):
176- self .nodes [0 ]. generate ( 101 )
176+ self .generate ( self . nodes [0 ], 101 )
177177 self .wait_until (lambda : self .nodes [0 ].getblockcount () == 101 , timeout = 5 )
178+ # spend the initialfreecoins to node0, to fix bad-txns-inputs-missingorspent error
179+ self .nodes [0 ].sendtoaddress (self .nodes [0 ].getnewaddress (), 50 )
180+ self .generate (self .nodes [0 ], 1 )
178181 self .log .info ("Testing sighash taproot pegins" )
179182 # Note that this does not test deposit to taproot pegin addresses
180183 # because there is no support for taproot pegins in rpc. The current rpc assumes
0 commit comments