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 missing store impls & add len #21

Merged
merged 1 commit into from
Jun 27, 2024

Conversation

expede
Copy link
Contributor

@expede expede commented Jun 25, 2024

Hey folks!

I've been refactoring a library to use Blockstore instead of my bespoke library-internal one, and found that it was difficult to test and debug a couple things. I've added a few impls (where possible), plus len so that I can ensure some of my storage tests are exhaustive.

  • InMemoryBlockstore
    • Traits: add Clone and Debug
    • Functions: add len
  • LruBlockstore
    • Traits: add Debug
    • Functions: add len

It might make sense to put that len on the Blockstore trait, but I figured on the lightest stores which have underlying lens was the most conservative approach for now.

Please let me know if I can add anything else, or if you'd like any changes :)

src/lru_blockstore.rs Outdated Show resolved Hide resolved
@expede expede force-pushed the in-memory-impls branch from 1d53c8a to 435cbfa Compare June 25, 2024 21:40
@oblique
Copy link
Member

oblique commented Jun 26, 2024

Please add is_empty to satisfy clippy.

* `InMemoryBlockstore`
  * Traits: add `Clone` and `Debug`
  * Functions: add `len`
* `LruBlockstore`
  * Traits: add `Debug`
  * Functions: add `len`
@expede expede force-pushed the in-memory-impls branch from 4bb3eb6 to c4a1297 Compare June 26, 2024 19:07
Copy link
Member

@oblique oblique left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks a lot @expede!

Copy link
Member

@fl0rek fl0rek left a comment

Choose a reason for hiding this comment

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

LGTM!

@oblique oblique merged commit 26a33f3 into eigerco:main Jun 27, 2024
6 checks passed
@zvolin zvolin mentioned this pull request Jun 27, 2024
@oblique
Copy link
Member

oblique commented Jun 27, 2024

Released in 0.6.0

@expede expede deleted the in-memory-impls branch June 27, 2024 21:03
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