From 5c6dd994ec3a253915f252dc3ffe916934b11e98 Mon Sep 17 00:00:00 2001 From: Arjan Zijderveld Date: Thu, 26 Nov 2020 12:33:30 +0100 Subject: [PATCH] Added possibility to provide existing runtime configuration --- substrateinterface/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/substrateinterface/__init__.py b/substrateinterface/__init__.py index 261c876..f7e5da1 100644 --- a/substrateinterface/__init__.py +++ b/substrateinterface/__init__.py @@ -370,7 +370,7 @@ def __repr__(self): class SubstrateInterface: def __init__(self, url=None, websocket=None, ss58_format=None, type_registry=None, type_registry_preset=None, - cache_region=None, address_type=None): + cache_region=None, address_type=None, runtime_config=None): """ A specialized class in interfacing with a Substrate node. @@ -430,7 +430,11 @@ def __init__(self, url=None, websocket=None, ss58_format=None, type_registry=Non self.metadata_cache = {} self.type_registry_cache = {} - self.runtime_config = RuntimeConfigurationObject() + + if not runtime_config: + runtime_config = RuntimeConfigurationObject() + + self.runtime_config = runtime_config self.debug = False