Skip to content

Commit 1189d6e

Browse files
author
µ
committed
async_substrate.py: in init_runtime(), short circuit when runtime_version is already loaded
1 parent 2ca828d commit 1189d6e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

async_substrate_interface/async_substrate.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -992,6 +992,9 @@ async def init_runtime(
992992
f"No runtime information for block '{block_hash}'"
993993
)
994994

995+
if runtime_version == self.runtime_version:
996+
return
997+
995998
runtime = self.runtime_cache.retrieve(runtime_version=runtime_version)
996999
if not runtime or runtime.metadata is None:
9971000
self.last_block_hash = block_hash

0 commit comments

Comments
 (0)