Use hexutil.Uint for blockCount parameter and oldestBlock result value in feeHistory method#23239
Conversation
…d of int for feeHistory
ryanschneider
left a comment
There was a problem hiding this comment.
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 |
rjl493456442
left a comment
There was a problem hiding this comment.
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
zsfelfoldi
left a comment
There was a problem hiding this comment.
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 <zsfelfoldi@gmail.com>
hexutil.Uint for blockCount parameter in feeHistory methodhexutil.Uint for blockCount parameter and oldestBlock result value in feeHistory method
Farzin3
left a comment
There was a problem hiding this comment.
``>>> 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'``
| } | ||
|
|
||
| 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) |
|
…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 <zsfelfoldi@gmail.com>
…e in feeHistory method (ethereum#23239)
The current spec uses an
Integertype for theblockCountparameter andOldestBlockresult value. The schema for these values define them to be a hex string.(h/t @ryanschneider for finding)