superblocks-lab icon indicating copy to clipboard operation
superblocks-lab copied to clipboard

Remove internal use Ethereum account from accounts data

Open filippsen opened this issue 6 years ago • 0 comments

Environment/Browser

Version 1.4.3

Description

Account index mismatch when retrieving accounts calling web3.eth.getAccounts.

Steps to reproduce

  1. Edit app.js to call: this.web3.eth.getAccounts(function(err,res){console.error(err);console.log(res);});
  2. Observe the value of res

Other tests:

accounts = await web3.eth.getAccounts()
account = accounts[1] // default dev/ deployer

Expected result

Expected the first account to be of index 0 instead of 1. The first account is 0xa48F2e0b... for the current seed (default).

default account is 0xa48F.. instead of 0x620...

Actual result

["0x620CB...", "0xa48F2e0b...", ... ]

The account address 0x620... is used internally and ends up (manually) added as part of the accounts list.

Hints and guidelines

Remove the inclusion of the 0x620... account address to the _accounts data in init procedure (evm.js file). The _accounts data is a table serving as reference to the accounts list implementation (getAccounts and consequentlyeth_accounts)

This change impacts estimateGas and call, which will need to adapt to read the key from elsewhere e.g. a global constant or simply inline it.

filippsen avatar Jan 04 '19 17:01 filippsen