From 1f1819284e976b0bbdad027d235287eab40aeacd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Delabrouille?= Date: Fri, 14 Jun 2024 18:52:01 +0200 Subject: [PATCH] feat: compress LegacyProgram.debug_info as None chore: remove pathfinder bug induced workaround --- starknet-core/src/types/contract/legacy.rs | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/starknet-core/src/types/contract/legacy.rs b/starknet-core/src/types/contract/legacy.rs index 56cab605..83294a82 100644 --- a/starknet-core/src/types/contract/legacy.rs +++ b/starknet-core/src/types/contract/legacy.rs @@ -502,9 +502,7 @@ impl LegacyProgram { compiler_version: &'a Option, #[serde_as(as = "Vec")] data: &'a Vec, - // Needed due to pathfinder bug: - // https://github.com/eqlabs/pathfinder/issues/1371 - debug_info: EmptyDebugInfo, + debug_info: Option<()>, hints: &'a BTreeMap>, identifiers: &'a BTreeMap, main_scope: &'a String, @@ -512,24 +510,12 @@ impl LegacyProgram { reference_manager: &'a LegacyReferenceManager, } - #[derive(Serialize)] - pub struct EmptyDebugInfo { - file_contents: Unit, - instruction_locations: Unit, - } - - #[derive(Serialize)] - pub struct Unit {} - let program_json = serde_json::to_string(&ProgramWithoutDebugInfo { attributes: &self.attributes, builtins: &self.builtins, compiler_version: &self.compiler_version, data: &self.data, - debug_info: EmptyDebugInfo { - file_contents: Unit {}, - instruction_locations: Unit {}, - }, + debug_info: None, hints: &self.hints, identifiers: &self.identifiers, main_scope: &self.main_scope,