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

Filters - LogFilter coerces a valid block of 0 to "latest" #188

Closed
pszabop opened this issue Oct 9, 2017 · 1 comment
Closed

Filters - LogFilter coerces a valid block of 0 to "latest" #188

pszabop opened this issue Oct 9, 2017 · 1 comment

Comments

@pszabop
Copy link

pszabop commented Oct 9, 2017

LogFilter coerces a valid block of 0 to "latest".

This causes stuff such as eth.getPastLogs ({fromBlock: 0, toBlock: 'latest'}) to have the unexpected behavior of only returning the latest block's filter entries. I have tried "0" and this returns nothing, the only valid fromBlock value that seems to work is 1.

I'm uncertain of the dependency tree (it's complicated) but believe this is because I'm using testrpc which uses provider-engine (I think). It doesn't look like this module is used by web3.js.

code: https://github.com/MetaMask/provider-engine/blob/c878e5ac19e061dc3de7f317f5ed4090b3fbd49c/subproviders/filters.js#L332

I note that other implementations such as web3.js implement a check for undefined instead of a boolean check like the code above does.

Related issue here: web3/web3.js#1100

@kumavis kumavis changed the title LogFilter coerces a valid block of 0 to "latest" Filters - LogFilter coerces a valid block of 0 to "latest" Apr 10, 2018
@kumavis
Copy link
Member

kumavis commented Apr 25, 2018

fixed here da1cf7f

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

2 participants