@@ -1119,6 +1119,29 @@ async def get_metering_report(
11191119
11201120 # endregion
11211121
1122+ # region Miscellaneous admin calls
1123+
1124+ async def prune (
1125+ self ,
1126+ up_to : str ,
1127+ submission_id : Optional [str ] = None ,
1128+ prune_all_divulged_contracts = False ,
1129+ * ,
1130+ token : Optional [TokenOrTokenProvider ] = None ,
1131+ timeout : Optional [TimeDeltaLike ] = None ,
1132+ ) -> None :
1133+ with self ._call (token = token , timeout = timeout ) as call :
1134+ stub = call .grpc_stub (lapiadminpb .ParticipantPruningServiceStub )
1135+
1136+ request = lapiadminpb .PruneRequest (
1137+ prune_up_to = up_to ,
1138+ submission_id = submission_id ,
1139+ prune_all_divulged_contracts = prune_all_divulged_contracts ,
1140+ )
1141+ await retry (lambda : stub .Prune (request , ** call .grpc_kwargs ), timeout = call .timeout )
1142+
1143+ # endregion
1144+
11221145
11231146class QueryStream (aio .QueryStreamBase ):
11241147 def __init__ (
@@ -1193,6 +1216,7 @@ async def items(self):
11931216 await self ._emit_create (event )
11941217 case Boundary ():
11951218 await self ._emit_boundary (event )
1219+ offset = event .offset
11961220 case _:
11971221 warnings .warn (f"Received an unknown event: { event } " , ProtocolWarning )
11981222 yield event
@@ -1208,7 +1232,7 @@ async def items(self):
12081232 # now start returning events as they come off the transaction stream; note this
12091233 # stream will never naturally close, so it's on the caller to call close() or to
12101234 # otherwise exit our current context
1211- log .debug ("Reading a transaction stream: %s" , self ._offset_range )
1235+ log .debug ("Reading a transaction stream: %s to %s " , offset , self ._offset_range . end )
12121236 async for event in self ._tx_events (tx_filter_pb , offset , self ._offset_range .end ):
12131237 log .debug ("Received an event: %s" , event )
12141238 match event :
0 commit comments