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

Commit

Permalink
fix: allow missing base fee and reward vecs (#2683)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Nov 21, 2023
1 parent 4a38a95 commit 546ea02
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ethers-core/src/types/fee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use serde::{Deserialize, Serialize};
#[derive(Deserialize, Serialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
pub struct FeeHistory {
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub base_fee_per_gas: Vec<U256>,
pub gas_used_ratio: Vec<f64>,
#[serde(deserialize_with = "deserialize_stringified_numeric")]
Expand All @@ -14,6 +15,6 @@ pub struct FeeHistory {
pub oldest_block: U256,
/// An (optional) array of effective priority fee per gas data points from a single block. All
/// zeroes are returned if the block is empty.
#[serde(default)]
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub reward: Vec<Vec<U256>>,
}

0 comments on commit 546ea02

Please sign in to comment.