update CLI command to take arg; reduce time for itest

This commit is contained in:
Anton Evangelatov 2021-10-08 11:54:37 +02:00
parent 6e5ccc87cf
commit 1acb6b4328
3 changed files with 14 additions and 13 deletions

View File

@ -912,14 +912,13 @@ var dealsPendingPublish = &cli.Command{
} }
var dealsRetryPublish = &cli.Command{ var dealsRetryPublish = &cli.Command{
Name: "retry-publish", Name: "retry-publish",
Usage: "retry publishing a deal", Usage: "retry publishing a deal",
Flags: []cli.Flag{ ArgsUsage: "<proposal CID>",
&cli.StringFlag{
Name: "proposal-cid",
},
},
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
if !cctx.Args().Present() {
return cli.ShowCommandHelp(cctx, cctx.Command.Name)
}
api, closer, err := lcli.GetMarketsAPI(cctx) api, closer, err := lcli.GetMarketsAPI(cctx)
if err != nil { if err != nil {
return err return err
@ -927,7 +926,10 @@ var dealsRetryPublish = &cli.Command{
defer closer() defer closer()
ctx := lcli.ReqContext(cctx) ctx := lcli.ReqContext(cctx)
cid, err := cid.Decode(cctx.String("proposal-cid")) propcid := cctx.Args().First()
fmt.Printf("retrying deal with proposal-cid: %s\n", propcid)
cid, err := cid.Decode(propcid)
if err != nil { if err != nil {
return err return err
} }

View File

@ -832,11 +832,10 @@ NAME:
lotus-miner storage-deals retry-publish - retry publishing a deal lotus-miner storage-deals retry-publish - retry publishing a deal
USAGE: USAGE:
lotus-miner storage-deals retry-publish [command options] [arguments...] lotus-miner storage-deals retry-publish [command options] <proposal CID>
OPTIONS: OPTIONS:
--proposal-cid value --help, -h show help (default: false)
--help, -h show help (default: false)
``` ```

View File

@ -22,7 +22,7 @@ var (
publishPeriod = 1 * time.Second publishPeriod = 1 * time.Second
maxDealsPerMsg = uint64(2) // Set max deals per publish deals message to 2 maxDealsPerMsg = uint64(2) // Set max deals per publish deals message to 2
blockTime = 10 * time.Millisecond blockTime = 3 * time.Millisecond
) )
func TestDealsRetryLackOfFunds(t *testing.T) { func TestDealsRetryLackOfFunds(t *testing.T) {
@ -93,7 +93,7 @@ func TestDealsRetryLackOfFunds(t *testing.T) {
propcid := *deal propcid := *deal
go func() { go func() {
time.Sleep(20 * time.Second) time.Sleep(3 * time.Second)
kit.SendFunds(ctx, t, minerFullNode, publishStorageDealKey.Address, types.FromFil(1)) kit.SendFunds(ctx, t, minerFullNode, publishStorageDealKey.Address, types.FromFil(1))