Skip to content

Commit

Permalink
Looks like private key format has changed between versions
Browse files Browse the repository at this point in the history
  • Loading branch information
miohtama committed Sep 24, 2019
1 parent 9e1143d commit 8835c88
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sto/ethereum/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ def create_account_console(logger: Logger, network: str):

acc = Account.create()
private_key = to_hex(acc.privateKey)

if private_key.startswith("0x"):
# Looks like this behaves differently in different versions,
# we assume no 0x prefix for private key to distinguish it from addresses
# and hashes
private_key = private_key[2:]

logger.info("Account address: %s", acc.address)
logger.info("Account private key: %s", private_key)

Expand Down

0 comments on commit 8835c88

Please sign in to comment.