Skip to content

Commit

Permalink
add cli query
Browse files Browse the repository at this point in the history
  • Loading branch information
lumtis committed Oct 6, 2023
1 parent a41be54 commit fa38d01
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions x/fungible/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ func GetQueryCmd(_ string) *cobra.Command {
CmdShowForeignCoins(),
CmdGasStabilityPoolAddress(),
CmdGasStabilityPoolBalance(),
CmdSystemContract(),
)

return cmd
Expand Down
32 changes: 32 additions & 0 deletions x/fungible/client/cli/query_system_contract.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package cli

import (
"context"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/spf13/cobra"
"github.com/zeta-chain/zetacore/x/fungible/types"
)

func CmdSystemContract() *cobra.Command {
cmd := &cobra.Command{
Use: "system-contract",
Short: "query system contract",
RunE: func(cmd *cobra.Command, args []string) error {
clientCtx := client.GetClientContextFromCmd(cmd)
queryClient := types.NewQueryClient(clientCtx)

res, err := queryClient.SystemContract(context.Background(), &types.QueryGetSystemContractRequest{})
if err != nil {
return err
}

return clientCtx.PrintProto(res)
},
}

flags.AddQueryFlagsToCmd(cmd)

return cmd
}

0 comments on commit fa38d01

Please sign in to comment.