Update reserve authority command usage in tests
Some checks failed
Build / build (pull_request) Successful in 2m59s
Lint / Run golangci-lint (pull_request) Successful in 4m3s
Integration Tests / test-integration (pull_request) Successful in 2m33s
Unit Tests / test-unit (pull_request) Successful in 2m33s
E2E Tests / test-e2e (pull_request) Failing after 2m50s

This commit is contained in:
Prathamesh Musale 2024-03-11 13:53:31 +05:30
parent f2345ea089
commit 8fbf645592
2 changed files with 7 additions and 18 deletions

View File

@ -150,7 +150,7 @@ func (ets *E2ETestSuite) reserveName(authorityName string) {
cmd := cli.GetCmdReserveAuthority() cmd := cli.GetCmdReserveAuthority()
args := []string{ args := []string{
authorityName, authorityName,
fmt.Sprintf("--owner=%s", ets.accountAddress), ets.accountAddress,
fmt.Sprintf("--%s=%s", flags.FlagFrom, ets.accountName), fmt.Sprintf("--%s=%s", flags.FlagFrom, ets.accountName),
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
fmt.Sprintf("--%s=json", flags.FlagOutput), fmt.Sprintf("--%s=json", flags.FlagOutput),
@ -178,7 +178,7 @@ func (ets *E2ETestSuite) createNameRecord(authorityName string) {
cmd := cli.GetCmdReserveAuthority() cmd := cli.GetCmdReserveAuthority()
args := []string{ args := []string{
authorityName, authorityName,
fmt.Sprintf("--owner=%s", ets.accountAddress), ets.accountAddress,
fmt.Sprintf("--%s=%s", flags.FlagFrom, ets.accountName), fmt.Sprintf("--%s=%s", flags.FlagFrom, ets.accountName),
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
fmt.Sprintf("--%s=json", flags.FlagOutput), fmt.Sprintf("--%s=json", flags.FlagOutput),

View File

@ -88,27 +88,16 @@ func GetPayloadFromFile(filePath string) (*registrytypes.ReadablePayload, error)
// GetCmdReserveAuthority is the CLI command for reserving a name. // GetCmdReserveAuthority is the CLI command for reserving a name.
func GetCmdReserveAuthority() *cobra.Command { func GetCmdReserveAuthority() *cobra.Command {
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "reserve-name [name]", Use: "reserve-authority [name]",
Short: "Reserve name.", Short: "Reserve authority name",
Long: strings.TrimSpace( Args: cobra.ExactArgs(2),
fmt.Sprintf(`Reserver name with owner address .
Example:
$ %s tx %s reserve-name [name] --owner [ownerAddress]
`,
version.AppName, registrytypes.ModuleName,
),
),
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
clientCtx, err := client.GetClientTxContext(cmd) clientCtx, err := client.GetClientTxContext(cmd)
if err != nil { if err != nil {
return err return err
} }
owner, err := cmd.Flags().GetString("owner")
if err != nil { ownerAddress, err := sdk.AccAddressFromBech32(args[1])
return err
}
ownerAddress, err := sdk.AccAddressFromBech32(owner)
if err != nil { if err != nil {
return err return err
} }