aeternity / aepp-sdk-python

Python SDK for the Æternity blockchain
https://aepp-sdk-python.readthedocs.io/
ISC License
24 stars 16 forks source link

Error: Invalid public key, just does NOT work #93

Closed eLvErDe closed 5 years ago

eLvErDe commented 5 years ago

Hello,

Here is what I just did with 1.1.1 freshly installed:

aecli account create test
Enter the account password []: 
<account>
  Address ___________________________________________ ak_b'EnvNWbub5PJAF6M4UiY7HbZymtaWkr1dU5gfxLLCxNWFV54zz'
  Path ______________________________________________ /data/cryptowallets/aeternity/wallet/test
</account>

Then I try to check my balance:

aecli account balance test
Enter the account password []: 
Error: Invalid public key

Problem is the same is happening with a real account I have with token owned by the address, so I'm still wondering if the coin are lost or not......

That's a serious issue...

noandrea commented 5 years ago

Hello, I cant reproduce this error, but I see that the address is printed in the wrong way. Which version of python are you using?

(the tokens are not lost)

eLvErDe commented 5 years ago

Yes it's a bytes / str issue. I'll check in next hours but it's probably 3.7

eLvErDe commented 5 years ago

BTW, it's stored that way in json too

eLvErDe commented 5 years ago

Python 3.6.7, fixing json public_key to remove b'' does not change anything

noandrea commented 5 years ago

I have just played this scenario where I create a test account and top up with tokens and I haven't encountered your issue.

What OS are you using?

Here is the output from my terminal


 …/i93 $ export EPOCH_URL=https://sdk-testnet.aepps.com
 …/i93 $ aecli config
<aecli settings>
  Epoch url _________________________________________ https://sdk-testnet.aepps.com
</aecli settings>
 …/i93 $ aecli account create test
Enter the account password []: 
<account>
  Address ___________________________________________ ak_YbEbNYD9MCJyuqW2a7qBSNNSYuraWD93i4K2uU7nppKPhdGYP
  Path ______________________________________________ /Users/andrea/tmp/aeternity/support/i93/test
</account>
 …/i93 $ aecli account balance test
Enter the account password []: 
Error: Account not found
 …/i93 $ aecli account spend PATH/TO/KEY ak_YbEbNYD9MCJyuqW2a7qBSNNSYuraWD93i4K2uU7nppKPhdGYP 200000000000  --network-id ae_uat 
Enter the account password []: 
<spend transaction>
  Sender account ____________________________________ ak_2iBPH7HUz3cSDVEUWiHg76MZJ6tZooVNBmmxcgVK6VV8KAE688
  Recipient account _________________________________ ak_YbEbNYD9MCJyuqW2a7qBSNNSYuraWD93i4K2uU7nppKPhdGYP
  Unsigned __________________________________________ tx_+FUMAaEB4TK48d23oE5jt/qWR5pUu8UlpTGn8bwM5JISGQMGf7ChAUe6weupgBDI49+vwvbwmrDniIALi6Dknceji9uDTYTOhS6Q7dAAgk4ggjIZgY6Ann3Xeg==
  Signed ____________________________________________ tx_+J8LAfhCuECpj66t6Wm4+kMKmQuJb0OLOOXozhDrVHiofDif/3xZycOfq8tQiWHS9pmtyGFO9Ki4N7gL6DhH503GeX4XFcwDuFf4VQwBoQHhMrjx3begTmO3+pZHmlS7xSWlMafxvAzkkhIZAwZ/sKEBR7rB66mAEMjj36/C9vCasOeIgAuLoOSdx6OL24NNhM6FLpDt0ACCTiCCMhmBjoBX5dyi
  Hash ______________________________________________ th_21hi5w93rB8FgL2PLCSPXivvQvjZQCwFadVM6w4SSyNCURnWCg
</spend transaction>
 …/i93 $ aecli account balance test
Enter the account password []: 
<account>
  Balance ___________________________________________ 200000000000
  Id ________________________________________________ ak_YbEbNYD9MCJyuqW2a7qBSNNSYuraWD93i4K2uU7nppKPhdGYP
  Nonce _____________________________________________ 0
</account>
 …/i93 $ python --version
Python 3.6.4
 …/i93 $ aecli --version
aecli, version 1.1.1
 …/i93 $ aecli chain status
<none>
  Difficulty ________________________________________ 147004955
  Genesis key block hash ____________________________ kh_wUCideEB8aDtUaiHCtKcfywU6oHZW6gnyci8Mw6S1RSTCnCRu
  Listening _________________________________________ True
  Network id ________________________________________ ae_uat
  Node revision _____________________________________ 4d589edcd66e6b489902df51151cd4260ce4d001
  Node version ______________________________________ 1.1.0
  Peer count ________________________________________ 562
  Pending transactions count ________________________ 0
  <protocols 1>
    <protocol #1>
      Effective at height ___________________________ 0
      Version _______________________________________ 1
    </protocol #1>
  Solutions _________________________________________ 0
  Syncing ___________________________________________ True
</none>
 …/i93 $      
noandrea commented 5 years ago

closing since not relevant anymore