Skip to content

Commit

Permalink
Merge pull request #9753 from filecoin-project/gstuart/fix-devnet-deals
Browse files Browse the repository at this point in the history
fix: cli: Check upper bound for deal duration
  • Loading branch information
geoff-vball authored Dec 12, 2022
2 parents ab25809 + c2e4690 commit 33a176e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cli/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,13 @@ uiLoop:

minDealDurationDays := uint64(build.MinDealDuration) / (builtin.SecondsInDay / build.BlockDelaySecs)
if days < int(minDealDurationDays) {
printErr(xerrors.Errorf("minimum duration is %d days", minDealDurationDays))
printErr(xerrors.Errorf("minimum duration is %d days, got %d", minDealDurationDays, days))
continue
}

maxDealDurationDays := uint64(build.MaxDealDuration) / (builtin.SecondsInDay / build.BlockDelaySecs)
if days > int(maxDealDurationDays) {
printErr(xerrors.Errorf("maximum duration is %d days, got %d", maxDealDurationDays, days))
continue
}

Expand Down

0 comments on commit 33a176e

Please sign in to comment.