From a9dd53da810d8eff82aa77e0f9297b4a453028e6 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Mon, 17 Oct 2022 19:27:42 +0200 Subject: [PATCH] fix(solc): emit empty node vec (#1793) --- ethers-core/src/types/block.rs | 4 ++-- ethers-solc/src/artifacts/ast.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ethers-core/src/types/block.rs b/ethers-core/src/types/block.rs index cca065cd..e091f298 100644 --- a/ethers-core/src/types/block.rs +++ b/ethers-core/src/types/block.rs @@ -570,9 +570,9 @@ impl BlockNumber { pub fn is_finalized(&self) -> bool { matches!(self, BlockNumber::Finalized) } - + /// Returns `true` if it's "safe" - pub fn is_safe(&self) -> bool { + pub fn is_safe(&self) -> bool { matches!(self, BlockNumber::Safe) } diff --git a/ethers-solc/src/artifacts/ast.rs b/ethers-solc/src/artifacts/ast.rs index 236c3bdb..4544e582 100644 --- a/ethers-solc/src/artifacts/ast.rs +++ b/ethers-solc/src/artifacts/ast.rs @@ -16,7 +16,7 @@ pub struct Ast { pub node_type: NodeType, #[serde(with = "serde_helpers::display_from_str")] pub src: SourceLocation, - #[serde(default, skip_serializing_if = "Vec::is_empty")] + #[serde(default)] pub nodes: Vec, /// Node attributes that were not deserialized. @@ -39,7 +39,7 @@ pub struct Node { pub src: SourceLocation, /// Child nodes for some node types. - #[serde(default, skip_serializing_if = "Vec::is_empty")] + #[serde(default)] pub nodes: Vec, /// Body node for some node types.