lotus/itests/kit2/ensemble_opts.go

36 lines
767 B
Go
Raw Normal View History

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.
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
}
}