Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: dont skip gas used ratio if empty #40

Merged
merged 3 commits into from
Nov 21, 2023
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
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>>>,
}
Loading