MCPcopy Create free account
hub / github.com/Sifchain/sifnode / GetWhitelistCmd

Function GetWhitelistCmd

x/margin/client/cli/tx.go:359–390  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

357}
358
359func GetWhitelistCmd() *cobra.Command {
360 cmd := &cobra.Command{
361 Use: "whitelist [address]",
362 Short: "Whitelist the provided address",
363 Args: cobra.ExactArgs(1),
364 RunE: func(cmd *cobra.Command, args []string) error {
365 clientCtx, err := client.GetClientTxContext(cmd)
366 if err != nil {
367 return err
368 }
369
370 signer := clientCtx.GetFromAddress()
371 if signer == nil {
372 return errors.New("signer address is missing")
373 }
374
375 msg := types.MsgWhitelist{
376 Signer: signer.String(),
377 WhitelistedAddress: args[0],
378 }
379
380 err = tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg)
381 if err != nil {
382 return err
383 }
384
385 return nil
386 },
387 }
388 flags.AddTxFlagsToCmd(cmd)
389 return cmd
390}
391
392func GetDewhitelistCmd() *cobra.Command {
393 cmd := &cobra.Command{

Callers 1

GetTxCmdFunction · 0.85

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected