From ed509803c08ea993ca74d916703ff70ecfc2c569 Mon Sep 17 00:00:00 2001 From: Sean King Date: Wed, 23 Feb 2022 16:18:47 +0100 Subject: [PATCH 1/6] feat: CLI cmd for MsgRegisterCounterpartyAddress --- modules/apps/29-fee/client/cli/cli.go | 1 + modules/apps/29-fee/client/cli/tx.go | 29 ++++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/modules/apps/29-fee/client/cli/cli.go b/modules/apps/29-fee/client/cli/cli.go index 9e18b088dc4..abb1d40c31b 100644 --- a/modules/apps/29-fee/client/cli/cli.go +++ b/modules/apps/29-fee/client/cli/cli.go @@ -33,6 +33,7 @@ func NewTxCmd() *cobra.Command { txCmd.AddCommand( NewPayPacketFeeAsyncTxCmd(), + NewRegisterCounterpartyAddress(), ) return txCmd diff --git a/modules/apps/29-fee/client/cli/tx.go b/modules/apps/29-fee/client/cli/tx.go index a9f66a71007..f811f95dbac 100644 --- a/modules/apps/29-fee/client/cli/tx.go +++ b/modules/apps/29-fee/client/cli/tx.go @@ -28,7 +28,7 @@ func NewPayPacketFeeAsyncTxCmd() *cobra.Command { Use: "pay-packet-fee [src-port] [src-channel] [sequence]", Short: "Pay a fee to incentivize an existing IBC packet", Long: strings.TrimSpace(`Pay a fee to incentivize an existing IBC packet.`), - Example: fmt.Sprintf("%s tx pay-packet-fee transfer channel-0 1 --recv-fee 10stake --ack-fee 10stake --timeout-fee 10stake", version.AppName), + Example: fmt.Sprintf("tx %s pay-packet-fee transfer channel-0 1 --recv-fee 10stake --ack-fee 10stake --timeout-fee 10stake", version.AppName), Args: cobra.ExactArgs(3), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) @@ -97,3 +97,30 @@ func NewPayPacketFeeAsyncTxCmd() *cobra.Command { return cmd } + +// NewRegisterCounterpartyAddress returns the command to create a MsgRegisterCounterpartyAddress +func NewRegisterCounterpartyAddress() *cobra.Command { + cmd := &cobra.Command{ + Use: "register-counter-party [address] [counterparty-address] [channel-id]", + Short: "Register a counterparty relayer address on a given channel.", + Long: strings.TrimSpace(`Register a counterparty relayer address on a given channel.`), + Example: fmt.Sprintf("tx %s register-counter-party cosmos1rsp837a4kvtgp2m4uqzdge0zzu6efqgucm0qdh cosmoss1sp921a4tttgpln6rqhdqe0zzu6efqgucm0qdh channel-0", version.AppName), + Args: cobra.ExactArgs(3), + RunE: func(cmd *cobra.Command, args []string) error { + fmt.Print(args[0], args[1], args[2]) + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgRegisterCounterpartyAddress(args[0], args[1], args[2]) + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} From 7cec6633af7ce2dce4beac7554f993f927f8eb83 Mon Sep 17 00:00:00 2001 From: Sean King Date: Wed, 23 Feb 2022 16:24:03 +0100 Subject: [PATCH 2/6] fix: examples --- modules/apps/29-fee/client/cli/tx.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/apps/29-fee/client/cli/tx.go b/modules/apps/29-fee/client/cli/tx.go index f811f95dbac..4885f839db3 100644 --- a/modules/apps/29-fee/client/cli/tx.go +++ b/modules/apps/29-fee/client/cli/tx.go @@ -28,7 +28,7 @@ func NewPayPacketFeeAsyncTxCmd() *cobra.Command { Use: "pay-packet-fee [src-port] [src-channel] [sequence]", Short: "Pay a fee to incentivize an existing IBC packet", Long: strings.TrimSpace(`Pay a fee to incentivize an existing IBC packet.`), - Example: fmt.Sprintf("tx %s pay-packet-fee transfer channel-0 1 --recv-fee 10stake --ack-fee 10stake --timeout-fee 10stake", version.AppName), + Example: fmt.Sprintf("%s tx ibc-fee pay-packet-fee transfer channel-0 1 --recv-fee 10stake --ack-fee 10stake --timeout-fee 10stake", version.AppName), Args: cobra.ExactArgs(3), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) @@ -104,7 +104,7 @@ func NewRegisterCounterpartyAddress() *cobra.Command { Use: "register-counter-party [address] [counterparty-address] [channel-id]", Short: "Register a counterparty relayer address on a given channel.", Long: strings.TrimSpace(`Register a counterparty relayer address on a given channel.`), - Example: fmt.Sprintf("tx %s register-counter-party cosmos1rsp837a4kvtgp2m4uqzdge0zzu6efqgucm0qdh cosmoss1sp921a4tttgpln6rqhdqe0zzu6efqgucm0qdh channel-0", version.AppName), + Example: fmt.Sprintf("%s tx ibc-fee register-counter-party cosmos1rsp837a4kvtgp2m4uqzdge0zzu6efqgucm0qdh cosmoss1sp921a4tttgpln6rqhdqe0zzu6efqgucm0qdh channel-0", version.AppName), Args: cobra.ExactArgs(3), RunE: func(cmd *cobra.Command, args []string) error { fmt.Print(args[0], args[1], args[2]) From 67e12862445a01e652003694db10acb2eec84fed Mon Sep 17 00:00:00 2001 From: Sean King Date: Wed, 23 Feb 2022 16:55:20 +0100 Subject: [PATCH 3/6] Update modules/apps/29-fee/client/cli/tx.go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com> --- modules/apps/29-fee/client/cli/tx.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/apps/29-fee/client/cli/tx.go b/modules/apps/29-fee/client/cli/tx.go index 4885f839db3..c1dca01c804 100644 --- a/modules/apps/29-fee/client/cli/tx.go +++ b/modules/apps/29-fee/client/cli/tx.go @@ -104,7 +104,7 @@ func NewRegisterCounterpartyAddress() *cobra.Command { Use: "register-counter-party [address] [counterparty-address] [channel-id]", Short: "Register a counterparty relayer address on a given channel.", Long: strings.TrimSpace(`Register a counterparty relayer address on a given channel.`), - Example: fmt.Sprintf("%s tx ibc-fee register-counter-party cosmos1rsp837a4kvtgp2m4uqzdge0zzu6efqgucm0qdh cosmoss1sp921a4tttgpln6rqhdqe0zzu6efqgucm0qdh channel-0", version.AppName), + Example: fmt.Sprintf("%s tx ibc-fee register-counterparty cosmos1rsp837a4kvtgp2m4uqzdge0zzu6efqgucm0qdh cosmoss1sp921a4tttgpln6rqhdqe0zzu6efqgucm0qdh channel-0", version.AppName), Args: cobra.ExactArgs(3), RunE: func(cmd *cobra.Command, args []string) error { fmt.Print(args[0], args[1], args[2]) From 019c2d48d6ef3c187c0fe233bf7ddda402e47944 Mon Sep 17 00:00:00 2001 From: Sean King Date: Wed, 23 Feb 2022 16:55:25 +0100 Subject: [PATCH 4/6] Update modules/apps/29-fee/client/cli/tx.go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com> --- modules/apps/29-fee/client/cli/tx.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/apps/29-fee/client/cli/tx.go b/modules/apps/29-fee/client/cli/tx.go index c1dca01c804..ba35bc04ab9 100644 --- a/modules/apps/29-fee/client/cli/tx.go +++ b/modules/apps/29-fee/client/cli/tx.go @@ -101,7 +101,7 @@ func NewPayPacketFeeAsyncTxCmd() *cobra.Command { // NewRegisterCounterpartyAddress returns the command to create a MsgRegisterCounterpartyAddress func NewRegisterCounterpartyAddress() *cobra.Command { cmd := &cobra.Command{ - Use: "register-counter-party [address] [counterparty-address] [channel-id]", + Use: "register-counterparty [address] [counterparty-address] [channel-id]", Short: "Register a counterparty relayer address on a given channel.", Long: strings.TrimSpace(`Register a counterparty relayer address on a given channel.`), Example: fmt.Sprintf("%s tx ibc-fee register-counterparty cosmos1rsp837a4kvtgp2m4uqzdge0zzu6efqgucm0qdh cosmoss1sp921a4tttgpln6rqhdqe0zzu6efqgucm0qdh channel-0", version.AppName), From 0cd34bce88d7bab9c66a453fcb22a64c836789d2 Mon Sep 17 00:00:00 2001 From: Sean King Date: Wed, 23 Feb 2022 16:57:21 +0100 Subject: [PATCH 5/6] chore: remove print --- modules/apps/29-fee/client/cli/tx.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/apps/29-fee/client/cli/tx.go b/modules/apps/29-fee/client/cli/tx.go index ba35bc04ab9..39373a3787c 100644 --- a/modules/apps/29-fee/client/cli/tx.go +++ b/modules/apps/29-fee/client/cli/tx.go @@ -107,8 +107,6 @@ func NewRegisterCounterpartyAddress() *cobra.Command { Example: fmt.Sprintf("%s tx ibc-fee register-counterparty cosmos1rsp837a4kvtgp2m4uqzdge0zzu6efqgucm0qdh cosmoss1sp921a4tttgpln6rqhdqe0zzu6efqgucm0qdh channel-0", version.AppName), Args: cobra.ExactArgs(3), RunE: func(cmd *cobra.Command, args []string) error { - fmt.Print(args[0], args[1], args[2]) - clientCtx, err := client.GetClientTxContext(cmd) if err != nil { return err From 3371d51ec8ca557b324ebfe178151b29bc00bc83 Mon Sep 17 00:00:00 2001 From: Sean King Date: Thu, 24 Feb 2022 21:32:49 +0100 Subject: [PATCH 6/6] nit: update address for counterparty --- modules/apps/29-fee/client/cli/tx.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/apps/29-fee/client/cli/tx.go b/modules/apps/29-fee/client/cli/tx.go index f5ffa81f560..0a4436b0bc4 100644 --- a/modules/apps/29-fee/client/cli/tx.go +++ b/modules/apps/29-fee/client/cli/tx.go @@ -104,7 +104,7 @@ func NewRegisterCounterpartyAddress() *cobra.Command { Use: "register-counterparty [address] [counterparty-address] [channel-id]", Short: "Register a counterparty relayer address on a given channel.", Long: strings.TrimSpace(`Register a counterparty relayer address on a given channel.`), - Example: fmt.Sprintf("%s tx ibc-fee register-counterparty cosmos1rsp837a4kvtgp2m4uqzdge0zzu6efqgucm0qdh cosmoss1sp921a4tttgpln6rqhdqe0zzu6efqgucm0qdh channel-0", version.AppName), + Example: fmt.Sprintf("%s tx ibc-fee register-counterparty cosmos1rsp837a4kvtgp2m4uqzdge0zzu6efqgucm0qdh osmo1v5y0tz01llxzf4c2afml8s3awue0ymju22wxx2 channel-0", version.AppName), Args: cobra.ExactArgs(3), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd)