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

Post OptionalData improvements #422

Closed
RiccardoM opened this issue May 14, 2021 · 0 comments · Fixed by #435
Closed

Post OptionalData improvements #422

RiccardoM opened this issue May 14, 2021 · 0 comments · Fixed by #435
Assignees
Labels
kind/enhancement Enhance an already existing feature; no "New feature" to add x/posts Post module
Milestone

Comments

@RiccardoM
Copy link
Contributor

Currently inside the x/posts module we have defined two types to handle the optional data that's associated with a post:

  • OptionalDataEntry that represents a single optional data, and
  • OptionalData that represents a slice of optional data

In my opinion, these very similar names might be confusing for external developers. Also, I think the current naming of OptionalData might be confusing as well. For this reason, I propose the following changes:

  1. Remove the OptionalData type and use only the []OptionalDataEntry
  2. Rename the OptionalDataEntry type to be Attribute
  3. Rename the OptionalData field of a Post into AdditionalAttributes

This way, the final Post object would then be something like

type Post struct {
  AdditionalAttributes []Attribute
}

IMO, this would make it very easy for external developers to understand that they can insert additional things inside that array.

@RiccardoM RiccardoM added kind/enhancement Enhance an already existing feature; no "New feature" to add x/posts Post module labels May 14, 2021
@RiccardoM RiccardoM added this to the v0.17.0 milestone May 14, 2021
@dadamu dadamu self-assigned this May 24, 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