Skip to content

Commit

Permalink
feat(client): add alias event-query-tx-for to wait-tx for backwar…
Browse files Browse the repository at this point in the history
…ds compatibility
  • Loading branch information
Pitasi committed Mar 27, 2024
1 parent 4d3108b commit 5f30196
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions client/rpc/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,18 @@ func newResponseFormatBroadcastTxCommit(res *coretypes.ResultBroadcastTxCommit)
return newTxResponseDeliverTx(res)
}

// QueryEventForTxCmd is an alias for WaitTxCmd, kept for backwards compatibility.
func QueryEventForTxCmd() *cobra.Command {
return WaitTxCmd()
}

// WaitTx returns a CLI command that waits for a transaction with the given hash to be included in a block.
func WaitTxCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "wait-tx [hash]",
Short: "Wait for a transaction to be included in a block",
Long: `Subscribes to a CometBFT WebSocket connection and waits for a transaction event with the given hash.`,
Use: "wait-tx [hash]",
Aliases: []string{"event-query-tx-for"},
Short: "Wait for a transaction to be included in a block",
Long: `Subscribes to a CometBFT WebSocket connection and waits for a transaction event with the given hash.`,
Example: fmt.Sprintf(`By providing the transaction hash:
$ %[1]sd q wait-tx [hash]
Expand Down

0 comments on commit 5f30196

Please sign in to comment.