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

Commit 546ea02

Browse files
authored
fix: allow missing base fee and reward vecs (#2683)
1 parent 4a38a95 commit 546ea02

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ethers-core/src/types/fee.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use serde::{Deserialize, Serialize};
44
#[derive(Deserialize, Serialize, Debug, Clone)]
55
#[serde(rename_all = "camelCase")]
66
pub struct FeeHistory {
7+
#[serde(default, skip_serializing_if = "Vec::is_empty")]
78
pub base_fee_per_gas: Vec<U256>,
89
pub gas_used_ratio: Vec<f64>,
910
#[serde(deserialize_with = "deserialize_stringified_numeric")]
@@ -14,6 +15,6 @@ pub struct FeeHistory {
1415
pub oldest_block: U256,
1516
/// An (optional) array of effective priority fee per gas data points from a single block. All
1617
/// zeroes are returned if the block is empty.
17-
#[serde(default)]
18+
#[serde(default, skip_serializing_if = "Vec::is_empty")]
1819
pub reward: Vec<Vec<U256>>,
1920
}

0 commit comments

Comments
 (0)