Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Serialize block count as quantity 2 #669

Merged
merged 7 commits into from
Dec 10, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions ethers-providers/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,7 @@ impl<P: JsonRpcClient> Middleware for Provider<P> {
last_block: BlockNumber,
reward_percentiles: &[f64],
) -> Result<FeeHistory, Self::Error> {
let block_count = block_count.into();
let last_block = utils::serialize(&last_block);
let reward_percentiles = utils::serialize(&reward_percentiles);

Expand All @@ -862,13 +863,13 @@ impl<P: JsonRpcClient> Middleware for Provider<P> {
// decode the param from client side would fallback to the old API spec.
self.request(
"eth_feeHistory",
[utils::serialize(&block_count.into()), last_block.clone(), reward_percentiles.clone()],
[utils::serialize(&block_count), last_block.clone(), reward_percentiles.clone()],
)
.await
.or(self
.request(
"eth_feeHistory",
[utils::serialize(&block_count.into().as_u64()), last_block, reward_percentiles],
[utils::serialize(&block_count.as_u64()), last_block, reward_percentiles],
)
.await)
}
Expand Down