2022-06-14 18:03:38 +00:00
|
|
|
package sealer
|
2020-09-21 22:52:33 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"io"
|
|
|
|
|
|
|
|
"github.com/ipfs/go-cid"
|
|
|
|
|
|
|
|
"github.com/filecoin-project/go-state-types/abi"
|
2021-12-08 17:11:19 +00:00
|
|
|
"github.com/filecoin-project/specs-actors/v7/actors/runtime/proof"
|
2020-09-21 22:52:33 +00:00
|
|
|
|
2022-06-14 18:03:38 +00:00
|
|
|
"github.com/filecoin-project/lotus/storage/sealer/storiface"
|
2020-09-21 22:52:33 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type apres struct {
|
2020-09-21 23:00:17 +00:00
|
|
|
pi abi.PieceInfo
|
2020-09-21 22:52:33 +00:00
|
|
|
err error
|
|
|
|
}
|
|
|
|
|
|
|
|
type testExec struct {
|
|
|
|
apch chan chan apres
|
|
|
|
}
|
|
|
|
|
2022-09-02 12:19:29 +00:00
|
|
|
func (t *testExec) DownloadSectorData(ctx context.Context, sector storiface.SectorRef, finalized bool, src map[storiface.SectorFileType]storiface.SectorData) error {
|
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2022-06-17 11:31:05 +00:00
|
|
|
func (t *testExec) DataCid(ctx context.Context, pieceSize abi.UnpaddedPieceSize, pieceData storiface.Data) (abi.PieceInfo, error) {
|
2022-04-26 19:43:24 +00:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2021-12-08 17:11:19 +00:00
|
|
|
func (t *testExec) GenerateWinningPoSt(ctx context.Context, minerID abi.ActorID, sectorInfo []proof.ExtendedSectorInfo, randomness abi.PoStRandomness) ([]proof.PoStProof, error) {
|
2020-09-21 22:52:33 +00:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2022-04-20 21:34:28 +00:00
|
|
|
func (t *testExec) GenerateWindowPoSt(ctx context.Context, minerID abi.ActorID, sectorInfo []proof.ExtendedSectorInfo, randomness abi.PoStRandomness) (miner []proof.PoStProof, skipped []abi.SectorID, err error) {
|
2020-09-21 22:52:33 +00:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2022-01-14 13:11:04 +00:00
|
|
|
func (t *testExec) GenerateWinningPoStWithVanilla(ctx context.Context, proofType abi.RegisteredPoStProof, minerID abi.ActorID, randomness abi.PoStRandomness, proofs [][]byte) ([]proof.PoStProof, error) {
|
2021-07-27 03:15:53 +00:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2022-01-14 13:11:04 +00:00
|
|
|
func (t *testExec) GenerateWindowPoStWithVanilla(ctx context.Context, proofType abi.RegisteredPoStProof, minerID abi.ActorID, randomness abi.PoStRandomness, proofs [][]byte, partitionIdx int) (proof.PoStProof, error) {
|
2021-07-27 03:15:53 +00:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2022-06-17 11:31:05 +00:00
|
|
|
func (t *testExec) SealPreCommit1(ctx context.Context, sector storiface.SectorRef, ticket abi.SealRandomness, pieces []abi.PieceInfo) (storiface.PreCommit1Out, error) {
|
2020-09-21 22:52:33 +00:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2022-06-17 11:31:05 +00:00
|
|
|
func (t *testExec) SealPreCommit2(ctx context.Context, sector storiface.SectorRef, pc1o storiface.PreCommit1Out) (storiface.SectorCids, error) {
|
2020-09-21 22:52:33 +00:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2022-06-17 11:31:05 +00:00
|
|
|
func (t *testExec) SealCommit1(ctx context.Context, sector storiface.SectorRef, ticket abi.SealRandomness, seed abi.InteractiveSealRandomness, pieces []abi.PieceInfo, cids storiface.SectorCids) (storiface.Commit1Out, error) {
|
2020-09-21 22:52:33 +00:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2022-06-17 11:31:05 +00:00
|
|
|
func (t *testExec) SealCommit2(ctx context.Context, sector storiface.SectorRef, c1o storiface.Commit1Out) (storiface.Proof, error) {
|
2020-09-21 22:52:33 +00:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2022-06-17 11:31:05 +00:00
|
|
|
func (t *testExec) FinalizeSector(ctx context.Context, sector storiface.SectorRef, keepUnsealed []storiface.Range) error {
|
2020-09-21 22:52:33 +00:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2022-06-17 11:31:05 +00:00
|
|
|
func (t *testExec) ReleaseUnsealed(ctx context.Context, sector storiface.SectorRef, safeToFree []storiface.Range) error {
|
2020-09-21 22:52:33 +00:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2022-06-17 11:31:05 +00:00
|
|
|
func (t *testExec) ReleaseSealed(ctx context.Context, sector storiface.SectorRef) error {
|
2021-11-10 18:53:00 +00:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2022-06-17 11:31:05 +00:00
|
|
|
func (t *testExec) ReleaseSectorKey(ctx context.Context, sector storiface.SectorRef) error {
|
2021-12-08 17:11:19 +00:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2022-06-17 11:31:05 +00:00
|
|
|
func (t *testExec) ReleaseReplicaUpgrade(ctx context.Context, sector storiface.SectorRef) error {
|
2021-12-08 17:11:19 +00:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2022-06-17 11:31:05 +00:00
|
|
|
func (t *testExec) Remove(ctx context.Context, sector storiface.SectorRef) error {
|
2020-09-21 22:52:33 +00:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2022-06-17 11:31:05 +00:00
|
|
|
func (t *testExec) ReplicaUpdate(ctx context.Context, sector storiface.SectorRef, pieces []abi.PieceInfo) (storiface.ReplicaUpdateOut, error) {
|
2021-11-10 18:53:00 +00:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2022-06-17 11:31:05 +00:00
|
|
|
func (t *testExec) ProveReplicaUpdate1(ctx context.Context, sector storiface.SectorRef, sectorKey, newSealed, newUnsealed cid.Cid) (storiface.ReplicaVanillaProofs, error) {
|
2021-11-10 18:53:00 +00:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2022-06-17 11:31:05 +00:00
|
|
|
func (t *testExec) ProveReplicaUpdate2(ctx context.Context, sector storiface.SectorRef, sectorKey, newSealed, newUnsealed cid.Cid, vanillaProofs storiface.ReplicaVanillaProofs) (storiface.ReplicaUpdateProof, error) {
|
2021-11-10 18:53:00 +00:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2022-06-17 11:31:05 +00:00
|
|
|
func (t *testExec) GenerateSectorKeyFromData(ctx context.Context, sector storiface.SectorRef, commD cid.Cid) error {
|
2021-12-01 19:01:55 +00:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2022-06-17 11:31:05 +00:00
|
|
|
func (t *testExec) FinalizeReplicaUpdate(ctx context.Context, sector storiface.SectorRef, keepUnsealed []storiface.Range) error {
|
2022-02-08 16:03:51 +00:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2022-06-17 11:31:05 +00:00
|
|
|
func (t *testExec) NewSector(ctx context.Context, sector storiface.SectorRef) error {
|
2020-09-21 22:52:33 +00:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2022-06-17 11:31:05 +00:00
|
|
|
func (t *testExec) AddPiece(ctx context.Context, sector storiface.SectorRef, pieceSizes []abi.UnpaddedPieceSize, newPieceSize abi.UnpaddedPieceSize, pieceData storiface.Data) (abi.PieceInfo, error) {
|
2020-09-21 22:52:33 +00:00
|
|
|
resp := make(chan apres)
|
|
|
|
t.apch <- resp
|
|
|
|
ar := <-resp
|
|
|
|
return ar.pi, ar.err
|
|
|
|
}
|
|
|
|
|
2022-06-17 11:31:05 +00:00
|
|
|
func (t *testExec) UnsealPiece(ctx context.Context, sector storiface.SectorRef, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize, randomness abi.SealRandomness, commd cid.Cid) error {
|
2020-09-21 22:52:33 +00:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2022-06-17 11:31:05 +00:00
|
|
|
func (t *testExec) ReadPiece(ctx context.Context, writer io.Writer, sector storiface.SectorRef, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize) (bool, error) {
|
2020-09-21 22:52:33 +00:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2022-06-17 11:52:19 +00:00
|
|
|
var _ storiface.Storage = &testExec{}
|