From ec5f353e127aedf90f665d58d63ea421aac42201 Mon Sep 17 00:00:00 2001 From: cyberguru1 Date: Thu, 14 May 2026 19:21:26 -0500 Subject: [PATCH] litcli: remove deprecated new_balance flag from update command This change removes the --new_balance flag from the CLI parser and sets the AccountBalance field explicitly to -1 --- cmd/litcli/accounts.go | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/cmd/litcli/accounts.go b/cmd/litcli/accounts.go index f2463d4b..c9bc39f3 100644 --- a/cmd/litcli/accounts.go +++ b/cmd/litcli/accounts.go @@ -146,10 +146,9 @@ var updateAccountCommand = cli.Command{ Name: "update", ShortName: "u", Usage: "Update an existing off-chain account.", - ArgsUsage: "[id | label] new_balance new_expiration_date", + ArgsUsage: "[id | label] new_expiration_date", Description: "Updates an existing off-chain account and sets " + - "a new balance, new expiration date and " + - "optionally a new label.", + "a new expiration date and optionally a new label.", Flags: []cli.Flag{ cli.StringFlag{ Name: idName, @@ -166,13 +165,6 @@ var updateAccountCommand = cli.Command{ Name: "new_label", Usage: "(optional) The new label of the account.", }, - cli.Int64Flag{ - Name: "new_balance", - Usage: "(deprecated) The new balance of the account; " + - "-1 means do not update the balance.", - Value: -1, - Hidden: true, - }, cli.Int64Flag{ Name: "new_expiration_date", Usage: "The new expiration date of the account " + @@ -204,20 +196,8 @@ func updateAccount(cli *cli.Context) error { } var ( - newBalance int64 expirationDate int64 ) - switch { - case cli.IsSet("new_balance"): - newBalance = cli.Int64("new_balance") - case args.Present(): - newBalance, err = strconv.ParseInt(args.First(), 10, 64) - if err != nil { - return fmt.Errorf("unable to decode balance %v", err) - } - args = args.Tail() - } - switch { case cli.IsSet("new_expiration_date"): expirationDate = cli.Int64("new_expiration_date") @@ -234,7 +214,7 @@ func updateAccount(cli *cli.Context) error { req := &litrpc.UpdateAccountRequest{ Id: id, Label: label, - AccountBalance: newBalance, + AccountBalance: -1, ExpirationDate: expirationDate, NewLabel: cli.String("new_label"), }