@@ -115,7 +115,7 @@ class TestNostr(unittest.TestCase):
115115 #relays = [ "wss://relay.damus.io", "wss://nostr-pub.wellorder.net" ]
116116 #relays = [ "ws://127.0.0.1:5000/nostrrelay/test", "ws://127.0.0.1:5000/nostrclient/api/v1/relay", "wss://relay.damus.io", "wss://nostr-pub.wellorder.net" ]
117117 #relays = [ "ws://127.0.0.1:5000/nostrclient/api/v1/relay", "wss://relay.damus.io", "wss://nostr-pub.wellorder.net" ]
118- secret = "fab0a9a11d4cf4b1d92e901a0b2c56634275e2fa1a7eb396ff1b942f95d59fd3"
118+ secret = "fab0a9a11d4cf4b1d92e901a0b2c56634275e2fa1a7eb396ff1b942f95d59fd3" # not really a secret, just from a local fake wallet
119119 wallet_pubkey = "e46762afab282c324278351165122345f9983ea447b47943b052100321227571"
120120
121121 async def fetch_balance (self ):
@@ -203,7 +203,7 @@ async def NOmainHERE(self):
203203
204204 print (f"DEBUG: Opening relay connections" )
205205 await self .relay_manager .open_connections ({"cert_reqs" : ssl .CERT_NONE })
206- self .connected = False
206+ self .allconnected = False
207207 for _ in range (20 ):
208208 print ("Waiting for relay connection..." )
209209 await asyncio .sleep (0.5 )
@@ -219,13 +219,12 @@ async def NOmainHERE(self):
219219 except Exception as e :
220220 print (f"could not find relay: { e } " )
221221 break # not all of them have been initialized, skip...
222- self .connected = ( nrconnected == len (self .relays ) )
223- if self .connected :
222+ self .allconnected = ( nrconnected == len (self .relays ) )
223+ if self .allconnected :
224224 print ("All relays connected!" )
225225 break
226- if not self .connected or not self .keep_running :
226+ if not self .allconnected or not self .keep_running :
227227 print (f"ERROR: could not connect to relay or not self.keep_running, aborting..." )
228- # TODO: call an error callback to notify the user
229228 return
230229
231230 # Set up subscription to receive response
0 commit comments