Merge pull request #7560 from EmadMF/emad22552-patch-1

add check manual-stateless-deal with interactive deal making
This commit is contained in:
Łukasz Magiera 2022-03-02 13:16:14 +00:00 committed by GitHub
commit 74e6260fbd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -358,7 +358,13 @@ The minimum value is 518400 (6 months).`,
&CidBaseFlag, &CidBaseFlag,
}, },
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
expectedArgsMsg := "expected 4 args: dataCid, miner, price, duration"
if !cctx.Args().Present() { if !cctx.Args().Present() {
if cctx.Bool("manual-stateless-deal") {
return xerrors.New("--manual-stateless-deal can not be combined with interactive deal mode: you must specify the " + expectedArgsMsg)
}
return interactiveDeal(cctx) return interactiveDeal(cctx)
} }
@ -371,7 +377,7 @@ The minimum value is 518400 (6 months).`,
afmt := NewAppFmt(cctx.App) afmt := NewAppFmt(cctx.App)
if cctx.NArg() != 4 { if cctx.NArg() != 4 {
return xerrors.New("expected 4 args: dataCid, miner, price, duration") return xerrors.New(expectedArgsMsg)
} }
// [data, miner, price, dur] // [data, miner, price, dur]