Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

infinite getFilterChanges loop after event.watch() #1025

Closed
GabrielKidane opened this issue Apr 20, 2018 · 4 comments
Closed

infinite getFilterChanges loop after event.watch() #1025

GabrielKidane opened this issue Apr 20, 2018 · 4 comments

Comments

@GabrielKidane
Copy link

Expected Behavior

It should return the values emitted through the smart contract's event.

Current Behavior

Attempts to retrieve the values emitted but get's stuck in an infinite getFilterChanges loop.
Like so
eth_call eth_getFilterLogs eth_getFilterChanges eth_getFilterChanges eth_getFilterChanges eth_getFilterChanges eth_getFilterChanges

Possible Solution

I don't know but the issue has been previously fixed as you will see further down.

Steps to Reproduce (for bugs)

It happens whenever I call an event, the event happens at the end of a contract function and the event is certainly not looped.
`Contract.deployed().then((instance) => {
var event = instance.sponsorEvent();
var _this = this;

        let wachtEvent = event.watch(function(error, result){
            if(!error){
                console.log(result);
            }
        });

});`

`function support(string name) external payable
huntOn
minimumValue
{
Sponsor storage sponsor = sponsors[msg.sender];
sponsor.name = name;
sponsor.amount = sponsor.amount.add(msg.value);
sponsorPool = sponsorPool.add(msg.value)

    //emit event
    emit sponsorEvent(name, msg.value);
}`

-->

  1. Run ganache-cli
  2. deploy contract
  3. Call function that has the event

Context

Since using events is best practice in getting values it would be hard to create any other way around using this method. This issue had been found and fixed before (#56) but I'm afraid that it might have returned.
Another old reference to the same issue: #156.

Your Environment

  • Version used: Ganache CLI v6.1.0 (ganache-core: 2.1.0)
  • Version of Truffle/Remix/Other tools used: Truffle v4.1.5 (core: 4.1.5) Solidity v0.4.21 (solc-js)
  • NodeJS Version: [ ] 6.x, [ ] 7.x (unsupported), [X ] 8.x, [ ] 9.x
  • Operating System and version (include distro if Linux): macOS 10.13.3 : High Sierra
  • I intend to submit a pull request to fix this issue: [ ]
@eedsilva
Copy link

I am having the same issue

@GabrielKidane
Copy link
Author

I am currently just using metamask with connected with the rinkeby testnet

@stefanks
Copy link

stefanks commented May 8, 2018

Also seeing an infinite loop of eth_getFilterChanges

@davidmurdoch davidmurdoch transferred this issue from trufflesuite/ganache-cli-archive Aug 19, 2021
@fainashalts
Copy link

Hi @GabrielKidane apologies for not getting to this sooner. I hope it has been resolved! We are closing for issue maintenance but if this is still a problem please feel free to open a new issue. Thanks!

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

No branches or pull requests

4 participants