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

Improve test coverage #480

Closed
wants to merge 25 commits into from
Closed

Conversation

franciszekjob
Copy link
Collaborator

Describe your changes

Linked issues

Closes #427

Breaking changes

  • This issue contains breaking changes

@franciszekjob franciszekjob marked this pull request as draft May 29, 2024 07:22
@franciszekjob franciszekjob marked this pull request as draft May 29, 2024 07:22
@franciszekjob franciszekjob changed the title Improve test covrage Improve test coverage May 29, 2024
@codecov-commenter
Copy link

codecov-commenter commented Jun 2, 2024

Codecov Report

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

Project coverage is 70.94%. Comparing base (d28b008) to head (583bcd9).
Report is 12 commits behind head on main.

Files Patch % Lines
...lin/com/swmansion/starknet/data/types/Contracts.kt 53.84% 3 Missing and 3 partials ⚠️
.../kotlin/com/swmansion/starknet/data/types/Block.kt 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #480      +/-   ##
==========================================
- Coverage   71.12%   70.94%   -0.18%     
==========================================
  Files          75       88      +13     
  Lines        3338     3390      +52     
  Branches      367      375       +8     
==========================================
+ Hits         2374     2405      +31     
- Misses        798      817      +19     
- Partials      166      168       +2     

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

val tag = BlockTag.valueOf(value)
val tag = BlockTag.fromValue(value)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Standard valueOf() takes enum's constant, while we want to retrieve enum's constant based on the value.

Comment on lines +26 to +29
if (value.toIntOrNull() != null) {
return BlockId.Number(value.toInt())
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Add possibility to serialize a block number.

Copy link
Collaborator Author

@franciszekjob franciszekjob Jun 2, 2024

Choose a reason for hiding this comment

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

I added missing query transaction versions, which enable to estimate fee.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Standard enum's valueOf() method, takes an enum constant and returns enum constant as well. I implemented fromTag() to easily allow to get const based on given value.

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.

Consider improving test coverage
2 participants