Merge pull request #5270 from filcloud/deal-duration
use deal duration from actors
This commit is contained in:
commit
bf6ee88539
@ -118,5 +118,5 @@ const PackingEfficiencyNum = 4
|
|||||||
const PackingEfficiencyDenom = 5
|
const PackingEfficiencyDenom = 5
|
||||||
|
|
||||||
// Actor consts
|
// Actor consts
|
||||||
// TODO: Pull from actors when its made not private
|
// TODO: pieceSize unused from actors
|
||||||
var MinDealDuration = abi.ChainEpoch(180 * builtin2.EpochsInDay)
|
var MinDealDuration, MaxDealDuration = policy.DealDurationBounds(0)
|
||||||
|
@ -72,8 +72,8 @@ var (
|
|||||||
}()
|
}()
|
||||||
|
|
||||||
// Actor consts
|
// Actor consts
|
||||||
// TODO: Pull from actors when its made not private
|
// TODO: pieceSize unused from actors
|
||||||
MinDealDuration = abi.ChainEpoch(180 * builtin2.EpochsInDay)
|
MinDealDuration, MaxDealDuration = policy.DealDurationBounds(0)
|
||||||
|
|
||||||
PackingEfficiencyNum int64 = 4
|
PackingEfficiencyNum int64 = 4
|
||||||
PackingEfficiencyDenom int64 = 5
|
PackingEfficiencyDenom int64 = 5
|
||||||
|
@ -136,6 +136,10 @@ func DealProviderCollateralBounds(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func DealDurationBounds(pieceSize abi.PaddedPieceSize) (min, max abi.ChainEpoch) {
|
||||||
|
return market2.DealDurationBounds(pieceSize)
|
||||||
|
}
|
||||||
|
|
||||||
// Sets the challenge window and scales the proving period to match (such that
|
// Sets the challenge window and scales the proving period to match (such that
|
||||||
// there are always 48 challenge windows in a proving period).
|
// there are always 48 challenge windows in a proving period).
|
||||||
func SetWPoStChallengeWindow(period abi.ChainEpoch) {
|
func SetWPoStChallengeWindow(period abi.ChainEpoch) {
|
||||||
|
@ -387,6 +387,9 @@ var clientDealCmd = &cli.Command{
|
|||||||
if abi.ChainEpoch(dur) < build.MinDealDuration {
|
if abi.ChainEpoch(dur) < build.MinDealDuration {
|
||||||
return xerrors.Errorf("minimum deal duration is %d blocks", build.MinDealDuration)
|
return xerrors.Errorf("minimum deal duration is %d blocks", build.MinDealDuration)
|
||||||
}
|
}
|
||||||
|
if abi.ChainEpoch(dur) > build.MaxDealDuration {
|
||||||
|
return xerrors.Errorf("maximum deal duration is %d blocks", build.MaxDealDuration)
|
||||||
|
}
|
||||||
|
|
||||||
var a address.Address
|
var a address.Address
|
||||||
if from := cctx.String("from"); from != "" {
|
if from := cctx.String("from"); from != "" {
|
||||||
|
Loading…
Reference in New Issue
Block a user