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

No way to get "pending" via ethclient.FilterQuery #21175

Closed
sammy007 opened this issue Jun 4, 2020 · 6 comments
Closed

No way to get "pending" via ethclient.FilterQuery #21175

sammy007 opened this issue Jun 4, 2020 · 6 comments

Comments

@sammy007
Copy link
Contributor

sammy007 commented Jun 4, 2020

https://godoc.org/github.com/ethereum/go-ethereum#FilterQuery

Since there is only bigint option, I can't set it to "pending". My proposal is to make it an interface and allow anything, just throw if case it's not a bigint or a string. Or -1 maybe, then check and serialize as "pending".

toBlock [optional, default is "latest"] - an integer block number, or the string "latest", "earliest" or "pending"
@sammy007
Copy link
Contributor Author

sammy007 commented Jun 4, 2020

Also needed for fromBlock.

@fjl
Copy link
Contributor

fjl commented Jun 4, 2020

I like the idea to use negative numbers for special purposes!

@sammy007
Copy link
Contributor Author

sammy007 commented Jun 4, 2020

There are pending, latest, earliest. Why not just make them an interface?

@sammy007
Copy link
Contributor Author

sammy007 commented Jun 4, 2020

It seems 0 is earliest, pending is pending and latest is already there anyway.

@fjl
Copy link
Contributor

fjl commented Jun 8, 2020

I don't want to change the API, that's why I liked your idea to use negative numbers.

@sammy007
Copy link
Contributor Author

sammy007 commented Jun 9, 2020

Well, the PR is using negative number for "pending" and contains some Log serialisation changes as well. @fjl is it possible to speedup the review somehow?

@fjl fjl closed this as completed in 7163a66 Jul 21, 2020
enriquefynn pushed a commit to enriquefynn/go-ethereum that referenced this issue Mar 10, 2021
Fixes ethereum#21175

Co-authored-by: sammy007 <sammy007@users.noreply.github.com>
Co-authored-by: Adam Schmideg <adamschmideg@users.noreply.github.com>
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

2 participants