github.com/Finschia/finschia-sdk@v0.48.1/x/evidence/client/cli/tx.go (about) 1 package cli 2 3 import ( 4 "github.com/Finschia/finschia-sdk/client" 5 "github.com/Finschia/finschia-sdk/x/evidence/types" 6 7 "github.com/spf13/cobra" 8 ) 9 10 // GetTxCmd returns a CLI command that has all the native evidence module tx 11 // commands mounted. In addition, it mounts all childCmds, implemented by outside 12 // modules, under a sub-command. This allows external modules to implement custom 13 // Evidence types and Handlers while having the ability to create and sign txs 14 // containing them all from a single root command. 15 func GetTxCmd(childCmds []*cobra.Command) *cobra.Command { 16 cmd := &cobra.Command{ 17 Use: types.ModuleName, 18 Short: "Evidence transaction subcommands", 19 DisableFlagParsing: true, 20 SuggestionsMinimumDistance: 2, 21 RunE: client.ValidateCmd, 22 } 23 24 submitEvidenceCmd := SubmitEvidenceCmd() 25 for _, childCmd := range childCmds { 26 submitEvidenceCmd.AddCommand(childCmd) 27 } 28 29 // TODO: Add tx commands. 30 31 return cmd 32 } 33 34 // SubmitEvidenceCmd returns the top-level evidence submission command handler. 35 // All concrete evidence submission child command handlers should be registered 36 // under this command. 37 func SubmitEvidenceCmd() *cobra.Command { 38 cmd := &cobra.Command{ 39 Use: "submit", 40 Short: "Submit arbitrary evidence of misbehavior", 41 } 42 43 return cmd 44 }