()
| 107 | } |
| 108 | |
| 109 | func GetCmdQueryPositions() *cobra.Command { |
| 110 | cmd := &cobra.Command{ |
| 111 | Use: "positions", |
| 112 | Short: "query all positions", |
| 113 | Args: cobra.ExactArgs(0), |
| 114 | RunE: func(cmd *cobra.Command, args []string) error { |
| 115 | clientCtx, err := client.GetClientQueryContext(cmd) |
| 116 | if err != nil { |
| 117 | return err |
| 118 | } |
| 119 | |
| 120 | pageReq, err := client.ReadPageRequest(cmd.Flags()) |
| 121 | if err != nil { |
| 122 | return err |
| 123 | } |
| 124 | |
| 125 | queryClient := types.NewQueryClient(clientCtx) |
| 126 | res, err := queryClient.GetPositions(context.Background(), &types.PositionsRequest{ |
| 127 | Pagination: pageReq, |
| 128 | }) |
| 129 | if err != nil { |
| 130 | return err |
| 131 | } |
| 132 | |
| 133 | return clientCtx.PrintProto(res) |
| 134 | }, |
| 135 | } |
| 136 | flags.AddQueryFlagsToCmd(cmd) |
| 137 | flags.AddPaginationFlagsToCmd(cmd, "positions") |
| 138 | return cmd |
| 139 | } |
| 140 | |
| 141 | func GetCmdQueryStatus() *cobra.Command { |
| 142 | cmd := &cobra.Command{ |
no test coverage detected