Documentation ¶
Index ¶
- Constants
- Variables
- func PrintUnsignedTx(cliCtx context.CLIContext, txBldr authtypes.TxBuilder, msgs []sdk.Msg, ...) error
- func SetViperWithArgs(args []string)
- func TestQueryCmd(t *testing.T, cmdFactory func() *cobra.Command, args string, ...)
- func TestTxCmd(t *testing.T, cmdFactory func() *cobra.Command, args string, ...)
- type MsgWithAccAddress
Constants ¶
View Source
const FlagGenerateUnsignedTx = "generate-unsigned-tx"
Variables ¶
View Source
var CliQuery = func(cdc *codec.Codec, path string, param interface{}) error { var bz []byte var err error bz = nil if param != nil { bz, err = cdc.MarshalJSON(param) if err != nil { return err } } cliCtx := context.NewCLIContext().WithCodec(cdc) res, _, err := cliCtx.QueryWithData(path, bz) if err != nil { return err } fmt.Println(string(res)) return nil }
View Source
var CliRunCommand = func(cdc *codec.Codec, msg MsgWithAccAddress) error { cliCtx := context.NewCLIContext().WithCodec(cdc) senderAddr := cliCtx.GetFromAddress() msg.SetAccAddress(senderAddr) if err := msg.ValidateBasic(); err != nil { return err } txBldr := auth.NewTxBuilderFromCLI().WithTxEncoder(utils.GetTxEncoder(cdc)) generateUnsignedTx := viper.GetBool(FlagGenerateUnsignedTx) if generateUnsignedTx { return PrintUnsignedTx(cliCtx, txBldr, []sdk.Msg{msg}, senderAddr) } return utils.GenerateOrBroadcastMsgs(cliCtx, txBldr, []sdk.Msg{msg}) }
Functions ¶
func PrintUnsignedTx ¶
func PrintUnsignedTx(cliCtx context.CLIContext, txBldr authtypes.TxBuilder, msgs []sdk.Msg, from sdk.AccAddress) error
func SetViperWithArgs ¶
func SetViperWithArgs(args []string)
func TestQueryCmd ¶
Types ¶
type MsgWithAccAddress ¶
type MsgWithAccAddress interface { sdk.Msg SetAccAddress(address sdk.AccAddress) }
Click to show internal directories.
Click to hide internal directories.