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

Function GetCmdQueryIsWhitelist

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

Source from the content-addressed store, hash-verified

245}
246
247func GetCmdQueryIsWhitelist() *cobra.Command {
248 cmd := &cobra.Command{
249 Use: "is-whitelisted [address]",
250 Short: "query whitelist for one address",
251 Args: cobra.ExactArgs(1),
252 RunE: func(cmd *cobra.Command, args []string) error {
253 clientCtx, err := client.GetClientQueryContext(cmd)
254 if err != nil {
255 return err
256 }
257
258 queryClient := types.NewQueryClient(clientCtx)
259 res, err := queryClient.IsWhitelisted(context.Background(), &types.IsWhitelistedRequest{
260 Address: args[0],
261 })
262 if err != nil {
263 return err
264 }
265
266 return clientCtx.PrintProto(res)
267 },
268 }
269 flags.AddQueryFlagsToCmd(cmd)
270 return cmd
271}

Callers 1

GetQueryCmdFunction · 0.85

Calls 2

IsWhitelistedMethod · 0.95
NewQueryClientFunction · 0.92

Tested by

no test coverage detected