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

ethclient: serialize negative block number as "pending" #21177

Merged
merged 2 commits into from
Jul 21, 2020
Merged

ethclient: serialize negative block number as "pending" #21177

merged 2 commits into from
Jul 21, 2020

Conversation

sammy007
Copy link
Contributor

@sammy007 sammy007 commented Jun 4, 2020

@fjl fjl changed the title Serialize negative Bigint as "pending" in ethclient ethclient: serialize negative block number as "pending" Jun 4, 2020
@@ -44,11 +44,11 @@ type Log struct {
// hash of the transaction
TxHash common.Hash `json:"transactionHash" gencodec:"required"`
// index of the transaction in the block
TxIndex uint `json:"transactionIndex" gencodec:"required"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any particular reason to drop this restriction?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No block = no tx index.

@@ -282,6 +282,9 @@ func toBlockNumArg(number *big.Int) string {
if number == nil {
return "latest"
}
if number.Sign() < 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should be a bit more strict here and only allow -1 to mean pending.
That way, we can use other negative numbers for different things later.

@fjl fjl merged commit 7163a66 into ethereum:master Jul 21, 2020
@fjl fjl removed the status:triage label Jul 21, 2020
enriquefynn pushed a commit to enriquefynn/go-ethereum that referenced this pull request 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>
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Jun 20, 2024
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

Successfully merging this pull request may close these issues.

4 participants