From 0b545d353043a07e5f0fdf3d1a6edd92956b11ba Mon Sep 17 00:00:00 2001 From: 1yam Date: Mon, 30 Sep 2024 13:37:28 +0200 Subject: [PATCH] fixup! Feature: Internal account management + fix on _load_account to handle SolAccount --- src/aleph/sdk/conf.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/aleph/sdk/conf.py b/src/aleph/sdk/conf.py index a68f9993..354ad849 100644 --- a/src/aleph/sdk/conf.py +++ b/src/aleph/sdk/conf.py @@ -31,7 +31,7 @@ class Settings(BaseSettings): ) PRIVATE_KEY_STRING: Optional[str] = None - API_HOST: str = "https://api2.aleph.im/" + API_HOST: str = "https://api2.aleph.im" MAX_INLINE_SIZE: int = 50000 API_UNIX_SOCKET: Optional[str] = None REMOTE_CRYPTO_HOST: Optional[str] = None @@ -167,3 +167,13 @@ class Config: settings.PRIVATE_MNEMONIC_FILE = Path( settings.CONFIG_HOME, "private-keys", "substrate.mnemonic" ) + +# Update CHAINS settings and remove placeholders +CHAINS_ENV = [(key[7:], value) for key, value in settings if key.startswith("CHAINS_")] +for fields, value in CHAINS_ENV: + if value: + chain, field = fields.split("_", 1) + chain = chain if chain not in Chain.__members__ else Chain[chain] + field = field.lower() + settings.CHAINS[chain].__dict__[field] = value + settings.__delattr__(f"CHAINS_{fields}")