Skip to content
Merged
Show file tree
Hide file tree
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
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## 9.12.1 /2025-10-20

## What's Changed
* replace error by @basfroman in https://github.com/opentensor/bittensor/pull/3092
* Update type hint/docstring for ws_shutdown_timer by @thewhaleking in https://github.com/opentensor/bittensor/pull/3090
* Commenting on the test until the new governance come by @basfroman in https://github.com/opentensor/bittensor/pull/3101
* Bumping scalecodec to 1.2.12 by @basfroman in https://github.com/opentensor/bittensor/pull/3104

**Full Changelog**: https://github.com/opentensor/bittensor/compare/v9.12.0...v9.12.1

## 9.12.0 /2025-10-08

## What's Changed
Expand Down
6 changes: 4 additions & 2 deletions bittensor/core/async_subtensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def __init__(
retry_forever: bool = False,
_mock: bool = False,
archive_endpoints: Optional[list[str]] = None,
websocket_shutdown_timer: float = 5.0,
websocket_shutdown_timer: Optional[float] = 5.0,
):
"""Initializes an AsyncSubtensor instance for blockchain interaction.

Expand All @@ -172,7 +172,9 @@ def __init__(
cases where you are requesting a block that is too old for your current (presumably lite) node.
Defaults to ``None``.
websocket_shutdown_timer: Amount of time, in seconds, to wait after the last response from the chain to
close the connection. Defaults to ``5.0``.
close the connection. Passing `None` will disable to automatic shutdown process
entirely.

Returns:
None

Expand Down
5 changes: 3 additions & 2 deletions bittensor/core/subtensor_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ class SubtensorApi:
archive_endpoints: Similar to fallback_endpoints, but specifically only archive nodes. Will be used in cases
where you are requesting a block that is too old for your current (presumably lite) node. Defaults to `None`
websocket_shutdown_timer: Amount of time, in seconds, to wait after the last response from the chain to close
the connection. Only applicable to AsyncSubtensor.
the connection. Only applicable to AsyncSubtensor. If `None` is passed to this, the automatic shutdown
process is disabled.

Example:
# sync version
Expand Down Expand Up @@ -80,7 +81,7 @@ def __init__(
log_verbose: bool = False,
mock: bool = False,
archive_endpoints: Optional[list[str]] = None,
websocket_shutdown_timer: float = 5.0,
websocket_shutdown_timer: Optional[float] = 5.0,
):
self.network = network
self._fallback_endpoints = fallback_endpoints
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "bittensor"
version = "9.12.0"
version = "9.12.1"
description = "Bittensor"
readme = "README.md"
authors = [
Expand All @@ -31,11 +31,11 @@ dependencies = [
"retry==0.9.2",
"requests>=2.0.0,<3.0",
"pydantic>=2.3, <3",
"scalecodec==1.2.11",
"scalecodec==1.2.12",
"uvicorn",
"bittensor-drand>=1.0.0,<2.0.0",
"bittensor-wallet>=4.0.0,<5.0",
"async-substrate-interface>=1.5.4"
"async-substrate-interface>=1.5.6"
]

[project.optional-dependencies]
Expand Down
200 changes: 100 additions & 100 deletions tests/e2e_tests/test_delegate.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,103 +380,103 @@ def test_nominator_min_required_stake(
assert stake == Balance(0)


def test_get_vote_data(subtensor, alice_wallet):
"""
Tests:
- Sends Propose
- Checks existing Proposals
- Votes
- Checks Proposal is updated
"""

subtensor.root_register(alice_wallet)

proposals = subtensor.query_map(
"Triumvirate",
"ProposalOf",
params=[],
)

assert proposals.records == []

success, error = propose(
subtensor,
alice_wallet,
proposal=subtensor.substrate.compose_call(
call_module="Triumvirate",
call_function="set_members",
call_params={
"new_members": [],
"prime": None,
"old_count": 0,
},
),
duration=1_000_000,
)

assert error == ""
assert success is True

proposals = subtensor.query_map(
"Triumvirate",
"ProposalOf",
params=[],
)
proposals = {
bytes(proposal_hash[0]): proposal.value for proposal_hash, proposal in proposals
}

assert list(proposals.values()) == [
{
"Triumvirate": (
{
"set_members": {
"new_members": (),
"prime": None,
"old_count": 0,
},
},
),
},
]

proposal_hash = list(proposals.keys())[0]
proposal_hash = f"0x{proposal_hash.hex()}"

proposal = subtensor.get_vote_data(
proposal_hash,
)

assert proposal == ProposalVoteData(
ayes=[],
end=CloseInValue(1_000_000, subtensor.block),
index=0,
nays=[],
threshold=3,
)

success, error = vote(
subtensor,
alice_wallet,
alice_wallet.hotkey.ss58_address,
proposal_hash,
index=0,
approve=True,
)

assert error == ""
assert success is True

proposal = subtensor.get_vote_data(
proposal_hash,
)

assert proposal == ProposalVoteData(
ayes=[
alice_wallet.hotkey.ss58_address,
],
end=CloseInValue(1_000_000, subtensor.block),
index=0,
nays=[],
threshold=3,
)
# def test_get_vote_data(subtensor, alice_wallet):
# """
# Tests:
# - Sends Propose
# - Checks existing Proposals
# - Votes
# - Checks Proposal is updated
# """
#
# subtensor.root_register(alice_wallet)
#
# proposals = subtensor.query_map(
# "Triumvirate",
# "ProposalOf",
# params=[],
# )
#
# assert proposals.records == []
#
# success, error = propose(
# subtensor,
# alice_wallet,
# proposal=subtensor.substrate.compose_call(
# call_module="Triumvirate",
# call_function="set_members",
# call_params={
# "new_members": [],
# "prime": None,
# "old_count": 0,
# },
# ),
# duration=1_000_000,
# )
#
# assert error == ""
# assert success is True
#
# proposals = subtensor.query_map(
# "Triumvirate",
# "ProposalOf",
# params=[],
# )
# proposals = {
# bytes(proposal_hash[0]): proposal.value for proposal_hash, proposal in proposals
# }
#
# assert list(proposals.values()) == [
# {
# "Triumvirate": (
# {
# "set_members": {
# "new_members": (),
# "prime": None,
# "old_count": 0,
# },
# },
# ),
# },
# ]
#
# proposal_hash = list(proposals.keys())[0]
# proposal_hash = f"0x{proposal_hash.hex()}"
#
# proposal = subtensor.get_vote_data(
# proposal_hash,
# )
#
# assert proposal == ProposalVoteData(
# ayes=[],
# end=CloseInValue(1_000_000, subtensor.block),
# index=0,
# nays=[],
# threshold=3,
# )
#
# success, error = vote(
# subtensor,
# alice_wallet,
# alice_wallet.hotkey.ss58_address,
# proposal_hash,
# index=0,
# approve=True,
# )
#
# assert error == ""
# assert success is True
#
# proposal = subtensor.get_vote_data(
# proposal_hash,
# )
#
# assert proposal == ProposalVoteData(
# ayes=[
# alice_wallet.hotkey.ss58_address,
# ],
# end=CloseInValue(1_000_000, subtensor.block),
# index=0,
# nays=[],
# threshold=3,
# )
2 changes: 1 addition & 1 deletion tests/e2e_tests/test_hotkeys.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ async def test_children(local_chain, subtensor, alice_wallet, bob_wallet, dave_w
raise_error=True,
)

with pytest.raises(TooManyChildren):
with pytest.raises(DuplicateChild):
subtensor.set_children(
alice_wallet,
alice_wallet.hotkey.ss58_address,
Expand Down
Loading