Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

paych: rename CLI command from "paych get" to "paych add-funds" #3520

Merged
merged 1 commit into from
Sep 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cli/paych.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,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 @@ -61,10 +61,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 @@ -116,10 +116,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