Skip to content

Commit

Permalink
fix: dont skip gas used ratio if empty (#40)
Browse files Browse the repository at this point in the history
* workaround

* fix: actual fix

* fix: actual fix part 2
  • Loading branch information
onbjerg authored Nov 21, 2023
1 parent a529441 commit ce78420
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions crates/rpc-types/src/eth/fee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,20 @@ 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 compatability 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`.
///
/// # 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(default, skip_serializing_if = "Option::is_none")]
pub reward: Option<Vec<Vec<U256>>>,
}

0 comments on commit ce78420

Please sign in to comment.