Skip to content

Commit

Permalink
Merge pull request #1731 from opentensor/feature/gus/51818215/expand-…
Browse files Browse the repository at this point in the history
…type-checking-subtensor

Expands type checking  to subtensor
  • Loading branch information
ifrit98 authored Mar 6, 2024
2 parents 106bf4a + 591df7b commit 0c05882
Show file tree
Hide file tree
Showing 9 changed files with 320 additions and 212 deletions.
2 changes: 1 addition & 1 deletion bittensor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
__version__ = "6.8.2"

version_split = __version__.split(".")
__version_as_int__ = (
__version_as_int__: int = (
(100 * int(version_split[0]))
+ (10 * int(version_split[1]))
+ (1 * int(version_split[2]))
Expand Down
4 changes: 2 additions & 2 deletions bittensor/extrinsics/delegation.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def delegate_extrinsic(
subtensor: "bittensor.subtensor",
wallet: "bittensor.wallet",
delegate_ss58: Optional[str] = None,
amount: Union[Balance, float] = None,
amount: Optional[Union[Balance, float]] = None,
wait_for_inclusion: bool = True,
wait_for_finalization: bool = False,
prompt: bool = False,
Expand Down Expand Up @@ -232,7 +232,7 @@ def undelegate_extrinsic(
subtensor: "bittensor.subtensor",
wallet: "bittensor.wallet",
delegate_ss58: Optional[str] = None,
amount: Union[Balance, float] = None,
amount: Optional[Union[Balance, float]] = None,
wait_for_inclusion: bool = True,
wait_for_finalization: bool = False,
prompt: bool = False,
Expand Down
2 changes: 1 addition & 1 deletion bittensor/extrinsics/serving.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def publish_metadata(
wallet: "bittensor.wallet",
netuid: int,
type: str,
data: str,
data: bytes,
wait_for_inclusion: bool = False,
wait_for_finalization: bool = True,
) -> bool:
Expand Down
4 changes: 2 additions & 2 deletions bittensor/extrinsics/staking.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def add_stake_extrinsic(
subtensor: "bittensor.subtensor",
wallet: "bittensor.wallet",
hotkey_ss58: Optional[str] = None,
amount: Union[Balance, float] = None,
amount: Optional[Union[Balance, float]] = None,
wait_for_inclusion: bool = True,
wait_for_finalization: bool = False,
prompt: bool = False,
Expand Down Expand Up @@ -204,7 +204,7 @@ def add_stake_multiple_extrinsic(
subtensor: "bittensor.subtensor",
wallet: "bittensor.wallet",
hotkey_ss58s: List[str],
amounts: List[Union[Balance, float]] = None,
amounts: Optional[List[Union[Balance, float]]] = None,
wait_for_inclusion: bool = True,
wait_for_finalization: bool = False,
prompt: bool = False,
Expand Down
4 changes: 2 additions & 2 deletions bittensor/extrinsics/unstaking.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def unstake_extrinsic(
subtensor: "bittensor.subtensor",
wallet: "bittensor.wallet",
hotkey_ss58: Optional[str] = None,
amount: Union[Balance, float] = None,
amount: Optional[Union[Balance, float]] = None,
wait_for_inclusion: bool = True,
wait_for_finalization: bool = False,
prompt: bool = False,
Expand Down Expand Up @@ -210,7 +210,7 @@ def unstake_multiple_extrinsic(
subtensor: "bittensor.subtensor",
wallet: "bittensor.wallet",
hotkey_ss58s: List[str],
amounts: List[Union[Balance, float]] = None,
amounts: Optional[List[Union[Balance, float]]] = None,
wait_for_inclusion: bool = True,
wait_for_finalization: bool = False,
prompt: bool = False,
Expand Down
2 changes: 1 addition & 1 deletion bittensor/metagraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ def _process_root_weights(
"""
data_array = []
n_subnets = subtensor.get_total_subnets()
n_subnets = subtensor.get_total_subnets() or 0
subnets = subtensor.get_subnets()
for item in data:
if len(item) == 0:
Expand Down
Loading

0 comments on commit 0c05882

Please sign in to comment.