From 3146b5504029e9c65e3a1ced8ae87c9eef09d3d0 Mon Sep 17 00:00:00 2001 From: Krisztian Kovacs Date: Fri, 8 Nov 2024 15:26:12 +0100 Subject: [PATCH] fix(rpc/v08/get_compiled_casm): omit `bytecode_segment_lengths` from response if None That isn't a required property in the response so it's actually conformant to just skip serializing it. However, `null` is not a valid value according to the spec. --- crates/common/src/casm_class.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/common/src/casm_class.rs b/crates/common/src/casm_class.rs index cc08b9e133..2385410edf 100644 --- a/crates/common/src/casm_class.rs +++ b/crates/common/src/casm_class.rs @@ -9,6 +9,7 @@ use crate::EntryPoint; #[derive(Debug, Serialize, Deserialize, Eq, PartialEq)] pub struct CasmContractClass { pub bytecode: Vec, + #[serde(default, skip_serializing_if = "Option::is_none")] pub bytecode_segment_lengths: Option, pub compiler_version: String, pub hints: serde_json::Value,