From 8835c885acb8541f4a4fe3b0e00a9172ac053878 Mon Sep 17 00:00:00 2001 From: Mikko Ohtamaa Date: Tue, 24 Sep 2019 12:44:22 +0200 Subject: [PATCH] Looks like private key format has changed between versions --- sto/ethereum/account.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sto/ethereum/account.py b/sto/ethereum/account.py index 2e6a8ea..05c3e43 100644 --- a/sto/ethereum/account.py +++ b/sto/ethereum/account.py @@ -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)