lncli: rename value to amt in addinvoice command

This commit is contained in:
Cristobal Griffero 2018-01-18 15:32:24 -03:00 committed by Olaoluwa Osuntokun
parent 08ae9fe510
commit ffbcf7db4f
4 changed files with 16 additions and 16 deletions

@ -1169,7 +1169,7 @@ var addInvoiceCommand = cli.Command{
Description: ` Description: `
Add a new invoice, expressing intent for a future payment. Add a new invoice, expressing intent for a future payment.
The value of the invoice in satoshis is necessary for the creation, The number of satoshis in this invoice is necessary for the creation,
the remaining parameters are optional.`, the remaining parameters are optional.`,
ArgsUsage: "value preimage", ArgsUsage: "value preimage",
Flags: []cli.Flag{ Flags: []cli.Flag{
@ -1190,8 +1190,8 @@ var addInvoiceCommand = cli.Command{
"created.", "created.",
}, },
cli.Int64Flag{ cli.Int64Flag{
Name: "value", Name: "amt",
Usage: "the value of this invoice in satoshis", Usage: "the amt of satoshis in this invoice",
}, },
cli.StringFlag{ cli.StringFlag{
Name: "description_hash", Name: "description_hash",
@ -1221,8 +1221,8 @@ func addInvoice(ctx *cli.Context) error {
preimage []byte preimage []byte
descHash []byte descHash []byte
receipt []byte receipt []byte
value int64 amt int64
err error err error
) )
client, cleanUp := getClient(ctx) client, cleanUp := getClient(ctx)
@ -1231,16 +1231,16 @@ func addInvoice(ctx *cli.Context) error {
args := ctx.Args() args := ctx.Args()
switch { switch {
case ctx.IsSet("value"): case ctx.IsSet("amt"):
value = ctx.Int64("value") amt = ctx.Int64("amt")
case args.Present(): case args.Present():
value, err = strconv.ParseInt(args.First(), 10, 64) amt, err = strconv.ParseInt(args.First(), 10, 64)
args = args.Tail() args = args.Tail()
if err != nil { if err != nil {
return fmt.Errorf("unable to decode value argument: %v", err) return fmt.Errorf("unable to decode amt argument: %v", err)
} }
default: default:
return fmt.Errorf("value argument missing") return fmt.Errorf("amt argument missing")
} }
switch { switch {
@ -1268,7 +1268,7 @@ func addInvoice(ctx *cli.Context) error {
Memo: ctx.String("memo"), Memo: ctx.String("memo"),
Receipt: receipt, Receipt: receipt,
RPreimage: preimage, RPreimage: preimage,
Value: value, Value: amt,
DescriptionHash: descHash, DescriptionHash: descHash,
FallbackAddr: ctx.String("fallback_addr"), FallbackAddr: ctx.String("fallback_addr"),
Expiry: ctx.Int64("expiry"), Expiry: ctx.Int64("expiry"),
@ -2009,8 +2009,8 @@ func verifyMessage(ctx *cli.Context) error {
var feeReportCommand = cli.Command{ var feeReportCommand = cli.Command{
Name: "feereport", Name: "feereport",
Usage: "display the current fee policies of all active channels", Usage: "display the current fee policies of all active channels",
Description: ` Description: `
Returns the current fee policies of all active channels. Returns the current fee policies of all active channels.
Fee policies can be updated using the updatechanpolicy command.`, Fee policies can be updated using the updatechanpolicy command.`,
Action: actionDecorator(feeReport), Action: actionDecorator(feeReport),
} }

@ -192,7 +192,7 @@ alice$ lncli listchannels
Send the payment from `Alice` to `Bob`. Send the payment from `Alice` to `Bob`.
```bash ```bash
# Add invoice on "Bob" side: # Add invoice on "Bob" side:
bob$ lncli addinvoice --value=10000 bob$ lncli addinvoice --amt=10000
{ {
"r_hash": "<your_random_rhash_here>", "r_hash": "<your_random_rhash_here>",
"pay_req": "<encoded_invoice>", "pay_req": "<encoded_invoice>",

@ -91,7 +91,7 @@ call.on('data', function(invoice) {
Now, create an invoice for your node at `localhost:10009`and send a payment to Now, create an invoice for your node at `localhost:10009`and send a payment to
it from another node. it from another node.
```bash ```bash
$ lncli addinvoice --value=100 $ lncli addinvoice --amt=100
{ {
"r_hash": <RHASH>, "r_hash": <RHASH>,
"pay_req": <PAYMENT_REQUEST> "pay_req": <PAYMENT_REQUEST>

@ -86,7 +86,7 @@ for invoice in stub.SubscribeInvoices(request):
Now, create an invoice for your node at `localhost:10009`and send a payment to Now, create an invoice for your node at `localhost:10009`and send a payment to
it from another node. it from another node.
```bash ```bash
$ lncli addinvoice --value=100 $ lncli addinvoice --amt=100
{ {
"r_hash": <R_HASH>, "r_hash": <R_HASH>,
"pay_req": <PAY_REQ> "pay_req": <PAY_REQ>