Skip to content

Commit

Permalink
merge with staging
Browse files Browse the repository at this point in the history
  • Loading branch information
open-junius committed Nov 6, 2024
2 parents d084074 + 22e1557 commit e430823
Show file tree
Hide file tree
Showing 26 changed files with 675 additions and 1,110 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## 8.2.0 /2024-10-10

## What's Changed
* remove commit from e2e tests by @roman-opentensor in https://github.com/opentensor/bittensor/pull/2340
* add bittensor-cli as prod deps for sdk by @roman-opentensor in https://github.com/opentensor/bittensor/pull/2345
* Fix the install command syntax by @rajkaramchedu in https://github.com/opentensor/bittensor/pull/2346
* add config test by @roman-opentensor in https://github.com/opentensor/bittensor/pull/2347
* Bumps version for 8.2.0 by @ibraheem-opentensor in https://github.com/opentensor/bittensor/pull/2348

**Full Changelog**: https://github.com/opentensor/bittensor/compare/v8.1.1...v8.2.0

## 8.1.1 /2024-10-04

## What's Changed
Expand Down
20 changes: 11 additions & 9 deletions bittensor/core/async_subtensor.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import asyncio
import ssl
from typing import Optional, Any, Union, TypedDict, Iterable

import aiohttp
import numpy as np
import scalecodec
import typer
from bittensor_wallet import Wallet
from bittensor_wallet.utils import SS58_FORMAT
from numpy.typing import NDArray
Expand Down Expand Up @@ -134,7 +134,13 @@ async def __aenter__(self):
logging.error(
f"<red>Error</red>: Timeout occurred connecting to substrate. Verify your chain and network settings: {self}"
)
raise typer.Exit(code=1)
raise ConnectionError
except (ConnectionRefusedError, ssl.SSLError) as error:
logging.error(
f"<red>Error</red>: Connection refused when connecting to substrate. "
f"Verify your chain and network settings: {self}. Error: {error}"
)
raise ConnectionError

async def __aexit__(self, exc_type, exc_val, exc_tb):
await self.substrate.close()
Expand Down Expand Up @@ -245,7 +251,7 @@ async def get_total_subnets(
module="SubtensorModule",
storage_function="TotalNetworks",
params=[],
block_hash=block_hash
block_hash=block_hash,
)
return result

Expand Down Expand Up @@ -688,7 +694,7 @@ async def filter_netuids_by_registered_hotkeys(
"""
Filters a given list of all netuids for certain specified netuids and hotkeys
Argumens:
Args:
all_netuids (Iterable[int]): A list of netuids to filter.
filter_for_netuids (Iterable[int]): A subset of all_netuids to filter from the main list
all_hotkeys (Iterable[Wallet]): Hotkeys to filter from the main list
Expand Down Expand Up @@ -1298,7 +1304,7 @@ async def get_uid_for_hotkey_on_subnet(
module="SubtensorModule",
storage_function="Uids",
params=[netuid, hotkey_ss58],
block_hash=block_hash
block_hash=block_hash,
)

# extrinsics
Expand All @@ -1309,7 +1315,6 @@ async def transfer(
destination: str,
amount: float,
transfer_all: bool,
prompt: bool,
) -> bool:
"""
Transfer token of amount to destination.
Expand All @@ -1319,7 +1324,6 @@ async def transfer(
destination (str): Destination address for the transfer.
amount (float): Amount of tokens to transfer.
transfer_all (bool): Flag to transfer all tokens.
prompt (bool): Flag to prompt user for confirmation before transferring.
Returns:
`True` if the transferring was successful, otherwise `False`.
Expand All @@ -1330,7 +1334,6 @@ async def transfer(
destination,
Balance.from_tao(amount),
transfer_all,
prompt=prompt,
)

async def register(
Expand Down Expand Up @@ -1407,7 +1410,6 @@ async def pow_register(
subtensor=self,
wallet=wallet,
netuid=netuid,
prompt=True,
tpb=threads_per_block,
update_interval=update_interval,
num_processes=processors,
Expand Down
12 changes: 0 additions & 12 deletions bittensor/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,18 +97,6 @@ def __init__(
# this can fail if --no_version_checking has already been added.
pass

try:
parser.add_argument(
"--no_prompt",
dest="no_prompt",
action="store_true",
help="Set ``true`` to stop cli from prompting the user.",
default=False,
)
except Exception:
# this can fail if --no_version_checking has already been added.
pass

# Get args from argv if not passed in.
if args is None:
args = sys.argv[1:]
Expand Down
Loading

0 comments on commit e430823

Please sign in to comment.