@@ -22,6 +22,7 @@ func GetQueryCmd() *cobra.Command {
22
22
23
23
cmd .AddCommand (
24
24
GetQueryCmdMember (),
25
+ GetQueryCmdMembers (),
25
26
GetQueryCmdCurrentGroup (),
26
27
GetQueryCmdParams (),
27
28
GetQueryCmdSigning (),
@@ -62,12 +63,47 @@ func GetQueryCmdMember() *cobra.Command {
62
63
return cmd
63
64
}
64
65
66
+ // GetQueryCmdMembers creates a CLI command for querying members information.
67
+ func GetQueryCmdMembers () * cobra.Command {
68
+ cmd := & cobra.Command {
69
+ Use : "members [is-active]" ,
70
+ Short : "Query the members information of the active group" ,
71
+ Args : cobra .ExactArgs (1 ),
72
+ RunE : func (cmd * cobra.Command , args []string ) error {
73
+ clientCtx , err := client .GetClientQueryContext (cmd )
74
+ if err != nil {
75
+ return err
76
+ }
77
+
78
+ isActive , err := strconv .ParseBool (args [0 ])
79
+ if err != nil {
80
+ return err
81
+ }
82
+
83
+ queryClient := types .NewQueryClient (clientCtx )
84
+
85
+ res , err := queryClient .Members (cmd .Context (), & types.QueryMembersRequest {
86
+ IsActive : isActive ,
87
+ })
88
+ if err != nil {
89
+ return err
90
+ }
91
+
92
+ return clientCtx .PrintProto (res )
93
+ },
94
+ }
95
+
96
+ flags .AddQueryFlagsToCmd (cmd )
97
+
98
+ return cmd
99
+ }
100
+
65
101
// GetQueryCmdCurrentGroup creates a CLI command for querying current group.
66
102
func GetQueryCmdCurrentGroup () * cobra.Command {
67
103
cmd := & cobra.Command {
68
104
Use : "current-group" ,
69
105
Short : "Query the currentGroup" ,
70
- Args : cobra .ExactArgs ( 0 ) ,
106
+ Args : cobra .NoArgs ,
71
107
RunE : func (cmd * cobra.Command , args []string ) error {
72
108
clientCtx , err := client .GetClientQueryContext (cmd )
73
109
if err != nil {
@@ -95,7 +131,7 @@ func GetQueryCmdParams() *cobra.Command {
95
131
Use : "params" ,
96
132
Short : "Show params" ,
97
133
Long : "Show parameter of bandtss module" ,
98
- Args : cobra .ExactArgs ( 0 ) ,
134
+ Args : cobra .NoArgs ,
99
135
RunE : func (cmd * cobra.Command , args []string ) error {
100
136
clientCtx , err := client .GetClientQueryContext (cmd )
101
137
if err != nil {
@@ -154,7 +190,7 @@ func GetQueryCmdReplacement() *cobra.Command {
154
190
cmd := & cobra.Command {
155
191
Use : "replacement" ,
156
192
Short : "Query the replacement information" ,
157
- Args : cobra .ExactArgs ( 0 ) ,
193
+ Args : cobra .NoArgs ,
158
194
RunE : func (cmd * cobra.Command , args []string ) error {
159
195
clientCtx , err := client .GetClientQueryContext (cmd )
160
196
if err != nil {
0 commit comments