From 8fbf6455927c31a329944544480d2ad1bc1e5a7d Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Mon, 11 Mar 2024 13:53:31 +0530 Subject: [PATCH] Update reserve authority command usage in tests --- tests/e2e/registry/suite.go | 4 ++-- x/registry/client/cli/tx.go | 21 +++++---------------- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/tests/e2e/registry/suite.go b/tests/e2e/registry/suite.go index 82460144..117198c8 100644 --- a/tests/e2e/registry/suite.go +++ b/tests/e2e/registry/suite.go @@ -150,7 +150,7 @@ func (ets *E2ETestSuite) reserveName(authorityName string) { cmd := cli.GetCmdReserveAuthority() args := []string{ authorityName, - fmt.Sprintf("--owner=%s", ets.accountAddress), + ets.accountAddress, fmt.Sprintf("--%s=%s", flags.FlagFrom, ets.accountName), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=json", flags.FlagOutput), @@ -178,7 +178,7 @@ func (ets *E2ETestSuite) createNameRecord(authorityName string) { cmd := cli.GetCmdReserveAuthority() args := []string{ authorityName, - fmt.Sprintf("--owner=%s", ets.accountAddress), + ets.accountAddress, fmt.Sprintf("--%s=%s", flags.FlagFrom, ets.accountName), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=json", flags.FlagOutput), diff --git a/x/registry/client/cli/tx.go b/x/registry/client/cli/tx.go index f0c63f72..c2d400d9 100644 --- a/x/registry/client/cli/tx.go +++ b/x/registry/client/cli/tx.go @@ -88,27 +88,16 @@ func GetPayloadFromFile(filePath string) (*registrytypes.ReadablePayload, error) // GetCmdReserveAuthority is the CLI command for reserving a name. func GetCmdReserveAuthority() *cobra.Command { cmd := &cobra.Command{ - Use: "reserve-name [name]", - Short: "Reserve name.", - Long: strings.TrimSpace( - fmt.Sprintf(`Reserver name with owner address . -Example: -$ %s tx %s reserve-name [name] --owner [ownerAddress] -`, - version.AppName, registrytypes.ModuleName, - ), - ), - Args: cobra.ExactArgs(1), + Use: "reserve-authority [name]", + Short: "Reserve authority name", + Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { return err } - owner, err := cmd.Flags().GetString("owner") - if err != nil { - return err - } - ownerAddress, err := sdk.AccAddressFromBech32(owner) + + ownerAddress, err := sdk.AccAddressFromBech32(args[1]) if err != nil { return err }