fix: dont skip gas used ratio if empty (#5512)

Co-authored-by: evalir <hi@enriqueortiz.dev>
This commit is contained in:
Matthias Seitz
2023-11-21 05:16:41 +01:00
committed by GitHub
parent 1064da5d41
commit f8451fd984

View File

@ -36,9 +36,8 @@ pub struct FeeHistory {
///
/// # Note
///
/// The `Option` is only for compatability with Erigon and Geth.
#[serde(skip_serializing_if = "Vec::is_empty")]
#[serde(default)]
/// Empty list is skipped only for compatibility with Erigon and Geth.
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub base_fee_per_gas: Vec<U256>,
/// An array of block gas used ratios. These are calculated as the ratio
/// of `gasUsed` and `gasLimit`.
@ -46,13 +45,11 @@ pub struct FeeHistory {
/// # Note
///
/// The `Option` is only for compatability with Erigon and Geth.
#[serde(skip_serializing_if = "Vec::is_empty")]
#[serde(default)]
pub gas_used_ratio: Vec<f64>,
/// Lowest number block of the returned range.
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(skip_serializing_if = "Option::is_none")]
pub reward: Option<Vec<Vec<U256>>>,
}