diff --git a/bittensor/core/metagraph.py b/bittensor/core/metagraph.py index b5b958b93f..20c18db41c 100644 --- a/bittensor/core/metagraph.py +++ b/bittensor/core/metagraph.py @@ -1493,6 +1493,11 @@ class Metagraph(AsyncMetagraph): This class provides a synchronous interface to interact with an asynchronous metagraph. It is initialized with configuration related to the network and provides methods for synchronizing and accessing asynchronous metagraph attributes. + + If you want to get the description of any method from the `bittensor.core.metagraph.Metagraph` class, then simply + get the corresponding method from the `bittensor.core.metagraph.AsyncMetagraph` class. + `AsyncMetagraph` is the class related with `AsyncTorchMetaGraph` or `AsyncNonTorchMetagraph` depending on the use + of the use of the env var `USE_TORCH` """ def __init__( diff --git a/bittensor/core/subtensor.py b/bittensor/core/subtensor.py index 653da8c2b0..152ec9a391 100644 --- a/bittensor/core/subtensor.py +++ b/bittensor/core/subtensor.py @@ -29,6 +29,13 @@ class Subtensor: + """ + Represents a synchronous interface for `bittensor.core.async_subtensor.AsyncSubtensor`. + + If you want to get the description of any method from the `bittensor.core.subtensor.Subtensor` class, then simply + get the corresponding method from the `bittensor.core.async_subtensor.AsyncSubtensor` class. + """ + # get static methods from AsyncSubtensor config = AsyncSubtensor.config setup_config = AsyncSubtensor.setup_config @@ -381,6 +388,15 @@ def get_total_stake_for_coldkey( ) return result + def get_total_stake_for_coldkeys( + self, *ss58_addresses: str, block: Optional[int] = None + ) -> dict[str, "Balance"]: + return self.execute_coroutine( + self.async_subtensor.get_total_stake_for_coldkeys( + *ss58_addresses, block=block + ), + ) + def get_total_stake_for_hotkey( self, ss58_address: str, block: Optional[int] = None ) -> "Balance": @@ -389,6 +405,15 @@ def get_total_stake_for_hotkey( ) return result + def get_total_stake_for_hotkeys( + self, *ss58_addresses: str, block: Optional[int] = None + ) -> dict[str, "Balance"]: + return self.execute_coroutine( + self.async_subtensor.get_total_stake_for_hotkeys( + *ss58_addresses, block=block + ), + ) + def get_total_subnets(self, block: Optional[int] = None) -> Optional[int]: return self.execute_coroutine( self.async_subtensor.get_total_subnets(block=block), diff --git a/tests/unit_tests/test_subtensor.py b/tests/unit_tests/test_subtensor.py index ee7d3c82b0..bdf6f9720e 100644 --- a/tests/unit_tests/test_subtensor.py +++ b/tests/unit_tests/test_subtensor.py @@ -20,8 +20,6 @@ def test_methods_comparable(mocker): "encode_params", "get_hyperparameter", "sign_and_send_extrinsic", - "get_total_stake_for_coldkeys", - "get_total_stake_for_hotkeys", ] subtensor_methods = [ m