()
| 72 | } |
| 73 | |
| 74 | func GetCmdQueryPositionsForPool() *cobra.Command { |
| 75 | cmd := &cobra.Command{ |
| 76 | Use: "positions-for-pool [asset]", |
| 77 | Short: "query positions for a pool", |
| 78 | Args: cobra.ExactArgs(1), |
| 79 | RunE: func(cmd *cobra.Command, args []string) error { |
| 80 | clientCtx, err := client.GetClientQueryContext(cmd) |
| 81 | if err != nil { |
| 82 | return err |
| 83 | } |
| 84 | |
| 85 | asset := args[0] |
| 86 | |
| 87 | pageReq, err := client.ReadPageRequest(cmd.Flags()) |
| 88 | if err != nil { |
| 89 | return err |
| 90 | } |
| 91 | |
| 92 | queryClient := types.NewQueryClient(clientCtx) |
| 93 | res, err := queryClient.GetPositionsByPool(context.Background(), &types.PositionsByPoolRequest{ |
| 94 | Asset: asset, |
| 95 | Pagination: pageReq, |
| 96 | }) |
| 97 | if err != nil { |
| 98 | return err |
| 99 | } |
| 100 | |
| 101 | return clientCtx.PrintProto(res) |
| 102 | }, |
| 103 | } |
| 104 | flags.AddQueryFlagsToCmd(cmd) |
| 105 | flags.AddPaginationFlagsToCmd(cmd, "positions-for-pool") |
| 106 | return cmd |
| 107 | } |
| 108 | |
| 109 | func GetCmdQueryPositions() *cobra.Command { |
| 110 | cmd := &cobra.Command{ |
no test coverage detected