Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion qubipy/rpc/rpc_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import requests
from typing import Dict, Any
import json
import warnings

from qubipy.exceptions import *
from qubipy.config import *
Expand Down Expand Up @@ -586,14 +587,22 @@ def get_block_height(self) -> Dict[str, Any]:
"""
Retrieves the current block height from the API.

.. deprecated:: 0.4.0
Use :func:`get_tick_info` instead. This function will be removed in a future release.

Returns:
Dict[str, Any]: A dictionary containing the current block height.
If the block height is not found, an empty dictionary is returned.

Raises:
QubiPy_Exceptions: If there is an issue with the API request (e.g., network error, invalid response, or timeout).
"""

warnings.warn(
"The 'get_block_height()' function is deprecated and will be removed in a future version of QubiPy. "
"Please use 'get_tick_info()' instead for future compatibility.",
DeprecationWarning,
stacklevel=2
)
try:
response = requests.get(f'{self.rpc_url}{BLOCK_HEIGHT}', headers=HEADERS, timeout=self.timeout)
response.raise_for_status()
Expand Down