Skip to content

internal/ethapi: accept both hex and decimal for blockCount#23363

Merged
karalabe merged 1 commit intoethereum:masterfrom
zsfelfoldi:blockcount-type
Aug 10, 2021
Merged

internal/ethapi: accept both hex and decimal for blockCount#23363
karalabe merged 1 commit intoethereum:masterfrom
zsfelfoldi:blockcount-type

Conversation

@zsfelfoldi
Copy link
Copy Markdown
Contributor

This PR allows both hex and decimal formats for the blockCount input parameter eth_feeHistory API.

Copy link
Copy Markdown
Member

@karalabe karalabe left a comment

Choose a reason for hiding this comment

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

Nonononon :D

Please make a new type rpc.DecimalOrHex inside rpc/types.go and add a custom JSON unmarshaller, similar to https://github.com/ethereum/go-ethereum/blob/master/rpc/types.go#L71

Comment thread internal/ethapi/api.go Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Perhaps defining the rpc.HexUintOrUint type to resolve the value from the json stream is better?

Copy link
Copy Markdown
Member

@karalabe karalabe left a comment

Choose a reason for hiding this comment

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

LGTM

@karalabe karalabe added this to the 1.10.7 milestone Aug 10, 2021
@karalabe karalabe merged commit 97bd6cd into ethereum:master Aug 10, 2021
sidhujag pushed a commit to sidhujag/go-ethereum that referenced this pull request Aug 15, 2021
atif-konasl pushed a commit to frozeman/pandora-execution-engine that referenced this pull request Oct 15, 2021
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Apr 22, 2025
gzliudan added a commit to XinFinOrg/XDPoSChain that referenced this pull request Apr 24, 2025
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.

3 participants