1515
1616import unittest
1717from pprint import *
18- from bitcoin import SelectParams
19- from bitcoin .wallet import *
20- from bitcoin .rpc import Proxy
21-
22- SelectParams ("regtest" )
2318
2419class InMemoryReceiverSessionEventLog (JsonReceiverSessionPersister ):
2520 def __init__ (self , id ):
@@ -215,7 +210,7 @@ async def test_integration_v2_to_v2(self):
215210 print ("Caught:" , e )
216211 raise
217212
218- def build_sweep_psbt (sender : Proxy , pj_uri : PjUri ) -> bitcoinffi .Psbt :
213+ def build_sweep_psbt (sender : RpcClient , pj_uri : PjUri ) -> bitcoinffi .Psbt :
219214 outputs = {}
220215 outputs [pj_uri .address ()] = 50
221216 psbt = json .loads (sender .call (
@@ -227,7 +222,7 @@ def build_sweep_psbt(sender: Proxy, pj_uri: PjUri) -> bitcoinffi.Psbt:
227222 ]))["psbt" ]
228223 return json .loads (sender .call ("walletprocesspsbt" , [psbt , json .dumps (True ), json .dumps ("ALL" ), json .dumps (False )]))["psbt" ]
229224
230- def get_inputs (rpc_connection : Proxy ) -> list [InputPair ]:
225+ def get_inputs (rpc_connection : RpcClient ) -> list [InputPair ]:
231226 utxos = json .loads (rpc_connection .call ("listunspent" , []))
232227 inputs = []
233228 for utxo in utxos [:1 ]:
@@ -248,7 +243,7 @@ def get_inputs(rpc_connection: Proxy) -> list[InputPair]:
248243 return inputs
249244
250245class MempoolAcceptanceCallback (CanBroadcast ):
251- def __init__ (self , connection : Proxy ):
246+ def __init__ (self , connection : RpcClient ):
252247 self .connection = connection
253248
254249 def callback (self , tx ):
@@ -262,7 +257,7 @@ def callback(self, tx):
262257 return None
263258
264259class IsScriptOwnedCallback (IsScriptOwned ):
265- def __init__ (self , connection : Proxy ):
260+ def __init__ (self , connection : RpcClient ):
266261 self .connection = connection
267262
268263 def callback (self , script ):
@@ -274,14 +269,14 @@ def callback(self, script):
274269 return None
275270
276271class CheckInputsNotSeenCallback (IsOutputKnown ):
277- def __init__ (self , connection : Proxy ):
272+ def __init__ (self , connection : RpcClient ):
278273 self .connection = connection
279274
280275 def callback (self , _outpoint ):
281276 return False
282277
283278class ProcessPsbtCallback (ProcessPsbt ):
284- def __init__ (self , connection : Proxy ):
279+ def __init__ (self , connection : RpcClient ):
285280 self .connection = connection
286281
287282 def callback (self , psbt : str ):
0 commit comments