Skip to content

Commit

Permalink
feat: compress LegacyProgram.debug_info as None
Browse files Browse the repository at this point in the history
chore: remove pathfinder bug induced workaround
  • Loading branch information
tdelabro committed Jun 17, 2024
1 parent 33581e3 commit 1f18192
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions starknet-core/src/types/contract/legacy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -502,34 +502,20 @@ impl LegacyProgram {
compiler_version: &'a Option<String>,
#[serde_as(as = "Vec<UfeHex>")]
data: &'a Vec<Felt>,
// Needed due to pathfinder bug:
// https://github.com/eqlabs/pathfinder/issues/1371
debug_info: EmptyDebugInfo,
debug_info: Option<()>,
hints: &'a BTreeMap<u64, Vec<LegacyHint>>,
identifiers: &'a BTreeMap<String, LegacyIdentifier>,
main_scope: &'a String,
prime: &'a String,
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,
Expand Down

0 comments on commit 1f18192

Please sign in to comment.