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

Wrong behaviour of --allows-comments flag #386

Closed
leobragaz opened this issue Mar 17, 2021 · 1 comment · Fixed by #397
Closed

Wrong behaviour of --allows-comments flag #386

leobragaz opened this issue Mar 17, 2021 · 1 comment · Fixed by #397
Assignees
Labels
kind/bug Something isn't working x/posts Post module
Milestone

Comments

@leobragaz
Copy link
Contributor

Bug description

I was testing contract serialization and found out some weird behaviour while creating a post.
If someone create a post from CLI using the --allows-comments without append the = to it will result in two different results depending on if the post has a message or not.

  1. If the post has a message the CLI will throw the error Error: accepts between 1 and 2 arg(s), received 3
  2. If the post has no message the result will be more tricky as the tx will be broadcasted without any error and the post will be saved with a message equal to "false/true" and the flag will always be true according to its default behaviour.

Steps to reproduce

Result 1) desmos tx posts create "4e188d9c17150037d5199bbdb91ae1eb2a78a15aca04cb35530cccb81494b36e" "mess" --from leo --chain-id <chai-id> --keyring-backend <keyring-type> --attachment "https://example.com/attachment1,text/plain,desmos1ulmv2dyc8zjmhk9zlsq4ajpudwc8zjfm82aysr" --allows-comments false

Result 2)

  1. desmos tx posts create "4e188d9c17150037d5199bbdb91ae1eb2a78a15aca04cb35530cccb81494b36e" --from <key-name> --chain-id <chain-id> --keyring-backend <keyring-type> --attachment "https://example.com/attachment1,text/plain,desmos1ulmv2dyc8zjmhk9zlsq4ajpudwc8zjfm82aysr" --allows-comments false --chain-id <chain-id> --keyring-backend <keyring-type>
  2. desmos query posts post <post-id>

Expected behavior

--allows-comments set the correct value to true or false.
If it's not possibile to use it without =, then we need to specify it inside docs.

@leobragaz leobragaz added the kind/bug Something isn't working label Mar 17, 2021
@leobragaz leobragaz assigned RiccardoM and unassigned RiccardoM Mar 17, 2021
@RiccardoM
Copy link
Contributor

@bragaz I think a better way to fix this would be to rename the command something like --disable-comments setting it to false by default, which will become true if such flag is specified.

@RiccardoM RiccardoM added this to the v0.16.0 milestone Apr 19, 2021
@RiccardoM RiccardoM added the x/posts Post module label Apr 19, 2021
@leobragaz leobragaz mentioned this issue Apr 19, 2021
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working x/posts Post module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants