Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

fix: generate program_json directly from program string #764

Merged
merged 4 commits into from
Jul 4, 2023

Conversation

MegaRedHand
Copy link
Contributor

@MegaRedHand MegaRedHand commented Jul 4, 2023

Closes #757

Description

Class hashes were calculated incorrectly when using the TryFrom<BufReader<T>> implementation. This was because we were deserializing the string into a starknet_api::ContractClass and later serializing that again. This PR fixes this by reading everything into a string, and later using the TryFrom<&str> implementation.

NOTE: due to the class hash change some proxy tests were broken (and had to be fixed)

Checklist

  • Linked to Github Issue
  • Unit tests added
  • Integration tests added.
  • This change requires new documentation.
    • Documentation has been added/updated.

@codecov-commenter
Copy link

codecov-commenter commented Jul 4, 2023

Codecov Report

Merging #764 (fa6fd36) into main (66a978b) will increase coverage by 0.03%.
The diff coverage is 97.67%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #764      +/-   ##
==========================================
+ Coverage   92.42%   92.45%   +0.03%     
==========================================
  Files          51       51              
  Lines       11847    11945      +98     
==========================================
+ Hits        10949    11044      +95     
- Misses        898      901       +3     
Impacted Files Coverage Δ
.../api/contract_classes/deprecated_contract_class.rs 96.88% <97.61%> (+0.03%) ⬆️
crates/starknet-contract-class/src/lib.rs 79.56% <100.00%> (ø)

@Oppen Oppen added this pull request to the merge queue Jul 4, 2023
Merged via the queue into main with commit d3f4f03 Jul 4, 2023
@MegaRedHand MegaRedHand deleted the class-hash-issue branch July 4, 2023 21:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Entry point validation / class hash issue
4 participants