|
22 | 22 | ) |
23 | 23 |
|
24 | 24 | import asyncstdlib as a |
25 | | -from bittensor_wallet.keypair import Keypair |
26 | | -from bittensor_wallet.utils import SS58_FORMAT |
27 | 25 | from bt_decode import MetadataV15, PortableRegistry, decode as decode_by_type_string |
28 | 26 | from scalecodec.base import ScaleBytes, ScaleType, RuntimeConfigurationObject |
29 | 27 | from scalecodec.types import ( |
|
35 | 33 | from websockets.asyncio.client import connect |
36 | 34 | from websockets.exceptions import ConnectionClosed |
37 | 35 |
|
| 36 | +from async_substrate_interface.const import SS58_FORMAT |
38 | 37 | from async_substrate_interface.errors import ( |
39 | 38 | SubstrateRequestException, |
40 | 39 | ExtrinsicNotFound, |
41 | 40 | BlockNotFound, |
42 | 41 | ) |
| 42 | +from async_substrate_interface.protocols import Keypair |
43 | 43 | from async_substrate_interface.types import ( |
44 | 44 | ScaleObj, |
45 | 45 | RequestManager, |
@@ -2406,6 +2406,8 @@ async def create_signed_extrinsic( |
2406 | 2406 |
|
2407 | 2407 | # Sign payload |
2408 | 2408 | signature = keypair.sign(signature_payload) |
| 2409 | + if inspect.isawaitable(signature): |
| 2410 | + signature = await signature |
2409 | 2411 |
|
2410 | 2412 | # Create extrinsic |
2411 | 2413 | extrinsic = self.runtime_config.create_scale_object( |
@@ -2692,9 +2694,6 @@ async def get_payment_info( |
2692 | 2694 | if not isinstance(call, GenericCall): |
2693 | 2695 | raise TypeError("'call' must be of type Call") |
2694 | 2696 |
|
2695 | | - if not isinstance(keypair, Keypair): |
2696 | | - raise TypeError("'keypair' must be of type Keypair") |
2697 | | - |
2698 | 2697 | # No valid signature is required for fee estimation |
2699 | 2698 | signature = "0x" + "00" * 64 |
2700 | 2699 |
|
|
0 commit comments