From f8451fd984065aae8de9f96135ebb90c20221bc2 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Tue, 21 Nov 2023 05:16:41 +0100 Subject: [PATCH] fix: dont skip gas used ratio if empty (#5512) Co-authored-by: evalir --- crates/rpc/rpc-types/src/eth/fee.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/crates/rpc/rpc-types/src/eth/fee.rs b/crates/rpc/rpc-types/src/eth/fee.rs index c7717994ea..5fb145ab68 100644 --- a/crates/rpc/rpc-types/src/eth/fee.rs +++ b/crates/rpc/rpc-types/src/eth/fee.rs @@ -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, /// 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, /// 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>>, }