-
Notifications
You must be signed in to change notification settings - Fork 20.2k
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
Use hexutil.Uint
for blockCount
parameter and oldestBlock
result value in feeHistory
method
#23239
Conversation
…d of int for feeHistory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this will be a breaking change from 1.10.5 which was released with the previous behavior. I'm definitely torn on that.
H!i Also note that the "oldestBlock" in the output is also not Hex |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just nitpicks.
@zsfelfoldi Please also check it, especially in the spec the OldestBlock
type is rpc.BlockNumber
but I think hexutil.Big
is better since it can always be resolved.
fffd5e8
to
0756404
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (after fixing a build failure in the tests)
@zsfelfoldi doh thanks for fixing the test. |
@zsfelfoldi don't forget to set the milestone when merging a PR |
…thereum#23239) * internal/ethapi/api: use hexutil.uint for blockCount parameter instead of int for feeHistory * return hex value for oldestBlock instead of number * return uint64 from oracle.resolveBlockRange * eth/gasprice: fixed test Co-authored-by: Zsolt Felfoldi <[email protected]>
hexutil.Uint
for blockCount
parameter in feeHistory
methodhexutil.Uint
for blockCount
parameter and oldestBlock
result value in feeHistory
method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
``>>> import hashlib
m = hashlib.sha256()
m.update(b"Nobody inspects")
m.update(b" the spammish repetition")
m.digest()
b'\x03\x1e\xdd}Ae\x15\x93\xc5\xfe\\x00o\xa5u+7\xfd\xdf\xf7\xbcN\x84:\xa6\xaf\x0c\x95\x0fK\x94\x06'
m.digest_size
32
m.block_size
64
متراکم تر:
hashlib.sha224(b"Nobody inspects the spammish repetition").hexdigest()
'a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2'``
@@ -87,8 +87,8 @@ type feeHistoryResult struct { | |||
GasUsedRatio []float64 `json:"gasUsedRatio"` | |||
} | |||
|
|||
func (s *PublicEthereumAPI) FeeHistory(ctx context.Context, blockCount int, lastBlock rpc.BlockNumber, rewardPercentiles []float64) (*feeHistoryResult, error) { | |||
oldest, reward, baseFee, gasUsed, err := s.b.FeeHistory(ctx, blockCount, lastBlock, rewardPercentiles) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTC 1000000.01
|
…thereum#23239) * internal/ethapi/api: use hexutil.uint for blockCount parameter instead of int for feeHistory * return hex value for oldestBlock instead of number * return uint64 from oracle.resolveBlockRange * eth/gasprice: fixed test Co-authored-by: Zsolt Felfoldi <[email protected]>
…e in feeHistory method (ethereum#23239)
…e in feeHistory method (ethereum#23239)
…e in feeHistory method (ethereum#23239)
…e in feeHistory method (ethereum#23239)
…e in feeHistory method (ethereum#23239)
…e in feeHistory method (ethereum#23239)
…e in feeHistory method (ethereum#23239)
…e in feeHistory method (ethereum#23239)
…e in feeHistory method (ethereum#23239)
…e in feeHistory method (ethereum#23239)
…e in feeHistory method (ethereum#23239)
…e in feeHistory method (ethereum#23239)
…e in feeHistory method (ethereum#23239)
…e in feeHistory method (ethereum#23239)
…e in feeHistory method (ethereum#23239)
…e in feeHistory method (ethereum#23239)
…e in feeHistory method (ethereum#23239)
…e in feeHistory method (ethereum#23239)
…e in feeHistory method (ethereum#23239)
…e in feeHistory method (ethereum#23239)
…e in feeHistory method (ethereum#23239)
…e in feeHistory method (ethereum#23239)
…e in feeHistory method (ethereum#23239)
…e in feeHistory method (ethereum#23239)
…e in feeHistory method (ethereum#23239)
…e in feeHistory method (ethereum#23239)
…e in feeHistory method (ethereum#23239)
…e in feeHistory method (ethereum#23239)
…e in feeHistory method (ethereum#23239)
…e in feeHistory method (ethereum#23239)
The current spec uses an
Integer
type for theblockCount
parameter andOldestBlock
result value. The schema for these values define them to be a hex string.(h/t @ryanschneider for finding)