Skip to content

Conversation

@vincentysc
Copy link
Contributor

@vincentysc vincentysc commented Jan 30, 2026

Issue

submit proposal with msg type /cosmos.gov.v1.MsgSubmitProposal and no msgs in the request will got error on cosmos API https://rest.testnet-croeseid-4.cronos-pos.org/cosmos/gov/v1beta1/proposals/1579

Error msg

codespace sdk code 29: invalid type: can't convert a gov/v1 Proposal to gov/v1beta1 Proposal when amount of proposal messages not exactly one

Solution

Prove

MsgSubmitProposal and QueryProposalRequest are both under the same version v1beta1 .

MsgSubmitProposal in tx.proto
package cosmos.gov.v1beta1;

message MsgSubmitProposal {
  option (cosmos.msg.v1.signer) = "proposer";
  option (amino.name)           = "cosmos-sdk/MsgSubmitProposal";

  option (gogoproto.equal)           = false;
  option (gogoproto.goproto_getters) = false;

  // content is the proposal's content.
  google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "cosmos.gov.v1beta1.Content"];
...
}

https://github.com/crypto-org-chain/cosmos-sdk/blob/8d0a31ef043d1593cdfc702f9504ea7e199760c9/proto/cosmos/gov/v1beta1/tx.proto#L35-L43

QueryProposalRequest in query.proto
package cosmos.gov.v1beta1; 
rpc Proposal(QueryProposalRequest) returns (QueryProposalResponse) {
    option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}";
  }

https://github.com/crypto-org-chain/cosmos-sdk/blob/8d0a31ef043d1593cdfc702f9504ea7e199760c9/proto/cosmos/gov/v1beta1/query.proto#L16-L18

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 this pull request may close these issues.

3 participants