Skip to content

Commit

Permalink
fix: work around a few new rpc issues
Browse files Browse the repository at this point in the history
  • Loading branch information
xJonathanLEI committed Sep 15, 2023
1 parent a5e23d0 commit eabbf03
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions starknet-accounts/tests/single_owner_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,8 @@ async fn can_declare_cairo0_contract_inner<P: Provider + Send + Sync>(provider:

let result = account
.declare_legacy(Arc::new(contract_artifact))
// There seems to be a fee estimation issue with `pathfinder`
.fee_estimate_multiplier(2.0)
.send()
.await
.unwrap();
Expand Down
16 changes: 16 additions & 0 deletions starknet-core/src/types/contract/legacy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -510,18 +510,34 @@ impl LegacyProgram {
compiler_version: &'a Option<String>,
#[serde_as(as = "Vec<UfeHex>")]
data: &'a Vec<FieldElement>,
// Needed due to pathfinder bug:
// https://github.com/eqlabs/pathfinder/issues/1371
debug_info: EmptyDebugInfo,
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 {},
},
hints: &self.hints,
identifiers: &self.identifiers,
main_scope: &self.main_scope,
Expand Down

0 comments on commit eabbf03

Please sign in to comment.