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

app.candidate() #33

Open
kmmr12 opened this issue Feb 4, 2020 · 2 comments
Open

app.candidate() #33

kmmr12 opened this issue Feb 4, 2020 · 2 comments

Comments

@kmmr12
Copy link

kmmr12 commented Feb 4, 2020

I got stuck on this

truffle(development)> app.candidate()
Thrown:
evalmachine.:0
app.candidate()
^

TypeError: app.candidate is not a function
at evalmachine.:0:5
at sigintHandlersWrap (vm.js:269:15)
at Script.runInContext (vm.js:124:14)
at runScript (/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/console.js:222:1)
at Console.interpret (/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/console.js:237:1)
at ReplManager.interpret (/usr/local/lib/node_modules/truffle/build/webpack:/packages/core/lib/repl.js:131:1)
at bound (domain.js:419:14)
at REPLServer.runBound [as eval] (domain.js:432:12)
at REPLServer.onLine (repl.js:716:10)
at REPLServer.emit (events.js:223:5)

@msali123
Copy link

msali123 commented Apr 6, 2020

Have you first done =>
Election.deployed().then(function(instance) {app = instance})

@pramadman
Copy link

make a change in addCandidate funtion

mapping(uint=>candidate) public candidates1;
uint public candidateCount;
function addCandidate(string memory _name) private {
candidateCount++;
candidates1[candidateCount] = candidate(candidateCount,_name,0);
}

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

3 participants