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
8 changes: 4 additions & 4 deletions async_substrate_interface/async_substrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import websockets.exceptions
from bt_decode import MetadataV15, PortableRegistry, decode as decode_by_type_string
from scalecodec import GenericVariant
from scalecodec.base import ScaleBytes, ScaleType, RuntimeConfigurationObject
from scalecodec.type_registry import load_type_registry_preset
from scalecodec.types import (
Expand Down Expand Up @@ -3912,18 +3913,17 @@ async def get_metadata_call_function(
module_name: str,
call_function_name: str,
block_hash: Optional[str] = None,
) -> Optional[list]:
) -> Optional[GenericVariant]:
"""
Retrieves a list of all call functions in metadata active for given block_hash (or chaintip if block_hash
is omitted)
Retrieves specified call from the metadata at the block specified, or the chain tip if omitted.

Args:
module_name: name of the module
call_function_name: name of the call function
block_hash: optional block hash

Returns:
list of call functions
The dict-like call definition, if found. None otherwise.
"""
runtime = await self.init_runtime(block_hash=block_hash)

Expand Down
8 changes: 4 additions & 4 deletions async_substrate_interface/sync_substrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
GenericRuntimeCallDefinition,
ss58_encode,
MultiAccountId,
GenericVariant,
)
from scalecodec.base import ScaleBytes, ScaleType
from websockets.sync.client import connect, ClientConnection
Expand Down Expand Up @@ -3290,18 +3291,17 @@ def get_metadata_call_function(
module_name: str,
call_function_name: str,
block_hash: Optional[str] = None,
) -> Optional[list]:
) -> Optional[GenericVariant]:
"""
Retrieves a list of all call functions in metadata active for given block_hash (or chaintip if block_hash
is omitted)
Retrieves specified call from the metadata at the block specified, or the chain tip if omitted.

Args:
module_name: name of the module
call_function_name: name of the call function
block_hash: optional block hash

Returns:
list of call functions
The dict-like call definition, if found. None otherwise.
"""
self.init_runtime(block_hash=block_hash)

Expand Down
Loading