-
Notifications
You must be signed in to change notification settings - Fork 58
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: waku store sync 2.0 storage and tests #3215
Conversation
You can find the image built from this PR at
Built from 16f8759 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, went through this in some detail. lgtm! Good job :). Would it be useful to have a set of unit tests for each public method (insert
, batchInsert
, prune
) to test the boundary conditions at each?
Yes, I will add some. |
method insert*( | ||
self: SyncStorage, element: ID | ||
): Result[void, string] {.base, gcsafe, raises: [].} = | ||
discard |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe insert
should be idempotent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like the "idempotent" word but, what does it mean in this context ;P ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, when inserting with the same element the first call would be ok()
but if you call again err()
since the element was already present.
An idempotent function would always insert the same element at the same index and would result in no side effect when calling the same func with the same element multiple times.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for it 🥳
Approving to not block
I just added some nitpick comments ;P
method insert*( | ||
self: SyncStorage, element: ID | ||
): Result[void, string] {.base, gcsafe, raises: [].} = | ||
discard |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like the "idempotent" word but, what does it mean in this context ;P ?
395a23f
to
afde3cf
Compare
Description
Second PR for new Waku store sync 2.0
Include everything Storage related and tests
Specification
Research issue
Changes
N.B. Cannot be merged before #3213
Followed by #3216
Issue