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

Add ByteArray #436

Merged
merged 9 commits into from
Mar 14, 2024
Merged

Add ByteArray #436

merged 9 commits into from
Mar 14, 2024

Conversation

DelevoXDG
Copy link
Contributor

Describe your changes

Related to and is needed for #428

  • Add StarknetTypedData that corresponds to ByteArray struct in Cairo

Linked issues

Closes

Breaking changes

  • This issue contains breaking changes

References

- Add `StarknetByteArray`
- Move logic for encoding long string from `TypedData.prepareLongString()` to `StarknetByteArray`
- Fix logic to properly handle short strings <31
  - Do not prepend `Felt.ZERO` to `StarknetByteArray.data`
- Remains to be verified if it's correct one
This reverts commit 03363b3.
It was confirmed that logic from the docs should be used:
starknet-io/starknet.js#1003 (comment)
@DelevoXDG DelevoXDG requested a review from THenry14 March 14, 2024 11:07
Copy link
Member

@THenry14 THenry14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be merged after resolving all comments

@codecov-commenter
Copy link

codecov-commenter commented Mar 14, 2024

Codecov Report

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

Project coverage is 70.56%. Comparing base (c4ec028) to head (dde064c).

Files Patch % Lines
...swmansion/starknet/data/types/StarknetByteArray.kt 95.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #436      +/-   ##
==========================================
+ Coverage   70.37%   70.56%   +0.18%     
==========================================
  Files          73       75       +2     
  Lines        3153     3176      +23     
  Branches      309      313       +4     
==========================================
+ Hits         2219     2241      +22     
  Misses        788      788              
- Partials      146      147       +1     

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

@DelevoXDG DelevoXDG mentioned this pull request Mar 14, 2024
1 task
@DelevoXDG DelevoXDG requested a review from THenry14 March 14, 2024 12:34
@DelevoXDG DelevoXDG merged commit 0ca9c0d 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