()
| 322 | } |
| 323 | |
| 324 | func GetUpdateRowanCollateralCmd() *cobra.Command { |
| 325 | cmd := &cobra.Command{ |
| 326 | Use: "update-rowan-collateral", |
| 327 | Short: "Enable or disable opening margin positions with rowan collateral.", |
| 328 | RunE: func(cmd *cobra.Command, args []string) error { |
| 329 | clientCtx, err := client.GetClientTxContext(cmd) |
| 330 | if err != nil { |
| 331 | return err |
| 332 | } |
| 333 | |
| 334 | signer := clientCtx.GetFromAddress() |
| 335 | if signer == nil { |
| 336 | return errors.New("signer address is missing") |
| 337 | } |
| 338 | |
| 339 | rowanCollateralEnabled := viper.GetBool("enabled") |
| 340 | |
| 341 | msg := types.MsgUpdateRowanCollateral{ |
| 342 | Signer: signer.String(), |
| 343 | RowanCollateralEnabled: rowanCollateralEnabled, |
| 344 | } |
| 345 | if err := msg.ValidateBasic(); err != nil { |
| 346 | return err |
| 347 | } |
| 348 | |
| 349 | return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg) |
| 350 | }, |
| 351 | } |
| 352 | cmd.Flags().Bool("enabled", true, "rowan collateral enabled for margin [bool]") |
| 353 | _ = cmd.MarkFlagRequired("enabled") |
| 354 | flags.AddTxFlagsToCmd(cmd) |
| 355 | |
| 356 | return cmd |
| 357 | } |
| 358 | |
| 359 | func GetWhitelistCmd() *cobra.Command { |
| 360 | cmd := &cobra.Command{ |
no test coverage detected