From f84b1d0de917f682276fec975d4642c745e7d8f3 Mon Sep 17 00:00:00 2001 From: Dirk McCormick Date: Thu, 3 Sep 2020 15:45:09 +0200 Subject: [PATCH] feat: paych - rename CLI command from "paych get" to "paych add-funds" --- cli/paych.go | 8 ++++---- cli/paych_test.go | 8 ++++---- documentation/en/payment-channels.md | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cli/paych.go b/cli/paych.go index ff4d769da..a882a4a01 100644 --- a/cli/paych.go +++ b/cli/paych.go @@ -21,7 +21,7 @@ var paychCmd = &cli.Command{ Name: "paych", Usage: "Manage payment channels", Subcommands: []*cli.Command{ - paychGetCmd, + paychAddFundsCmd, paychListCmd, paychVoucherCmd, paychSettleCmd, @@ -29,9 +29,9 @@ var paychCmd = &cli.Command{ }, } -var paychGetCmd = &cli.Command{ - Name: "get", - Usage: "Create a new payment channel or get existing one and add amount to it", +var paychAddFundsCmd = &cli.Command{ + Name: "add-funds", + Usage: "Add funds to the payment channel between fromAddress and toAddress. Creates the payment channel if it doesn't already exist.", ArgsUsage: "[fromAddress toAddress amount]", Action: func(cctx *cli.Context) error { if cctx.Args().Len() != 3 { diff --git a/cli/paych_test.go b/cli/paych_test.go index 11a08fb2c..9820aa015 100644 --- a/cli/paych_test.go +++ b/cli/paych_test.go @@ -61,10 +61,10 @@ func TestPaymentChannels(t *testing.T) { creatorCLI := mockCLI.client(paymentCreator.ListenAddr) receiverCLI := mockCLI.client(paymentReceiver.ListenAddr) - // creator: paych get + // creator: paych add-funds channelAmt := "100000" cmd := []string{creatorAddr.String(), receiverAddr.String(), channelAmt} - chstr := creatorCLI.runCmd(paychGetCmd, cmd) + chstr := creatorCLI.runCmd(paychAddFundsCmd, cmd) chAddr, err := address.NewFromString(chstr) require.NoError(t, err) @@ -116,10 +116,10 @@ func TestPaymentChannelVouchers(t *testing.T) { creatorCLI := mockCLI.client(paymentCreator.ListenAddr) receiverCLI := mockCLI.client(paymentReceiver.ListenAddr) - // creator: paych get + // creator: paych add-funds channelAmt := "100000" cmd := []string{creatorAddr.String(), receiverAddr.String(), channelAmt} - chstr := creatorCLI.runCmd(paychGetCmd, cmd) + chstr := creatorCLI.runCmd(paychAddFundsCmd, cmd) chAddr, err := address.NewFromString(chstr) require.NoError(t, err) diff --git a/documentation/en/payment-channels.md b/documentation/en/payment-channels.md index 44f9affd9..7179da916 100644 --- a/documentation/en/payment-channels.md +++ b/documentation/en/payment-channels.md @@ -22,7 +22,7 @@ Note that payment channels and vouchers can be used for any situation in which t For example a client creates a payment channel to a provider with value 10 FIL. ```sh -$ lotus paych get 10 +$ lotus paych add-funds 10 ``` @@ -51,10 +51,10 @@ $ lotus paych voucher create 4 The client sends the voucher to the provider and the provider adds the voucher and sends back more data. etc. -The client can add value to the channel after it has been created by calling `paych get` with the same client and provider addresses. +The client can add value to the channel after it has been created by calling `paych add-funds` with the same client and provider addresses. ```sh -$ lotus paych get 5 +$ lotus paych add-funds 5 # Same address as above. Channel now has 15 ```