Skip to content

Commit

Permalink
CLI: query ibc-transfer escrow-address (#9383)
Browse files Browse the repository at this point in the history
  • Loading branch information
ebuchman authored May 25, 2021
1 parent 842b060 commit 3550f15
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ Ref: https://keepachangelog.com/en/1.0.0/

# Changelog

## Unreleased

### Features


* [\#9383](https://github.com/cosmos/cosmos-sdk/pull/9383) New CLI command `query ibc-transfer escrow-address <port> <channel id>` to get the escrow address for a channel; can be used to then query balance of escrowed tokens


## [v0.42.5](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.5) - 2021-05-18

### Bug Fixes
Expand Down
1 change: 1 addition & 0 deletions x/ibc/applications/transfer/client/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ func GetQueryCmd() *cobra.Command {
GetCmdQueryDenomTrace(),
GetCmdQueryDenomTraces(),
GetCmdParams(),
GetCmdQueryEscrowAddress(),
)

return queryCmd
Expand Down
22 changes: 22 additions & 0 deletions x/ibc/applications/transfer/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,25 @@ func GetCmdParams() *cobra.Command {

return cmd
}

// GetCmdParams returns the command handler for ibc-transfer parameter querying.
func GetCmdQueryEscrowAddress() *cobra.Command {
cmd := &cobra.Command{
Use: "escrow-address",
Short: "Get the escrow address for a channel",
Long: "Get the escrow address for a channel",
Args: cobra.ExactArgs(2),
Example: fmt.Sprintf("%s query ibc-transfer escrow-address [port] [channel-id]", version.AppName),
RunE: func(cmd *cobra.Command, args []string) error {
port := args[0]
channel := args[1]
addr := types.GetEscrowAddress(port, channel)
fmt.Println(addr.String())
return nil
},
}

flags.AddQueryFlagsToCmd(cmd)

return cmd
}

0 comments on commit 3550f15

Please sign in to comment.