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

Move the current posts constants to chain parameters #172

Closed
RiccardoM opened this issue May 21, 2020 · 0 comments · Fixed by #204
Closed

Move the current posts constants to chain parameters #172

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

Comments

@RiccardoM
Copy link
Contributor

Context

Currently when checking the validity of the posts when the user creates or edited one, there are the current checks that are performed:

  • a post cannot be over 500 character long
  • the maximum number of optional fields is 10
  • each optional field value can be at most 200 characters long

While all these values have currently worked out pretty good, having them hard coded creates two main problems:

  1. in order to know their value you need to check at the chain code;
  2. they are arbitrarily chosen by us and cannot be changed without a source code edit.

Solution

In order to solve both above mentioned problems, I think we should move them from being hard-coded inside the keys.go file to be on-chain parameters. This would allow:

  1. everyone to query those specifications (particularly useful for clients);
  2. changeable through governance proposals.

In order to do this we can do the same way that other modules do it. A reference can for example be the x/gov module of the Cosmos SDK. The references files should be (might not be a complete list):

Also the params registration should be done inside the app.go file as well (app.go registration for the gov params).

@RiccardoM RiccardoM added kind/enhancement Enhance an already existing feature; no "New feature" to add x/posts Post module labels May 21, 2020
@RiccardoM RiccardoM added this to the v0.8.0 milestone May 21, 2020
@RiccardoM RiccardoM added this to To do in Desmos May 22, 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
No open projects
Desmos
  
To do
Development

Successfully merging a pull request may close this issue.

2 participants