Skip to content

Commit

Permalink
feat(cmd): add a command to query pending execute claim (#630)
Browse files Browse the repository at this point in the history
Co-authored-by: fx0x55 <80245546+fx0x55@users.noreply.github.com>
  • Loading branch information
zakir-code and fx0x55 authored Aug 7, 2024
1 parent eb613c6 commit 85dbe41
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions x/crosschain/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ func getQuerySubCmds(chainName string) []*cobra.Command {
// pending bridge call
CmdGetPendingBridgeCalls(chainName),
CmdGetPendingBridgeCall(chainName),

CmdGetPendingExecuteClaim(chainName),
}

for _, command := range cmds {
Expand Down Expand Up @@ -1051,3 +1053,31 @@ func CmdGetPendingBridgeCall(chainName string) *cobra.Command {
}
return cmd
}

func CmdGetPendingExecuteClaim(chainName string) *cobra.Command {
cmd := &cobra.Command{
Use: "pending-execute-claim",
Short: "Query pending execute claim",
Args: cobra.ExactArgs(0),
RunE: func(cmd *cobra.Command, args []string) error {
clientCtx := client.GetClientContextFromCmd(cmd)
queryClient := types.NewQueryClient(clientCtx)

pageReq, err := client.ReadPageRequest(cmd.Flags())
if err != nil {
return err
}

res, err := queryClient.PendingExecuteClaim(cmd.Context(), &types.QueryPendingExecuteClaimRequest{
ChainName: chainName,
Pagination: pageReq,
})
if err != nil {
return err
}
return clientCtx.PrintProto(res)
},
}
flags.AddPaginationFlagsToCmd(cmd, "pending execute claim")
return cmd
}

0 comments on commit 85dbe41

Please sign in to comment.