Skip to content

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

Description

@Hemanthghs

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 )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions