Giter VIP home page Giter VIP logo

Comments (7)

pchavan150 avatar pchavan150 commented on September 17, 2024 2

change this
fromBlock: 0,
toBlock: 'latest'
to
fromBlock: 'latest',
toBlock: 'latest'

in app.js file

from election.

DtzMan avatar DtzMan commented on September 17, 2024

same problem for me too

from election.

moseley avatar moseley commented on September 17, 2024

See Issue #2

from election.

9w6nuu avatar 9w6nuu commented on September 17, 2024

change this
fromBlock: 0,
toBlock: 'latest'
to
fromBlock: 'latest',
toBlock: 'latest'

in app.js file

I did. something changed.
but still I have some issue here.
this time it shows not multiple but 2 times

loadWeb3: async function() { if(window.ethereum) { window.web3 = new Web3(window.ethereum); await ethereum.enable(); } else if(window.web3){ window.web3 = new Web3(web3.currentProvider); } else{ window.alert('Non-Ethereum brower detected. You should consider trying MetaMask!'); } return App.initContract(); },
is this because i changed this too?
in app.js line 40
initContract: function() { $.getJSON("Election.json", function(election) { App.contracts.Election = TruffleContract(election); App.contracts.Election.setProvider(web3.currentProvider); App.listenForEvents(); return App.render(); }); },

from election.

pchavan150 avatar pchavan150 commented on September 17, 2024

change this
fromBlock: 0,
toBlock: 'latest'
to
fromBlock: 'latest',
toBlock: 'latest'
in app.js file

I did. something changed.
but still I have some issue here.
this time it shows not multiple but 2 times

loadWeb3: async function() { if(window.ethereum) { window.web3 = new Web3(window.ethereum); await ethereum.enable(); } else if(window.web3){ window.web3 = new Web3(web3.currentProvider); } else{ window.alert('Non-Ethereum brower detected. You should consider trying MetaMask!'); } return App.initContract(); },
is this because i changed this too?
in app.js line 40
initContract: function() { $.getJSON("Election.json", function(election) { App.contracts.Election = TruffleContract(election); App.contracts.Election.setProvider(web3.currentProvider); App.listenForEvents(); return App.render(); }); },

Yes I faced too so I removed event section...so it solved everything

from election.

Jadhoo avatar Jadhoo commented on September 17, 2024

change this
fromBlock: 0,
toBlock: 'latest'
to
fromBlock: 'latest',
toBlock: 'latest'
in app.js file

I did. something changed.
but still I have some issue here.
this time it shows not multiple but 2 times
loadWeb3: async function() { if(window.ethereum) { window.web3 = new Web3(window.ethereum); await ethereum.enable(); } else if(window.web3){ window.web3 = new Web3(web3.currentProvider); } else{ window.alert('Non-Ethereum brower detected. You should consider trying MetaMask!'); } return App.initContract(); },
is this because i changed this too?
in app.js line 40
initContract: function() { $.getJSON("Election.json", function(election) { App.contracts.Election = TruffleContract(election); App.contracts.Election.setProvider(web3.currentProvider); App.listenForEvents(); return App.render(); }); },

Yes I faced too so I removed event section...so it solved everything

Yeah, removing the votedEvent in Election.sol solved the issue, but while performing 'truffle test', it fails to pass the 3rd condition👇

  1. allows a voter to cast a vote

from election.

DLanzafamedelRio avatar DLanzafamedelRio commented on September 17, 2024

So it actually works without any problems:
instance.votedEvent({}, { fromBlock: 'latest', toBlock: 'latest' + 1 }).watch(function(error, event) {...});

from election.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.