Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update MerkleTree to allow Poseidon hashing #437

Merged
merged 7 commits into from
Mar 14, 2024

Conversation

DelevoXDG
Copy link
Contributor

@DelevoXDG DelevoXDG commented Mar 13, 2024

Describe your changes

Related to and is needed for #428

  • Add HashMethod enum
  • Add optional mandatory hashFunction parameter to MerkleTree constructor
  • Add mandatory hashFunction parameter to MerkleTree.hash() method

Linked issues

Closes

Breaking changes

  • This issue contains breaking changes
  • MerkleTree constructor now requires a hashFunction argument to be passed
  • MerkleTree.hash() static method now requires a hashFunction argument to be passed

- Add `MerkleHashFunction` enum
- `MerkleTree` now accepts `hashFunction` as an optinal argument
- (breaking) `MerkleTree.hash` now requires `hashFunction` to be specified
- Move to package com.swmansion.starknet.crypto
- Implement using abstract function instead of stored lambda
@DelevoXDG DelevoXDG requested a review from THenry14 March 14, 2024 10:56
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 87.50000% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 70.37%. Comparing base (2909bbd) to head (e59c5ae).

Files Patch % Lines
...in/com/swmansion/starknet/data/types/MerkleTree.kt 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #437      +/-   ##
==========================================
+ Coverage   70.33%   70.37%   +0.04%     
==========================================
  Files          72       73       +1     
  Lines        3148     3153       +5     
  Branches      309      309              
==========================================
+ Hits         2214     2219       +5     
  Misses        788      788              
  Partials      146      146              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@DelevoXDG DelevoXDG merged commit c4ec028 into main Mar 14, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants