Skip to content
Closed
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
43 changes: 1 addition & 42 deletions bittensor/core/async_subtensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
MetagraphInfo,
NeuronInfo,
NeuronInfoLite,
ProposalVoteData,

ProxyAnnouncementInfo,
ProxyConstants,
ProxyInfo,
Expand Down Expand Up @@ -4956,47 +4956,6 @@ async def get_unstake_fee(
)
return sim_swap_result.alpha_fee.set_unit(netuid=netuid)

async def get_vote_data(
self,
proposal_hash: str,
block: Optional[int] = None,
block_hash: Optional[str] = None,
reuse_block: bool = False,
) -> Optional["ProposalVoteData"]:
# TODO: is this all deprecated? Didn't subtensor senate stuff get removed?
"""
Retrieves the voting data for a specific proposal on the Bittensor blockchain. This data includes information
about how senate members have voted on the proposal.

Parameters:
proposal_hash: The hash of the proposal for which voting data is requested.
block: The blockchain block number for the query.
block_hash: The hash of the blockchain block number to query the voting data.
reuse_block: Whether to reuse the last-used blockchain block hash.

Returns:
An object containing the proposal's voting data, or `None` if not found.

This function is important for tracking and understanding the decision-making processes within the Bittensor
network, particularly how proposals are received and acted upon by the governing body.
"""
block_hash = await self.determine_block_hash(block, block_hash, reuse_block)
vote_data = cast(
Optional[dict[str, Any]],
await self.substrate.query(
module="Triumvirate",
storage_function="Voting",
params=[proposal_hash],
block_hash=block_hash,
reuse_block_hash=reuse_block,
),
)

if vote_data is None:
return None

return ProposalVoteData.from_dict(vote_data)

async def get_uid_for_hotkey_on_subnet(
self,
hotkey_ss58: str,
Expand Down
2 changes: 0 additions & 2 deletions bittensor/core/chain_data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
from .neuron_info import NeuronInfo
from .neuron_info_lite import NeuronInfoLite
from .prometheus_info import PrometheusInfo
from .proposal_vote_data import ProposalVoteData
from .proxy import ProxyAnnouncementInfo, ProxyConstants, ProxyInfo, ProxyType
from .root_claim import RootClaimType
from .scheduled_coldkey_swap_info import ScheduledColdkeySwapInfo
Expand Down Expand Up @@ -63,7 +62,6 @@
"NeuronInfoLite",
"PrometheusInfo",
"ProposalCallData",
"ProposalVoteData",
"ProxyConstants",
"ProxyAnnouncementInfo",
"ProxyInfo",
Expand Down
27 changes: 0 additions & 27 deletions bittensor/core/chain_data/proposal_vote_data.py

This file was deleted.

35 changes: 1 addition & 34 deletions bittensor/core/subtensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
MetagraphInfo,
NeuronInfo,
NeuronInfoLite,
ProposalVoteData,

ProxyAnnouncementInfo,
ProxyConstants,
ProxyInfo,
Expand Down Expand Up @@ -4044,39 +4044,6 @@ def get_unstake_fee(
)
return sim_swap_result.alpha_fee.set_unit(netuid=netuid)

def get_vote_data(
self, proposal_hash: str, block: Optional[int] = None
) -> Optional["ProposalVoteData"]:
# TODO: is this all deprecated? Didn't subtensor senate stuff get removed?
"""
Retrieves the voting data for a specific proposal on the Bittensor blockchain. This data includes information
about how senate members have voted on the proposal.

Parameters:
proposal_hash: The hash of the proposal for which voting data is requested.
block: The blockchain block number for the query. If `None`, queries the current chain head.

Returns:
An object containing the proposal's voting data, or `None` if not found.

This function is important for tracking and understanding the decision-making processes within the Bittensor
network, particularly how proposals are received and acted upon by the governing body.
"""
vote_data = cast(
Optional[dict[str, Any]],
self.substrate.query(
module="Triumvirate",
storage_function="Voting",
params=[proposal_hash],
block_hash=self.determine_block_hash(block),
),
)

if vote_data is None:
return None

return ProposalVoteData.from_dict(vote_data)

def get_uid_for_hotkey_on_subnet(
self, hotkey_ss58: str, netuid: int, block: Optional[int] = None
) -> Optional[int]:
Expand Down
1 change: 0 additions & 1 deletion bittensor/extras/subtensor_api/chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ def __init__(self, subtensor: Union["_Subtensor", "_AsyncSubtensor"]):
self.get_minimum_required_stake = subtensor.get_minimum_required_stake
self.get_start_call_delay = subtensor.get_start_call_delay
self.get_timestamp = subtensor.get_timestamp
self.get_vote_data = subtensor.get_vote_data
self.is_fast_blocks = subtensor.is_fast_blocks
self.is_in_admin_freeze_window = subtensor.is_in_admin_freeze_window
self.last_drand_round = subtensor.last_drand_round
Expand Down
4 changes: 2 additions & 2 deletions bittensor/utils/easy_imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
ProxyType,
PrometheusInfo,
ProposalCallData,
ProposalVoteData,

ScheduledColdkeySwapInfo,
SelectiveMetagraphIndex,
StakeInfo,
Expand Down Expand Up @@ -167,7 +167,7 @@
"NeuronInfoLite",
"PrometheusInfo",
"ProposalCallData",
"ProposalVoteData",

"ScheduledColdkeySwapInfo",
"SelectiveMetagraphIndex",
"StakeInfo",
Expand Down
Loading