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

[Bug]: gov module LegacyProposals API is not working when empty proposal is submitted #15977

Closed
Hemanthghs opened this issue Apr 28, 2023 · 2 comments · Fixed by #15979
Closed

Comments

@Hemanthghs
Copy link
Contributor

Summary of Bug

Legacy Proposals API is not working if empty proposal is submitted.
If an empty proposal is submitted then Legacy Proposals API is not returning the previous proposals also.
First I have submitted a Software upgrade proposal and I tried to get the proposals with legacy API, then it has returned the proposal without any problem.
Immediately I have submitted a second proposal which is an empty proposal and tried to get the proposals, It is not returning the all proposals instead it is returning the following response.

{
    "code": 2,
    "message": "codespace sdk code 29: invalid type: can't convert a gov/v1 Proposal to gov/v1beta1 Proposal when amount of 
    proposal messages is more than one",
    "details": [ ]
}

Version

v0.46.x

Steps to Reproduce

  1. First submit a non empty proposal (Example: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade" )
  2. Next submit an empty proposal as follows
    {
      "metadata": "ipfs://CID",
      "deposit": "1909stake"
    }
  1. Now call the LegacyProposals API ( http://localhost:1317/cosmos/gov/v1beta1/proposals )
@julienrbrt
Copy link
Member

julienrbrt commented Apr 28, 2023

This is behaving as expected, actually. The endpoint will not return correct data if it was skipping a proposal.
Hence, it simply fails: #14347 (comment)

@julienrbrt
Copy link
Member

We could convert a proposal without message to a legacy text proposal, but I am not sure if that will render well, given metadata will just be dumped as it. What do you think @alexanderbez?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants