Skip to content

Commit f0cd44e

Browse files
authored
Merge pull request #428 from mdqst/patch-1
chore: fixed version format error and improved readability
2 parents 507a87e + ec9ddf4 commit f0cd44e

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

bittensor_cli/src/bittensor/chain_data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ def tao_to_alpha_with_slippage(
749749
self, tao: Balance
750750
) -> tuple[Balance, Balance, float]:
751751
"""
752-
Returns an estimate of how much Alpha would a staker receive if they stake their tao using the current pool
752+
Returns an estimate of how much Alpha a staker would receive if they stake their tao using the current pool
753753
state.
754754
755755
Args:
@@ -794,7 +794,7 @@ def alpha_to_tao_with_slippage(
794794
self, alpha: Balance
795795
) -> tuple[Balance, Balance, float]:
796796
"""
797-
Returns an estimate of how much TAO would a staker receive if they unstake their alpha using the current pool
797+
Returns an estimate of how much TAO a staker would receive if they unstake their alpha using the current pool
798798
state.
799799
800800
Args:

bittensor_cli/version.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33

44

55
def version_as_int(version):
6-
core_version = re.match(r"^\d+\.\d+\.\d+", version).group(0)
6+
match = re.match(r"^\d+\.\d+\.\d+", version)
7+
if not match:
8+
raise ValueError(f"Invalid version format: {version}")
9+
core_version = match.group(0)
710
version_split = core_version.split(".")
811
version_info = tuple(int(part) for part in version_split)
912
version_int_base = 1000

0 commit comments

Comments
 (0)