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

Unable To Vote: Accounts Undefined #25

Open
officialfrancismendoza opened this issue May 31, 2019 · 1 comment
Open

Unable To Vote: Accounts Undefined #25

officialfrancismendoza opened this issue May 31, 2019 · 1 comment

Comments

@officialfrancismendoza
Copy link

officialfrancismendoza commented May 31, 2019

I am unable to call app.vote(1, from: web3.eth.accounts[0]}), but not because I have insufficient Ether (premise of an issue raised by someone else)

My program, for some reason, treated all the accounts array values as undefined..

Attached below is a screenshot detailing how I have a list of addresses, but none of those are stored within web3.eth.accounts, and I am unsure why
image

Attempted to fix this issue by manually setting an address equal to a memory location within the accounts array in Git bash. However, it gives an error message of an unrecognized account when calling app.vote
image
image

In both instances, I have null accounts and accounts that are not recognized. I have been stuck for nearly 2 hours. Where is the problem localized? Within what file are these accounts instantiated to begin with? (assume no new files)

@faruk13
Copy link

faruk13 commented Jul 8, 2019

Using getAccounts you should get a list of accounts, then on the app instance pass the first address(or any one) to another variable.

web3.eth.getAccounts().then( function(s){FirstAccount=s[0]; return FirstAccount})

then use,

app.vote(1,{from:FirstAccount})

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

No branches or pull requests

2 participants