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

Limit the length of posts #67

Closed
RiccardoM opened this issue Jan 7, 2020 · 0 comments
Closed

Limit the length of posts #67

RiccardoM opened this issue Jan 7, 2020 · 0 comments
Assignees
Labels
kind/enhancement Enhance an already existing feature; no "New feature" to add x/posts Post module
Milestone

Comments

@RiccardoM
Copy link
Contributor

Context

As discussed inside #61, we should limit the length of posts to 500 characters. Longer should be uploaded to IPFS in order to avoid an uncontrolled grow of the chain on-disk size.

Solution

The solution is pretty straightforward and can be implemented as a check inside the MsgCreatePost, MsgEditPost and Post#Validate methods:

if len(post.Message) > 500 {
  // return error
}
@RiccardoM RiccardoM added kind/enhancement Enhance an already existing feature; no "New feature" to add x/posts Post module labels Jan 7, 2020
@RiccardoM RiccardoM added this to the v0.2.0 milestone Jan 7, 2020
@RiccardoM RiccardoM self-assigned this Jan 8, 2020
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

No branches or pull requests

1 participant