Skip to content

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
// 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.

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.

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