@@ -1015,7 +1015,7 @@ async def decode_scale(
1015
1015
# Decode AccountId bytes to SS58 address
1016
1016
return ss58_encode (scale_bytes , self .ss58_format )
1017
1017
else :
1018
- if not runtime :
1018
+ if runtime is None :
1019
1019
runtime = await self .init_runtime (block_hash = block_hash )
1020
1020
if runtime .metadata_v15 is not None and force_legacy is False :
1021
1021
obj = decode_by_type_string (type_string , runtime .registry , scale_bytes )
@@ -1318,7 +1318,7 @@ async def get_metadata_storage_functions(
1318
1318
Returns:
1319
1319
list of storage functions
1320
1320
"""
1321
- if not runtime :
1321
+ if runtime is None :
1322
1322
runtime = await self .init_runtime (block_hash = block_hash )
1323
1323
1324
1324
storage_list = []
@@ -1356,7 +1356,7 @@ async def get_metadata_storage_function(
1356
1356
Returns:
1357
1357
Metadata storage function
1358
1358
"""
1359
- if not runtime :
1359
+ if runtime is None :
1360
1360
runtime = await self .init_runtime (block_hash = block_hash )
1361
1361
1362
1362
pallet = runtime .metadata .get_metadata_pallet (module_name )
@@ -1377,7 +1377,7 @@ async def get_metadata_errors(
1377
1377
Returns:
1378
1378
list of errors in the metadata
1379
1379
"""
1380
- if not runtime :
1380
+ if runtime is None :
1381
1381
runtime = await self .init_runtime (block_hash = block_hash )
1382
1382
1383
1383
error_list = []
@@ -1415,7 +1415,7 @@ async def get_metadata_error(
1415
1415
error
1416
1416
1417
1417
"""
1418
- if not runtime :
1418
+ if runtime is None :
1419
1419
runtime = await self .init_runtime (block_hash = block_hash )
1420
1420
1421
1421
for module_idx , module in enumerate (runtime .metadata .pallets ):
@@ -1433,7 +1433,7 @@ async def get_metadata_runtime_call_functions(
1433
1433
Returns:
1434
1434
list of runtime call functions
1435
1435
"""
1436
- if not runtime :
1436
+ if runtime is None :
1437
1437
runtime = await self .init_runtime (block_hash = block_hash )
1438
1438
call_functions = []
1439
1439
@@ -1467,7 +1467,7 @@ async def get_metadata_runtime_call_function(
1467
1467
Returns:
1468
1468
GenericRuntimeCallDefinition
1469
1469
"""
1470
- if not runtime :
1470
+ if runtime is None :
1471
1471
runtime = await self .init_runtime (block_hash = block_hash )
1472
1472
1473
1473
try :
@@ -2142,7 +2142,7 @@ async def _preprocess(
2142
2142
"""
2143
2143
params = query_for if query_for else []
2144
2144
# Search storage call in metadata
2145
- if not runtime :
2145
+ if runtime is None :
2146
2146
runtime = self .runtime
2147
2147
metadata_pallet = runtime .metadata .get_metadata_pallet (module )
2148
2148
@@ -2504,7 +2504,7 @@ async def query_multiple(
2504
2504
block_hash = await self ._get_current_block_hash (block_hash , reuse_block_hash )
2505
2505
if block_hash :
2506
2506
self .last_block_hash = block_hash
2507
- if not runtime :
2507
+ if runtime is None :
2508
2508
runtime = await self .init_runtime (block_hash = block_hash )
2509
2509
preprocessed : tuple [Preprocessed ] = await asyncio .gather (
2510
2510
* [
@@ -2562,7 +2562,7 @@ async def query_multi(
2562
2562
Returns:
2563
2563
list of `(storage_key, scale_obj)` tuples
2564
2564
"""
2565
- if not runtime :
2565
+ if runtime is None :
2566
2566
runtime = await self .init_runtime (block_hash = block_hash )
2567
2567
2568
2568
# Retrieve corresponding value
@@ -2617,7 +2617,7 @@ async def create_scale_object(
2617
2617
Returns:
2618
2618
The created Scale Type object
2619
2619
"""
2620
- if not runtime :
2620
+ if runtime is None :
2621
2621
runtime = await self .init_runtime (block_hash = block_hash )
2622
2622
if "metadata" not in kwargs :
2623
2623
kwargs ["metadata" ] = runtime .metadata
@@ -3160,7 +3160,7 @@ async def get_metadata_constant(
3160
3160
Returns:
3161
3161
MetadataModuleConstants
3162
3162
"""
3163
- if not runtime :
3163
+ if runtime is None :
3164
3164
runtime = await self .init_runtime (block_hash = block_hash )
3165
3165
3166
3166
for module in runtime .metadata .pallets :
@@ -3361,7 +3361,7 @@ async def query(
3361
3361
block_hash = await self ._get_current_block_hash (block_hash , reuse_block_hash )
3362
3362
if block_hash :
3363
3363
self .last_block_hash = block_hash
3364
- if not runtime :
3364
+ if runtime is None :
3365
3365
runtime = await self .init_runtime (block_hash = block_hash )
3366
3366
preprocessed : Preprocessed = await self ._preprocess (
3367
3367
params ,
0 commit comments