feat: paych - rename CLI command from "paych get" to "paych add-funds"
This commit is contained in:
parent
97273655dc
commit
f84b1d0de9
@ -21,7 +21,7 @@ var paychCmd = &cli.Command{
|
|||||||
Name: "paych",
|
Name: "paych",
|
||||||
Usage: "Manage payment channels",
|
Usage: "Manage payment channels",
|
||||||
Subcommands: []*cli.Command{
|
Subcommands: []*cli.Command{
|
||||||
paychGetCmd,
|
paychAddFundsCmd,
|
||||||
paychListCmd,
|
paychListCmd,
|
||||||
paychVoucherCmd,
|
paychVoucherCmd,
|
||||||
paychSettleCmd,
|
paychSettleCmd,
|
||||||
@ -29,9 +29,9 @@ var paychCmd = &cli.Command{
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
var paychGetCmd = &cli.Command{
|
var paychAddFundsCmd = &cli.Command{
|
||||||
Name: "get",
|
Name: "add-funds",
|
||||||
Usage: "Create a new payment channel or get existing one and add amount to it",
|
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]",
|
ArgsUsage: "[fromAddress toAddress amount]",
|
||||||
Action: func(cctx *cli.Context) error {
|
Action: func(cctx *cli.Context) error {
|
||||||
if cctx.Args().Len() != 3 {
|
if cctx.Args().Len() != 3 {
|
||||||
|
@ -61,10 +61,10 @@ func TestPaymentChannels(t *testing.T) {
|
|||||||
creatorCLI := mockCLI.client(paymentCreator.ListenAddr)
|
creatorCLI := mockCLI.client(paymentCreator.ListenAddr)
|
||||||
receiverCLI := mockCLI.client(paymentReceiver.ListenAddr)
|
receiverCLI := mockCLI.client(paymentReceiver.ListenAddr)
|
||||||
|
|
||||||
// creator: paych get <creator> <receiver> <amount>
|
// creator: paych add-funds <creator> <receiver> <amount>
|
||||||
channelAmt := "100000"
|
channelAmt := "100000"
|
||||||
cmd := []string{creatorAddr.String(), receiverAddr.String(), channelAmt}
|
cmd := []string{creatorAddr.String(), receiverAddr.String(), channelAmt}
|
||||||
chstr := creatorCLI.runCmd(paychGetCmd, cmd)
|
chstr := creatorCLI.runCmd(paychAddFundsCmd, cmd)
|
||||||
|
|
||||||
chAddr, err := address.NewFromString(chstr)
|
chAddr, err := address.NewFromString(chstr)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
@ -116,10 +116,10 @@ func TestPaymentChannelVouchers(t *testing.T) {
|
|||||||
creatorCLI := mockCLI.client(paymentCreator.ListenAddr)
|
creatorCLI := mockCLI.client(paymentCreator.ListenAddr)
|
||||||
receiverCLI := mockCLI.client(paymentReceiver.ListenAddr)
|
receiverCLI := mockCLI.client(paymentReceiver.ListenAddr)
|
||||||
|
|
||||||
// creator: paych get <creator> <receiver> <amount>
|
// creator: paych add-funds <creator> <receiver> <amount>
|
||||||
channelAmt := "100000"
|
channelAmt := "100000"
|
||||||
cmd := []string{creatorAddr.String(), receiverAddr.String(), channelAmt}
|
cmd := []string{creatorAddr.String(), receiverAddr.String(), channelAmt}
|
||||||
chstr := creatorCLI.runCmd(paychGetCmd, cmd)
|
chstr := creatorCLI.runCmd(paychAddFundsCmd, cmd)
|
||||||
|
|
||||||
chAddr, err := address.NewFromString(chstr)
|
chAddr, err := address.NewFromString(chstr)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
@ -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.
|
For example a client creates a payment channel to a provider with value 10 FIL.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ lotus paych get <client addr> <provider addr> 10
|
$ lotus paych add-funds <client addr> <provider addr> 10
|
||||||
<channel addr>
|
<channel addr>
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -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.
|
The client sends the voucher to the provider and the provider adds the voucher and sends back more data.
|
||||||
etc.
|
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
|
```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
|
<channel addr> # Same address as above. Channel now has 15
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user