Skip to content

Commit 6a57f11

Browse files
authored
Merge pull request #2541 from opentensor/fix/thewhaleking/8.5-bugfixes
8.5.0 bugfixes
2 parents a34920f + 30327b6 commit 6a57f11

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

bittensor/core/errors.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,15 @@
1717

1818
from __future__ import annotations
1919

20-
from bittensor.core.synapse import Synapse
20+
from typing import Optional, TYPE_CHECKING
2121

22+
from substrateinterface.exceptions import SubstrateRequestException
2223

23-
class ChainError(BaseException):
24+
if TYPE_CHECKING:
25+
from bittensor.core.synapse import Synapse
26+
27+
28+
class ChainError(SubstrateRequestException):
2429
"""Base error for any chain related errors."""
2530

2631

@@ -81,7 +86,9 @@ class InvalidRequestNameError(Exception):
8186

8287

8388
class SynapseException(Exception):
84-
def __init__(self, message="Synapse Exception", synapse: "Synapse" | None = None):
89+
def __init__(
90+
self, message="Synapse Exception", synapse: Optional["Synapse"] = None
91+
):
8592
self.message = message
8693
self.synapse = synapse
8794
super().__init__(self.message)
@@ -123,7 +130,7 @@ class SynapseDendriteNoneException(SynapseException):
123130
def __init__(
124131
self,
125132
message="Synapse Dendrite is None",
126-
synapse: "Synapse" | None = None,
133+
synapse: Optional["Synapse"] = None,
127134
):
128135
self.message = message
129136
super().__init__(self.message, synapse)

bittensor/core/subtensor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ def query_runtime_api(
505505
self,
506506
runtime_api: str,
507507
method: str,
508-
params: Optional[Union[list[int], dict[str, int]]],
508+
params: Optional[Union[list[int], dict[str, int]]] = None,
509509
block: Optional[int] = None,
510510
) -> Optional[str]:
511511
"""
@@ -956,13 +956,13 @@ def get_neuron_certificate(
956956

957957
@networking.ensure_connected
958958
def neuron_for_uid(
959-
self, uid: Optional[int], netuid: int, block: Optional[int] = None
959+
self, uid: int, netuid: int, block: Optional[int] = None
960960
) -> "NeuronInfo":
961961
"""
962962
Retrieves detailed information about a specific neuron identified by its unique identifier (UID) within a specified subnet (netuid) of the Bittensor network. This function provides a comprehensive view of a neuron's attributes, including its stake, rank, and operational status.
963963
964964
Args:
965-
uid (Optional[int]): The unique identifier of the neuron.
965+
uid (int): The unique identifier of the neuron.
966966
netuid (int): The unique identifier of the subnet.
967967
block (Optional[int]): The blockchain block number for the query.
968968

0 commit comments

Comments
 (0)