aleph-im / aleph-client

Lightweight Python Client library for the Aleph.im network

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't use private key instead of private key file parameter in cli mode

simbadchains opened this issue · comments

There is a problem when loading the account in block lines 39-41 in account.py while provided private key as parameter (--private-key TEXT). The private_key_path in the _load_account function is passed from settings.PRIVATE_KEY_FILE which has a default value (device.key). So, whenever I try to pass private key as text in the cli, the default value of the private_key_path is passed as well, invoking the assert "Private key should be a string or a filepath, not both.".

Solution, the assert should check if private_key_path is the default value, if it is the default value and private_key_str is populated, then nullify the private_key_path so private_key_str is taken into consideration along the line (line 43 in account.py).

Hi @simbadchains

can you share with us:

  • Your platform
  • The version of the Aleph client
  • The command that produces the problem

Thank's