31
31
encode as encode_by_type_string ,
32
32
)
33
33
from scalecodec .base import ScaleBytes , ScaleType , RuntimeConfigurationObject
34
- from scalecodec .types import (
34
+ from scalecodec .types import (
35
35
GenericCall ,
36
36
GenericExtrinsic ,
37
37
GenericRuntimeCallDefinition ,
@@ -710,7 +710,7 @@ def __init__(
710
710
self .runtime_config = RuntimeConfigurationObject (
711
711
ss58_format = self .ss58_format , implements_scale_info = True
712
712
)
713
- self .__metadata_cache = {}
713
+ self ._metadata_cache = {}
714
714
self ._nonces = {}
715
715
self .metadata_version_hex = "0x0f000000" # v15
716
716
self .reload_type_registry ()
@@ -2614,7 +2614,7 @@ async def get_account_next_index(self, account_address: str) -> int:
2614
2614
"""
2615
2615
This method maintains a cache of nonces for each account ss58address.
2616
2616
Upon subsequent calls, it will return the cached nonce + 1 instead of fetching from the chain.
2617
- This allows for correct nonce management in-case of async context when gathering co-routines.
2617
+ This allows for correct nonce management in-case of async context when gathering co-routines.
2618
2618
2619
2619
Args:
2620
2620
account_address: SS58 formatted address
@@ -2628,7 +2628,9 @@ async def get_account_next_index(self, account_address: str) -> int:
2628
2628
2629
2629
async with self ._lock :
2630
2630
if self ._nonces .get (account_address ) is None :
2631
- nonce_obj = await self .rpc_request ("account_nextIndex" , [account_address ])
2631
+ nonce_obj = await self .rpc_request (
2632
+ "account_nextIndex" , [account_address ]
2633
+ )
2632
2634
self ._nonces [account_address ] = nonce_obj ["result" ]
2633
2635
else :
2634
2636
self ._nonces [account_address ] += 1
0 commit comments