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

auto generate cli Tx/Querier on new proto methods #79

Closed
Reecepbcups opened this issue Mar 6, 2024 · 2 comments
Closed

auto generate cli Tx/Querier on new proto methods #79

Reecepbcups opened this issue Mar 6, 2024 · 2 comments

Comments

@Reecepbcups
Copy link
Member

Reecepbcups commented Mar 6, 2024

on proto-stub, dot his too as a nice to have base

func MsgSetServiceName() *cobra.Command {
	cmd := &cobra.Command{
		Use:   "set [name]",
		Short: "Set the nameservice value",
		Args:  cobra.ExactArgs(1),
		RunE: func(cmd *cobra.Command, args []string) error {
			cliCtx, err := client.GetClientTxContext(cmd)
			if err != nil {
				return err
			}

			senderAddress := cliCtx.GetFromAddress()

			msg := &types.MsgSetServiceName{
				Sender: senderAddress.String(),
				Name:   args[0],
			}

			return tx.GenerateOrBroadcastTxCLI(cliCtx, cmd.Flags(), msg)
		},
	}

	flags.AddTxFlagsToCmd(cmd)
	return cmd
}

and also add to txCmd.AddCommand

@Reecepbcups
Copy link
Member Author

bug julien on AutoCLI

@Reecepbcups
Copy link
Member Author

did not have to bug - you can't use GetTxCmd & GetQuerierCmd, else it just uses the overrides. Looks like this is a thing until SDK v51

#80

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

No branches or pull requests

1 participant