Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

Question regarding proposal submitions #173

Open
juansalvatore opened this issue Jun 9, 2023 · 3 comments
Open

Question regarding proposal submitions #173

juansalvatore opened this issue Jun 9, 2023 · 3 comments

Comments

@juansalvatore
Copy link

juansalvatore commented Jun 9, 2023

What helper do we need to use to format the content for createTxMsgSubmitProposal
image

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:
image

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:
image

@juansalvatore
Copy link
Author

juansalvatore commented Jun 9, 2023

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
    );
image

@juansalvatore
Copy link
Author

@hanchon @GAtom22 any ideas?
It would be helpful to get an example of how you convert the content to a google.protobuf.Any

@olegshilov
Copy link
Contributor

@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
);

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

No branches or pull requests

2 participants