From 00b84ffbfda52e519ec1af5d78cc9a3333695a00 Mon Sep 17 00:00:00 2001 From: Arsenii Kulikov Date: Tue, 16 Jul 2024 22:03:38 +0800 Subject: [PATCH 1/2] fix: optional modifier body --- crates/artifacts/solc/src/ast/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/artifacts/solc/src/ast/mod.rs b/crates/artifacts/solc/src/ast/mod.rs index 2765b513..76b9fd38 100644 --- a/crates/artifacts/solc/src/ast/mod.rs +++ b/crates/artifacts/solc/src/ast/mod.rs @@ -1000,7 +1000,7 @@ ast_node!( name_location: Option, #[serde(default, deserialize_with = "serde_helpers::default_for_null")] base_modifiers: Vec, - body: Block, + body: Option, documentation: Option, overrides: Option, parameters: ParameterList, From 11a98e08e73e1f9b478d0cc91b53fdbbed981ce3 Mon Sep 17 00:00:00 2001 From: Arsenii Kulikov Date: Tue, 16 Jul 2024 22:14:37 +0800 Subject: [PATCH 2/2] fix --- crates/artifacts/solc/src/ast/visitor.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/artifacts/solc/src/ast/visitor.rs b/crates/artifacts/solc/src/ast/visitor.rs index b1168493..d8064ff0 100644 --- a/crates/artifacts/solc/src/ast/visitor.rs +++ b/crates/artifacts/solc/src/ast/visitor.rs @@ -281,7 +281,9 @@ impl_walk!(StructDefinition, visit_struct_definition, |struct_, visitor| { }); impl_walk!(ModifierDefinition, visit_modifier_definition, |modifier, visitor| { - modifier.body.walk(visitor); + if let Some(body) = &modifier.body { + body.walk(visitor); + } if let Some(override_) = &modifier.overrides { override_.walk(visitor); }