def delete_state(self, addresses, timeout=None): """ delete_state requests that each of the provided addresses be unset in validator state. A list of successfully deleted addresses is returned. Args: addresses (list): list of addresses to delete timeout: optional timeout, in seconds Returns: addresses (list): a list of addresses that were deleted Raises: AuthorizationException """ request = state_context_pb2.TpStateDeleteRequest( context_id=self._context_id, addresses=addresses).SerializeToString() response = state_context_pb2.TpStateDeleteResponse() response.ParseFromString( self._stream.send(Message.TP_STATE_DELETE_REQUEST, request).result(timeout).content) if response.status == \ state_context_pb2.TpStateDeleteResponse.AUTHORIZATION_ERROR: raise AuthorizationException( 'Tried to delete unauthorized address: {}'.format(addresses)) return response.addresses
def delete_state(self, addresses, timeout=None): """ delete an address in the validator's merkle state Args: addresses (list): list of addresses timeout: optional timeout, in seconds Returns: addresses (list): a list of addresses that were deleted """ request = state_context_pb2.TpStateDeleteRequest( context_id=self._context_id, addresses=addresses).SerializeToString() response = state_context_pb2.TpStateDeleteResponse() response.ParseFromString( self._stream.send(Message.TP_STATE_DEL_REQUEST, request).result(timeout).content) if response.status == \ state_context_pb2.TpStateDeleteResponse.AUTHORIZATION_ERROR: raise AuthorizationException( 'Tried to delete unauthorized address: {}'.format(addresses)) return response.addresses