Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

web3.eth.accounts.wallet errors when using #2647

Closed
winter38 opened this issue Apr 4, 2019 · 1 comment · Fixed by #2648
Closed

web3.eth.accounts.wallet errors when using #2647

winter38 opened this issue Apr 4, 2019 · 1 comment · Fixed by #2648
Labels
Bug Addressing a bug

Comments

@winter38
Copy link

winter38 commented Apr 4, 2019

web3.eth.accounts.wallet errors when using

I'm trying update lib to new version and got errors with wallet. I am not sure if errors was described before, but i got those, when i work with wallet (works fine with beta-33 web3.js version).

Actual behavior

web3.eth.accounts.wallet.add(privateKey);
web3.eth.accounts.wallet.save('password', 'key');
->Error: TypeError: this.accounts[i] is undefined

When i try to load (this wallet was stored with old version of web3.js)

web3.eth.accounts.wallet.load('password', 'key');
SyntaxError: "JSON.parse: unexpected character at line 1 column 1 of the JSON data"
    fromV3Keystore web3-eth-accounts.umd.js:151
    decrypt web3-eth-accounts.umd.js:266
    decrypt web3-eth-accounts.umd.js:265
    load web3-eth-accounts.umd.js:314

Versions

  • web3.js 1.0.0-beta.51
  • browser - firefox
@nivida nivida added the Bug Addressing a bug label Apr 4, 2019
@nivida
Copy link
Contributor

nivida commented Apr 4, 2019

This will be fixed and released today. It depends on your use case but I wouldn't recommend storing private keys in the localStorage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Addressing a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants