@@ -305,10 +305,11 @@ def __repr__(self):
305
305
306
306
307
307
class ContractManager :
308
- def __init__ (self , contract_instances : list [ContractInstance ], rpc : AuthServiceProxy , * , mine_automatically = False ):
308
+ def __init__ (self , contract_instances : list [ContractInstance ], rpc : AuthServiceProxy , * , poll_interval : float = 1 , mine_automatically : bool = False ):
309
309
self .instances = contract_instances
310
310
self .mine_automatically = mine_automatically
311
311
self .rpc = rpc
312
+ self .poll_interval = poll_interval
312
313
313
314
def _check_instance (self , instance : ContractInstance , exp_statuses : None | ContractInstanceStatus | list [ContractInstanceStatus ] = None ):
314
315
if exp_statuses is not None :
@@ -337,7 +338,7 @@ def wait_for_outpoint(self, instance: ContractInstance, txid: str | None = None)
337
338
if self .mine_automatically :
338
339
self ._mine_blocks (1 )
339
340
340
- instance .outpoint , instance .last_height = wait_for_output (self .rpc , scriptPubKey , txid = txid )
341
+ instance .outpoint , instance .last_height = wait_for_output (self .rpc , scriptPubKey , txid = txid , poll_interval = self . poll_interval )
341
342
342
343
funding_tx_raw = self .rpc .getrawtransaction (instance .outpoint .hash .to_bytes (32 , byteorder = "big" ).hex ())
343
344
funding_tx = CTransaction ()
@@ -486,7 +487,8 @@ def wait_for_spend(self, instances: ContractInstance | list[ContractInstance]) -
486
487
tx , vin , instance .last_height = wait_for_spending_tx (
487
488
self .rpc ,
488
489
instance .outpoint ,
489
- starting_height = instance .last_height
490
+ starting_height = instance .last_height ,
491
+ poll_interval = self .poll_interval
490
492
)
491
493
tx .rehash ()
492
494
0 commit comments