def _get_events(self, block_id, subscriptions):
     request = client_event_pb2.ClientEventsGetRequest(
         block_ids=[block_id], subscriptions=subscriptions)
     response = self.stream.send(
         validator_pb2.Message.CLIENT_EVENTS_GET_REQUEST,
         request.SerializeToString()).result()
     return response
    async def _get_block_deltas(self, block_id):
        resp = await self._connection.send(
            Message.CLIENT_EVENTS_GET_REQUEST,
            client_event_pb2.ClientEventsGetRequest(
                subscriptions=self._make_subscriptions(),
                block_ids=[block_id]).SerializeToString(),
            timeout=DEFAULT_TIMEOUT)

        events_resp = client_event_pb2.ClientEventsGetResponse()
        events_resp.ParseFromString(resp.content)

        if events_resp.status == \
                client_event_pb2.ClientEventsGetResponse.OK:
            events = list(events_resp.events)
            try:
                return StateDeltaEvent(events)
            except KeyError as err:
                LOGGER.warning("Received unexpected event list: %s", err)

        return None