Skip to content

Commit

Permalink
Fix: blakc issue
Browse files Browse the repository at this point in the history
  • Loading branch information
1yam committed Sep 30, 2024
1 parent 2811afe commit 59c845e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/aleph/sdk/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,19 @@ async def get_chain_account(name: str) -> ChainAccount:
raise ValueError(f"Account with name {name} not found.")


async def get_chain_account_from_path(path: str) -> ChainAccount:
"""Retrieve a chain account by name from the JSON file."""
accounts = await load_json(settings.CHAINS_CONFIG_FILE)

for account in accounts:
if account["path"] == path:
logger.debug(f"Found account with the path : {path}.")
return ChainAccount(**account)

logger.error(f"Account with name {path} not found.")
raise ValueError(f"Account with name {path} not found.")


async def update_chain_account(updated_account: ChainAccount):
"""Update an existing chain account in the JSON file."""
accounts = await load_json(settings.CHAINS_CONFIG_FILE)
Expand Down

0 comments on commit 59c845e

Please sign in to comment.