Question regarding proposal submitions
What helper do we need to use to format the content for createTxMsgSubmitProposal
I'm trying to do this:
const content = createMsgSubmitProposal(
{
type: "cosmos-sdk/TextProposal",
value: {
title: "title",
description: "description",
},
},
"azeta",
"100",
address
);
And I'm then passing these params to createTxMsgSubmitProposal:
{
content,
initialDepositDenom: "azeta",
initialDepositAmount: "100",
proposer: address,
}
With this I get this error:
And if I add the toArray and serialize functions manually to the content (because I'm not sure what helper to use to format the content) I get:
I'm now passing the following value createMsgSubmitProposal(...).message.content to createTxMsgSubmitProposal but still get the missing value error for field proposal_id of type uint64.
I still have the toArray and serialize in createMsgSubmitProposal
const content = createMsgSubmitProposal(
{
type: "cosmos-sdk/TextProposal",
value: {
title: "title",
description: "description",
},
toArray: () => [],
serialize: () => {},
},
"azeta",
"100",
address
);
@hanchon @GAtom22 any ideas? It would be helpful to get an example of how you convert the content to a google.protobuf.Any
@juansalvatore you can try to create content directly from protobuf
import {
createTxMsgSubmitProposal,
MessageMsgSubmitProposal,
} from "@evmos/transactions";
import * as govProto from "@evmos/proto/dist/proto/cosmos/gov/v1beta1/gov";
const { TextProposal } = govProto.cosmos.gov.v1beta1;
const proposalParams: MessageMsgSubmitProposal = {
content: TextProposal.fromObject({
title: "",
description,
}),
proposer: senderhaqqAddress,
initialDepositAmount: depositAmount,
initialDepositDenom: depositDenom,
};
const msg = createTxMsgSubmitProposal(
chain,
sender,
DEFAULT_FEE,
"memo",
proposalParams
);