def error_dict(code: PoolErrorCode, message: str): error: ErrorResponse = ErrorResponse(uint16(code.value), message) return error.to_json_dict()
def error_response(code: PoolErrorCode, message: str): error: ErrorResponse = ErrorResponse(uint16(code.value), message) return obj_to_response(error)
def handle_failed_pool_response(self, p2_singleton_puzzle_hash: bytes32, error_message: str): self.log.error(error_message) self.pool_state[p2_singleton_puzzle_hash]["pool_errors_24h"].append( ErrorResponse(uint16(PoolErrorCode.REQUEST_FAILED.value), error_message).to_json_dict() )