Skip to content

Commit

Permalink
Merge pull request #3520 from filecoin-project/feat/paych-cli-add-funds
Browse files Browse the repository at this point in the history
paych: rename CLI command from "paych get" to "paych add-funds"
  • Loading branch information
magik6k committed Sep 4, 2020
2 parents 924fd82 + f84b1d0 commit a081dc7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions cli/paych.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ var paychCmd = &cli.Command{
Name: "paych",
Usage: "Manage payment channels",
Subcommands: []*cli.Command{
paychGetCmd,
paychAddFundsCmd,
paychListCmd,
paychVoucherCmd,
paychSettleCmd,
paychCloseCmd,
},
}

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 {
Expand Down
8 changes: 4 additions & 4 deletions cli/paych_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ func TestPaymentChannels(t *testing.T) {
creatorCLI := mockCLI.client(paymentCreator.ListenAddr)
receiverCLI := mockCLI.client(paymentReceiver.ListenAddr)

// creator: paych get <creator> <receiver> <amount>
// creator: paych add-funds <creator> <receiver> <amount>
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)
Expand Down Expand Up @@ -196,10 +196,10 @@ func TestPaymentChannelVouchers(t *testing.T) {
creatorCLI := mockCLI.client(paymentCreator.ListenAddr)
receiverCLI := mockCLI.client(paymentReceiver.ListenAddr)

// creator: paych get <creator> <receiver> <amount>
// creator: paych add-funds <creator> <receiver> <amount>
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)
Expand Down
6 changes: 3 additions & 3 deletions documentation/en/payment-channels.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <client addr> <provider addr> 10
$ lotus paych add-funds <client addr> <provider addr> 10
<channel addr>
```

Expand Down Expand Up @@ -51,10 +51,10 @@ $ lotus paych voucher create <channel addr> 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 <client addr> <provider addr> 5
$ lotus paych add-funds <client addr> <provider addr> 5
<channel addr> # Same address as above. Channel now has 15
```

Expand Down

0 comments on commit a081dc7

Please sign in to comment.