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 PostReactions paginated query method #504

Closed
dadamu opened this issue Jun 21, 2021 · 1 comment · Fixed by #515
Closed

Add PostReactions paginated query method #504

dadamu opened this issue Jun 21, 2021 · 1 comment · Fixed by #515
Assignees
Labels
kind/enhancement Enhance an already existing feature; no "New feature" to add x/posts Post module
Milestone

Comments

@dadamu
Copy link
Contributor

dadamu commented Jun 21, 2021

Feature description

This issue is related to #498. In current version, it does not provide GetPostReactions functions for paginated querying. In addition, PostReactions are stored whole array to a key now, all of them should be one to one association with the key.

Implementation proposal

To implement the pagination to PostReactions, the store key of it should be reconstructed PostReationsStorePrefix + '<post-id>' + '<user-address>' + '<reaction-id>'.
This allows:

  1. Get all the reactions of the post
  2. Check if a specific reaction created by user exists with O(1) time complexity

Besides, the cli tool provides desmos query posts post-reactions [post-id] [[user]] to get the post reactions toward the post with the optional user address.

What do you think? @RiccardoM @bragaz

@dadamu dadamu added kind/enhancement Enhance an already existing feature; no "New feature" to add x/posts Post module labels Jun 21, 2021
@RiccardoM
Copy link
Contributor

I agree with this implementation proposal

@dadamu dadamu self-assigned this Jun 24, 2021
@RiccardoM RiccardoM added this to the v0.18.0 milestone Jun 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Enhance an already existing feature; no "New feature" to add x/posts Post module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants