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

feat: Add a function to get the exact size of a PublicFile and PrivateFile #405

Merged
merged 5 commits into from
Feb 28, 2024

Conversation

icidasset
Copy link
Member

Summary

Adds a get_size function to PublicFile and PrivateFile, and their wasm equivalents, that returns the exact size of the contents without downloading all the content blocks.

Test plan (required)

Added doc tests for the core lib, and tests for the wasm lib.

After Merge

  • Does this change invalidate any docs or tutorials? If so ensure the changes needed are either made or recorded
  • Does this change require a release to be made? Is so please create and deploy the release

@icidasset icidasset requested a review from a team as a code owner February 28, 2024 12:10
Copy link

codecov bot commented Feb 28, 2024

Codecov Report

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

Project coverage is 54.69%. Comparing base (8ac4021) to head (2eb7ca7).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #405      +/-   ##
==========================================
+ Coverage   54.58%   54.69%   +0.11%     
==========================================
  Files          57       57              
  Lines        3959     3958       -1     
  Branches      959      959              
==========================================
+ Hits         2161     2165       +4     
+ Misses       1183     1175       -8     
- Partials      615      618       +3     
Files Coverage Δ
wnfs-common/src/metadata.rs 24.52% <ø> (ø)
wnfs-common/src/storable.rs 32.43% <ø> (ø)
wnfs/src/public/file.rs 68.96% <ø> (ø)
wnfs-hamt/src/diff.rs 19.46% <0.00%> (ø)
wnfs/src/private/file.rs 70.11% <85.71%> (-0.09%) ⬇️

... and 2 files with indirect coverage changes

Copy link
Member

@matheus23 matheus23 left a comment

Choose a reason for hiding this comment

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

Thank you for this! Great work 🙏

I'm especially happy to see you've done the work of adding Wasm tests 🙌 so I'm pretty confident in this.

@matheus23 matheus23 merged commit 17c980c into main Feb 28, 2024
12 checks passed
@matheus23 matheus23 deleted the size branch February 28, 2024 13:14
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.

2 participants