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

Function GetCmdQueryWhitelist

x/margin/client/cli/query.go:215–245  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

213}
214
215func GetCmdQueryWhitelist() *cobra.Command {
216 cmd := &cobra.Command{
217 Use: "whitelist",
218 Short: "query whitelist of allowed addresses",
219 Args: cobra.ExactArgs(0),
220 RunE: func(cmd *cobra.Command, args []string) error {
221 clientCtx, err := client.GetClientQueryContext(cmd)
222 if err != nil {
223 return err
224 }
225
226 pageReq, err := client.ReadPageRequest(cmd.Flags())
227 if err != nil {
228 return err
229 }
230
231 queryClient := types.NewQueryClient(clientCtx)
232 res, err := queryClient.GetWhitelist(context.Background(), &types.WhitelistRequest{
233 Pagination: pageReq,
234 })
235 if err != nil {
236 return err
237 }
238
239 return clientCtx.PrintProto(res)
240 },
241 }
242 flags.AddQueryFlagsToCmd(cmd)
243 flags.AddPaginationFlagsToCmd(cmd, "whitelist")
244 return cmd
245}
246
247func GetCmdQueryIsWhitelist() *cobra.Command {
248 cmd := &cobra.Command{

Callers 1

GetQueryCmdFunction · 0.85

Calls 2

GetWhitelistMethod · 0.95
NewQueryClientFunction · 0.92

Tested by

no test coverage detected