2021-06-11 17:26:25 +00:00
|
|
|
package kit2
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/filecoin-project/go-state-types/abi"
|
|
|
|
)
|
|
|
|
|
|
|
|
type EnsembleOpt func(opts *ensembleOpts) error
|
|
|
|
|
|
|
|
type ensembleOpts struct {
|
|
|
|
pastOffset time.Duration
|
|
|
|
proofType abi.RegisteredSealProof
|
|
|
|
mockProofs bool
|
|
|
|
}
|
|
|
|
|
|
|
|
var DefaultEnsembleOpts = ensembleOpts{
|
2021-06-14 17:58:12 +00:00
|
|
|
pastOffset: 100000 * time.Second, // time sufficiently in the past to trigger catch-up mining.
|
2021-06-11 17:26:25 +00:00
|
|
|
proofType: abi.RegisteredSealProof_StackedDrg2KiBV1,
|
|
|
|
}
|
|
|
|
|
|
|
|
func ProofType(proofType abi.RegisteredSealProof) EnsembleOpt {
|
|
|
|
return func(opts *ensembleOpts) error {
|
|
|
|
opts.proofType = proofType
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// MockProofs activates mock proofs for the entire ensemble.
|
|
|
|
func MockProofs() EnsembleOpt {
|
|
|
|
return func(opts *ensembleOpts) error {
|
|
|
|
opts.mockProofs = true
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
}
|