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()
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),

View File

@ -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
}