commit 3ecf81209f01297508238bcc390bf612bdd9828a
parent abd61e24c29971ee78b4b305fa62934bac843055
Author: lash <dev@holbrook.no>
Date: Sat, 11 Feb 2023 12:43:09 +0000
Add dialect module load in settings
Diffstat:
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/chainlib/settings.py b/chainlib/settings.py
@@ -25,6 +25,14 @@ class ChainSettings:
return s
+def process_settings_dialect(settings, config):
+ if config.get('RPC_DIALECT') != 'default':
+ import importlib
+ m = importlib.import_module(config.get('RPC_DIALECT'))
+ settings.set('RPC_DIALECT_FILTER', m.DialectFilter())
+ return settings
+
+
def process_settings_common(settings, config):
chain_spec = ChainSpec.from_chain_str(config.get('CHAIN_SPEC'))
settings.set('CHAIN_SPEC', chain_spec)
@@ -47,4 +55,5 @@ def process_settings_value(settings, config):
def process_settings(settings, config):
settings = process_settings_common(settings, config)
settings = process_settings_value(settings, config)
+ settings = process_settings_dialect(settings, config)
return settings
diff --git a/setup.cfg b/setup.cfg
@@ -3,8 +3,8 @@ name=chainlib
license=AGPLv3+
author_email=dev@holbrook.no
description=Generic blockchain access library and tooling
-version=0.4.5
-url=https://git.defalsify.org/chaintool.git
+version=0.4.6
+url=https://git.defalsify.org/chainlib
author=Louis Holbrook
keywords =