Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

Web3 must set a defaultAccount #32

Open
dmihal opened this issue May 16, 2020 · 2 comments
Open

Web3 must set a defaultAccount #32

dmihal opened this issue May 16, 2020 · 2 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@dmihal
Copy link

dmihal commented May 16, 2020

When trying to run through a deposit, I ran into an issue where transactions can't be sent because web3.eth.defaultAccount wasn't set.

I don't think its a common practice for devs to set this value, at least I've never used it.

Options to address this would be:

  • Update the documentation, making it clear that this value should be set
  • Query web3.eth.getAccounts() and use account[0]
@liamzebedee
Copy link
Contributor

@Shadowfiend what do you think? I'm comfortable with option 2.

@liamzebedee liamzebedee added documentation Improvements or additions to documentation enhancement New feature or request labels May 20, 2020
@Shadowfiend
Copy link
Contributor

I think the move here is to provide the ability to specify an account in config, fall back on defaultAccount, and throw if neither is set rather than implicitly guessing---particularly when there's already a mechanism to spare us the guess in defaultAccount.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants