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

eth_getFilterChanges don't receive logs in pending state when toBlock: 'pending' #852

Closed
frozeman opened this issue May 4, 2015 · 11 comments
Assignees
Milestone

Comments

@frozeman
Copy link
Contributor

frozeman commented May 4, 2015

Following scenario (use the browser, as the console doens't support filters yet):

  • create contract
  • create filter with toBlock: 'pending' to watch for the Deposit event
  • send money to the contract
  • Result: callback is only fired when block is mined, not when transaction is add to the pending state
walletABI = [   {      "anonymous" : false,      "inputs" : [],      "name" : "Created",      "type" : "event"   },   {      "anonymous" : false,      "inputs" : [         {            "indexed" : true,            "name" : "from",            "type" : "address"         },         {            "indexed" : false,            "name" : "value",            "type" : "uint256"         }      ],      "name" : "Deposit",      "type" : "event"   }];

walletABICompiled = '5b7f9adeddf84386b336eb7b3e18e7a6099be08fd81ea5d5142f4d2b630f8d20cf016040604090036040a15b60528060386000396000f300604c5b3373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c6040348152602001604090036040a25b565b60006000f3';
WalletContract = web3.eth.contract(walletABI);

// create contract
var contractInstance = new WalletContract({data: walletABICompiled, from: web3.eth.coinbase});

// watch pending tx (will fire, when the tx below are mined, not when add to the pending state!)
contractInstance.Deposit({}, {fromBlock: 0, toBlock: 'pending'}).watch(function(err,res){
       console.log('Deposit', res);
})

// send multiple tx to the address
web3.eth.sendTransaction({from: web3.eth.coinbase, to: contractInstance.address, value: web3.toWei(1, 'ether')});

web3.eth.sendTransaction({from: web3.eth.coinbase, to: contractInstance.address, value: web3.toWei(1, 'ether')});

web3.eth.sendTransaction({from: web3.eth.coinbase, to: contractInstance.address, value: web3.toWei(1, 'ether')});
@frozeman
Copy link
Contributor Author

frozeman commented May 8, 2015

As discussed pending logs should return the the following fields as null:

  • blockNumber
  • blockHash

@tgerring
Copy link
Contributor

Does this relate to #884 ?

@frozeman
Copy link
Contributor Author

Nope. This one is about logs aren't being returned at all, #884 is about some properties should be null

@obscuren
Copy link
Contributor

Is this still an issue @frozeman

@frozeman
Copy link
Contributor Author

Last time it tested, yes.

@heikoheiko
Copy link
Member

Is this still an issue? Would be a very helpful feature for more responsive DApps.

@frozeman
Copy link
Contributor Author

@bas-vk

@bas-vk bas-vk assigned bas-vk and unassigned obscuren Oct 24, 2016
@berndbohmeier
Copy link

It is still an issue.
If anyone facing the same problem, current workaround: this is working on parity;)

@frozeman
Copy link
Contributor Author

@bas-vk is working on it.

@fjl
Copy link
Contributor

fjl commented Nov 15, 2016

See #3219 for WIP code.

@fjl fjl added this to the 1.5.1 milestone Nov 15, 2016
@obscuren obscuren modified the milestones: 1.5.1, 1.5.2, 1.5.3 Nov 15, 2016
@fjl fjl modified the milestones: 1.5.3, 1.5.4 Nov 25, 2016
@fjl
Copy link
Contributor

fjl commented Nov 28, 2016

Fixed in #3219

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

No branches or pull requests

8 participants