Skip to content

Commit eeabb53

Browse files
committed
Typing
1 parent b2cf95b commit eeabb53

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

async_substrate_interface/async_substrate.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,7 @@ async def decode_scale(
10151015
# Decode AccountId bytes to SS58 address
10161016
return ss58_encode(scale_bytes, self.ss58_format)
10171017
else:
1018-
if not runtime:
1018+
if runtime is None:
10191019
runtime = await self.init_runtime(block_hash=block_hash)
10201020
if runtime.metadata_v15 is not None and force_legacy is False:
10211021
obj = decode_by_type_string(type_string, runtime.registry, scale_bytes)
@@ -1318,7 +1318,7 @@ async def get_metadata_storage_functions(
13181318
Returns:
13191319
list of storage functions
13201320
"""
1321-
if not runtime:
1321+
if runtime is None:
13221322
runtime = await self.init_runtime(block_hash=block_hash)
13231323

13241324
storage_list = []
@@ -1356,7 +1356,7 @@ async def get_metadata_storage_function(
13561356
Returns:
13571357
Metadata storage function
13581358
"""
1359-
if not runtime:
1359+
if runtime is None:
13601360
runtime = await self.init_runtime(block_hash=block_hash)
13611361

13621362
pallet = runtime.metadata.get_metadata_pallet(module_name)
@@ -1377,7 +1377,7 @@ async def get_metadata_errors(
13771377
Returns:
13781378
list of errors in the metadata
13791379
"""
1380-
if not runtime:
1380+
if runtime is None:
13811381
runtime = await self.init_runtime(block_hash=block_hash)
13821382

13831383
error_list = []
@@ -1415,7 +1415,7 @@ async def get_metadata_error(
14151415
error
14161416
14171417
"""
1418-
if not runtime:
1418+
if runtime is None:
14191419
runtime = await self.init_runtime(block_hash=block_hash)
14201420

14211421
for module_idx, module in enumerate(runtime.metadata.pallets):
@@ -1433,7 +1433,7 @@ async def get_metadata_runtime_call_functions(
14331433
Returns:
14341434
list of runtime call functions
14351435
"""
1436-
if not runtime:
1436+
if runtime is None:
14371437
runtime = await self.init_runtime(block_hash=block_hash)
14381438
call_functions = []
14391439

@@ -1467,7 +1467,7 @@ async def get_metadata_runtime_call_function(
14671467
Returns:
14681468
GenericRuntimeCallDefinition
14691469
"""
1470-
if not runtime:
1470+
if runtime is None:
14711471
runtime = await self.init_runtime(block_hash=block_hash)
14721472

14731473
try:
@@ -2142,7 +2142,7 @@ async def _preprocess(
21422142
"""
21432143
params = query_for if query_for else []
21442144
# Search storage call in metadata
2145-
if not runtime:
2145+
if runtime is None:
21462146
runtime = self.runtime
21472147
metadata_pallet = runtime.metadata.get_metadata_pallet(module)
21482148

@@ -2504,7 +2504,7 @@ async def query_multiple(
25042504
block_hash = await self._get_current_block_hash(block_hash, reuse_block_hash)
25052505
if block_hash:
25062506
self.last_block_hash = block_hash
2507-
if not runtime:
2507+
if runtime is None:
25082508
runtime = await self.init_runtime(block_hash=block_hash)
25092509
preprocessed: tuple[Preprocessed] = await asyncio.gather(
25102510
*[
@@ -2562,7 +2562,7 @@ async def query_multi(
25622562
Returns:
25632563
list of `(storage_key, scale_obj)` tuples
25642564
"""
2565-
if not runtime:
2565+
if runtime is None:
25662566
runtime = await self.init_runtime(block_hash=block_hash)
25672567

25682568
# Retrieve corresponding value
@@ -2617,7 +2617,7 @@ async def create_scale_object(
26172617
Returns:
26182618
The created Scale Type object
26192619
"""
2620-
if not runtime:
2620+
if runtime is None:
26212621
runtime = await self.init_runtime(block_hash=block_hash)
26222622
if "metadata" not in kwargs:
26232623
kwargs["metadata"] = runtime.metadata
@@ -3160,7 +3160,7 @@ async def get_metadata_constant(
31603160
Returns:
31613161
MetadataModuleConstants
31623162
"""
3163-
if not runtime:
3163+
if runtime is None:
31643164
runtime = await self.init_runtime(block_hash=block_hash)
31653165

31663166
for module in runtime.metadata.pallets:
@@ -3361,7 +3361,7 @@ async def query(
33613361
block_hash = await self._get_current_block_hash(block_hash, reuse_block_hash)
33623362
if block_hash:
33633363
self.last_block_hash = block_hash
3364-
if not runtime:
3364+
if runtime is None:
33653365
runtime = await self.init_runtime(block_hash=block_hash)
33663366
preprocessed: Preprocessed = await self._preprocess(
33673367
params,

0 commit comments

Comments
 (0)