From 9f57d253759e24a89847cf313c021ed931fcebd1 Mon Sep 17 00:00:00 2001 From: philogicae Date: Wed, 28 Aug 2024 15:21:44 +0300 Subject: [PATCH 1/2] Fix _load_account when both string & path private key are provided --- src/aleph/sdk/account.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/aleph/sdk/account.py b/src/aleph/sdk/account.py index 6ec08c83..4b7ae6f7 100644 --- a/src/aleph/sdk/account.py +++ b/src/aleph/sdk/account.py @@ -30,14 +30,7 @@ def _load_account( private_key_path: Optional[Path] = None, account_type: Type[AccountFromPrivateKey] = ETHAccount, ) -> AccountFromPrivateKey: - """Load private key from a string or a file. - - Only keys that accounts that can be initiated from a - """ - - assert not ( - private_key_str and private_key_path - ), "Private key should be a string or a filepath, not both." + """Load private key from a string or a file.""" if private_key_str: logger.debug("Using account from string") From 31ccb74e0116fc9d29a983705070ab44affd59e7 Mon Sep 17 00:00:00 2001 From: Olivier Le Thanh Duong Date: Wed, 28 Aug 2024 15:47:54 +0200 Subject: [PATCH 2/2] Update src/aleph/sdk/account.py --- src/aleph/sdk/account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aleph/sdk/account.py b/src/aleph/sdk/account.py index 4b7ae6f7..59eef815 100644 --- a/src/aleph/sdk/account.py +++ b/src/aleph/sdk/account.py @@ -30,7 +30,7 @@ def _load_account( private_key_path: Optional[Path] = None, account_type: Type[AccountFromPrivateKey] = ETHAccount, ) -> AccountFromPrivateKey: - """Load private key from a string or a file.""" + """Load private key from a string or a file. takes the string argument in priority""" if private_key_str: logger.debug("Using account from string")