Serialize block count as quantity 2 (#669)

* Serialize eth_feeHistory block count as QUANTITY

* update changelog

* Make sure to first convert to U256 :face_palm:

* Fix issue with move of `block_count` value.

* fix merge issue

* Revert changelog
This commit is contained in:
Nicholas Rodrigues Lordello 2021-12-10 17:16:20 +01:00 committed by GitHub
parent a8b0885c25
commit 79f2e1d5ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -854,6 +854,7 @@ impl<P: JsonRpcClient> Middleware for Provider<P> {
last_block: BlockNumber, last_block: BlockNumber,
reward_percentiles: &[f64], reward_percentiles: &[f64],
) -> Result<FeeHistory, Self::Error> { ) -> Result<FeeHistory, Self::Error> {
let block_count = block_count.into();
let last_block = utils::serialize(&last_block); let last_block = utils::serialize(&last_block);
let reward_percentiles = utils::serialize(&reward_percentiles); let reward_percentiles = utils::serialize(&reward_percentiles);
@ -862,13 +863,13 @@ impl<P: JsonRpcClient> Middleware for Provider<P> {
// decode the param from client side would fallback to the old API spec. // decode the param from client side would fallback to the old API spec.
self.request( self.request(
"eth_feeHistory", "eth_feeHistory",
[utils::serialize(&block_count.into()), last_block.clone(), reward_percentiles.clone()], [utils::serialize(&block_count), last_block.clone(), reward_percentiles.clone()],
) )
.await .await
.or(self .or(self
.request( .request(
"eth_feeHistory", "eth_feeHistory",
[utils::serialize(&block_count.into().as_u64()), last_block, reward_percentiles], [utils::serialize(&block_count.as_u64()), last_block, reward_percentiles],
) )
.await) .await)
} }