ether-camp / ethereum-sandbox

Ethereum Sandbox
GNU Affero General Public License v3.0
7 stars 8 forks source link

Sandbox hanging after changing sender account #19

Open ice09 opened 7 years ago

ice09 commented 7 years ago

Update: this happens even after changing account before the first call. So, changing account let me not call any function on a contract.

A contract hangs after activating a quite simple function when changing sending account.

Steps to reproduce:

  1. call a function of some contract in the sandbox
  2. open tab "Advanced"
  3. change sender to some other account
  4. close tab "Advanced"
  5. call function again

I always get "Got no transaction ... for 5 secs". And nothing happens after.

If you cannot reproduce, you can try at workspace "ethereum-meetup-mainz", project swap-contract.

asinyagin commented 7 years ago

@ice09 thanks for the report!

You have a wrong entry in the ethereum.json:

      "0xaefa01276783e1436e5b461c099edccb0448dcf6": {
        "balance": 1000000000000000000000000000000000000000000000000000000 ,
        "nonce": "0x1cf",
        "pkey": "cow", 
        "default": false
      }

The address is incorrect for the private key. So when the sandbox signs a transaction with this pkey, it sets sender to 0xcd2a3d9f938e13cd947ec05abc7fe734df8dd826. This account has no ether, but IDE doesn't show the error. So what we need to fix is displaying of the insufficient funds error in the contract dialog. Also, IDE probably should show an error when it gets wrong pkey in ethereum.json.

ice09 commented 7 years ago

Ok, makes sense to me since it C&P all the ethereum.json data. Is there an easy way to get 4-5 accounts with address/key combo? Do you have such a sample ethereum.json or can tell me how to create one?

asinyagin commented 7 years ago

It doesn't work even with a correct account. There's something else.

And it shows the error message correctly on my ide.

You can take https://github.com/ether-camp/default-ws/blob/master/example-project/ethereum.json or generate new pairs on https://live.ether.camp ("Get Address" button)

3esmit commented 7 years ago

This only happens when the private key is wrong.

ice09 commented 7 years ago

yep, works for me as well, so there was no bug, just the missing exception for wrong private key due to the old environment. so this was no bug.

3esmit commented 7 years ago

I think IDE should display an error message when try to run with wrong private-key.

asinyagin commented 7 years ago

Besides the wrong private key message there's a bug because of which the call from the first post hangs.

mkalinin commented 7 years ago

Now Studio updates address with a correct one If address specified in ethereum.json doesn't match provided private key. There is also corresponding message in Ethereum Console to notify the user.