dappuniversity / election

A Decentralized Ethereum Voting Application Tutorial
563 stars 506 forks source link

Candidates not showing in my dropdown menu #48

Closed mika787 closed 3 years ago

mika787 commented 3 years ago

I've been following the tutorial and everything has been going okay except for a couple of things: I can't pass the last 3 truffle tests and the candidates don't show in the dropdown so I can't vote. Any ideas?

Contract: Election √ initializes with two candidates (244ms) √ it initializes the candidates with the correct values (359ms)

2 passing (957ms) 3 failing

1) allows a voter to cast a vote: ReferenceError: accounts is not defined at C:\Users\Tammy\election\test\election.js:35:55 at processTicksAndRejections (node:internal/process/task_queues:94:5)

2) vote fails for invalid candiates: ReferenceError: accounts is not defined at C:\Users\Tammy\election\test\election.js:53:46 at processTicksAndRejections (node:internal/process/task_queues:94:5)

3) vote fails for double voting: ReferenceError: accounts is not defined at C:\Users\Tammy\election\test\election.js:71:48 at processTicksAndRejections (node:internal/process/task_queues:94:5)

image

mika787 commented 3 years ago

Update! Did some digging around other issues posted here about this tutorial and found an updated app.js file submitted by @DongsubShim. Now my candidates show in the dropdown and I can vote!