@@ -330,8 +330,7 @@ async def on_connect(self):
330330 for address , types in self ._operation_subscriptions .items ():
331331 await self .subscribe_to_operations (address , types )
332332 for address , paths in self ._big_map_subscriptions .items ():
333- for path in paths :
334- await self .subscribe_to_big_maps (address , paths )
333+ await self .subscribe_to_big_maps (address , paths )
335334
336335 def on_error (self , message : CompletionMessage ):
337336 raise Exception (message .error )
@@ -352,8 +351,22 @@ async def subscribe_to_operations(self, address: str, types: List[OperationType]
352351 ],
353352 )
354353
355- async def subscribe_to_big_maps (self , address : Address , path : Path ) -> None :
356- self ._logger .info ('Subscribing to %s, %s' , address , path )
354+ async def subscribe_to_big_maps (self , address : Address , paths : List [Path ]) -> None :
355+ self ._logger .info ('Subscribing to big map updates of %s, %s' , address , paths )
356+
357+ while self ._get_client ().transport .state != ConnectionState .connected :
358+ await asyncio .sleep (0.1 )
359+
360+ for path in paths :
361+ await self ._get_client ().send (
362+ 'SubscribeToBigMaps' ,
363+ [
364+ {
365+ 'address' : address ,
366+ 'path' : path ,
367+ }
368+ ],
369+ )
357370
358371 async def fetch_operations (self , index_config : OperationIndexConfig , last_level : int ) -> None :
359372 self ._logger .info ('Fetching operations prior to level %s' , last_level )
@@ -561,7 +574,7 @@ async def add_operation_subscription(self, address: str, types: Optional[List[Op
561574 async def add_big_map_subscription (self , address : str , path : str ) -> None :
562575 if address not in self ._big_map_subscriptions :
563576 self ._big_map_subscriptions [address ] = []
564- self ._big_map_subscriptions [address ].append (' path' )
577+ self ._big_map_subscriptions [address ].append (path )
565578
566579 async def on_operation_match (
567580 self ,
0 commit comments