@@ -1796,7 +1796,7 @@ async def get_next_epoch_start_block(
1796
1796
netuid = netuid , block = block , block_hash = block_hash , reuse_block = reuse_block
1797
1797
)
1798
1798
1799
- if block and blocks_since_last_step and tempo :
1799
+ if block and blocks_since_last_step is not None and tempo :
1800
1800
return block - blocks_since_last_step + tempo + 1
1801
1801
return None
1802
1802
@@ -1921,6 +1921,42 @@ async def get_stake_add_fee(
1921
1921
)
1922
1922
return Balance .from_rao (result )
1923
1923
1924
+ async def get_subnet_info (
1925
+ self ,
1926
+ netuid : int ,
1927
+ block : Optional [int ] = None ,
1928
+ block_hash : Optional [str ] = None ,
1929
+ reuse_block : bool = False ,
1930
+ ) -> Optional ["SubnetInfo" ]:
1931
+ """
1932
+ Retrieves detailed information about subnet within the Bittensor network.
1933
+ This function provides comprehensive data on subnet, including its characteristics and operational parameters.
1934
+
1935
+ Arguments:
1936
+ netuid: The unique identifier of the subnet.
1937
+ block: The blockchain block number for the query.
1938
+ block_hash (Optional[str]): The hash of the block to retrieve the stake from. Do not specify if using block
1939
+ or reuse_block
1940
+ reuse_block (bool): Whether to use the last-used block. Do not set if using block_hash or block.
1941
+
1942
+ Returns:
1943
+ SubnetInfo: A SubnetInfo objects, each containing detailed information about a subnet.
1944
+
1945
+ Gaining insights into the subnet's details assists in understanding the network's composition, the roles of
1946
+ different subnets, and their unique features.
1947
+ """
1948
+ result = await self .query_runtime_api (
1949
+ runtime_api = "SubnetInfoRuntimeApi" ,
1950
+ method = "get_subnet_info_v2" ,
1951
+ params = [netuid ],
1952
+ block = block ,
1953
+ block_hash = block_hash ,
1954
+ reuse_block = reuse_block ,
1955
+ )
1956
+ if not result :
1957
+ return None
1958
+ return SubnetInfo .from_dict (result )
1959
+
1924
1960
async def get_unstake_fee (
1925
1961
self ,
1926
1962
amount : Balance ,
@@ -2286,7 +2322,7 @@ async def get_transfer_fee(
2286
2322
2287
2323
call = await self .substrate .compose_call (
2288
2324
call_module = "Balances" ,
2289
- call_function = "transfer_allow_death " ,
2325
+ call_function = "transfer_keep_alive " ,
2290
2326
call_params = {"dest" : dest , "value" : value .rao },
2291
2327
)
2292
2328
0 commit comments