Make interactive deal CLI reject deals shorter than minimum duration
This commit is contained in:
parent
0c1c19c6ef
commit
e2cf0c4d4c
@ -12,6 +12,8 @@ import (
|
|||||||
"text/tabwriter"
|
"text/tabwriter"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/filecoin-project/specs-actors/actors/builtin"
|
||||||
|
|
||||||
tm "github.com/buger/goterm"
|
tm "github.com/buger/goterm"
|
||||||
"github.com/docker/go-units"
|
"github.com/docker/go-units"
|
||||||
"github.com/fatih/color"
|
"github.com/fatih/color"
|
||||||
@ -527,6 +529,11 @@ func interactiveDeal(cctx *cli.Context) error {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if days < int(build.MinDealDuration/builtin.EpochsInDay) {
|
||||||
|
printErr(xerrors.Errorf("minimum duration is %d days", int(build.MinDealDuration/builtin.EpochsInDay)))
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
state = "miner"
|
state = "miner"
|
||||||
case "miner":
|
case "miner":
|
||||||
fmt.Print("Miner Address (t0..): ")
|
fmt.Print("Miner Address (t0..): ")
|
||||||
|
Loading…
Reference in New Issue
Block a user