Skip to content

Commit d0b5970

Browse files
authored
Merge pull request #199 from opentensor/fix/thewhaleking/return-type-annotation
return type annotation for `get_metadata_call_function`
2 parents 5452877 + d033455 commit d0b5970

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

async_substrate_interface/async_substrate.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
import websockets.exceptions
2626
from bt_decode import MetadataV15, PortableRegistry, decode as decode_by_type_string
27+
from scalecodec import GenericVariant
2728
from scalecodec.base import ScaleBytes, ScaleType, RuntimeConfigurationObject
2829
from scalecodec.type_registry import load_type_registry_preset
2930
from scalecodec.types import (
@@ -3912,18 +3913,17 @@ async def get_metadata_call_function(
39123913
module_name: str,
39133914
call_function_name: str,
39143915
block_hash: Optional[str] = None,
3915-
) -> Optional[list]:
3916+
) -> Optional[GenericVariant]:
39163917
"""
3917-
Retrieves a list of all call functions in metadata active for given block_hash (or chaintip if block_hash
3918-
is omitted)
3918+
Retrieves specified call from the metadata at the block specified, or the chain tip if omitted.
39193919
39203920
Args:
39213921
module_name: name of the module
39223922
call_function_name: name of the call function
39233923
block_hash: optional block hash
39243924
39253925
Returns:
3926-
list of call functions
3926+
The dict-like call definition, if found. None otherwise.
39273927
"""
39283928
runtime = await self.init_runtime(block_hash=block_hash)
39293929

async_substrate_interface/sync_substrate.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
GenericRuntimeCallDefinition,
1414
ss58_encode,
1515
MultiAccountId,
16+
GenericVariant,
1617
)
1718
from scalecodec.base import ScaleBytes, ScaleType
1819
from websockets.sync.client import connect, ClientConnection
@@ -3290,18 +3291,17 @@ def get_metadata_call_function(
32903291
module_name: str,
32913292
call_function_name: str,
32923293
block_hash: Optional[str] = None,
3293-
) -> Optional[list]:
3294+
) -> Optional[GenericVariant]:
32943295
"""
3295-
Retrieves a list of all call functions in metadata active for given block_hash (or chaintip if block_hash
3296-
is omitted)
3296+
Retrieves specified call from the metadata at the block specified, or the chain tip if omitted.
32973297
32983298
Args:
32993299
module_name: name of the module
33003300
call_function_name: name of the call function
33013301
block_hash: optional block hash
33023302
33033303
Returns:
3304-
list of call functions
3304+
The dict-like call definition, if found. None otherwise.
33053305
"""
33063306
self.init_runtime(block_hash=block_hash)
33073307

0 commit comments

Comments
 (0)