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
|
|
|
"github.com/filecoin-project/specs-storage/storage"
|
|
|
|
|
2022-06-14 18:03:38 +00:00
|
|
|
"github.com/filecoin-project/lotus/storage/sealer/ffiwrapper"
|
|
|
|
"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-04-26 19:43:24 +00:00
|
|
|
func (t *testExec) DataCid(ctx context.Context, pieceSize abi.UnpaddedPieceSize, pieceData storage.Data) (abi.PieceInfo, error) {
|
|
|
|
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")
|
|
|
|
}
|
|
|
|
|
2020-11-05 06:34:24 +00:00
|
|
|
func (t *testExec) SealPreCommit1(ctx context.Context, sector storage.SectorRef, ticket abi.SealRandomness, pieces []abi.PieceInfo) (storage.PreCommit1Out, error) {
|
2020-09-21 22:52:33 +00:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2020-11-05 06:34:24 +00:00
|
|
|
func (t *testExec) SealPreCommit2(ctx context.Context, sector storage.SectorRef, pc1o storage.PreCommit1Out) (storage.SectorCids, error) {
|
2020-09-21 22:52:33 +00:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2020-11-05 06:34:24 +00:00
|
|
|
func (t *testExec) SealCommit1(ctx context.Context, sector storage.SectorRef, ticket abi.SealRandomness, seed abi.InteractiveSealRandomness, pieces []abi.PieceInfo, cids storage.SectorCids) (storage.Commit1Out, error) {
|
2020-09-21 22:52:33 +00:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2020-11-05 06:34:24 +00:00
|
|
|
func (t *testExec) SealCommit2(ctx context.Context, sector storage.SectorRef, c1o storage.Commit1Out) (storage.Proof, error) {
|
2020-09-21 22:52:33 +00:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2020-11-05 06:34:24 +00:00
|
|
|
func (t *testExec) FinalizeSector(ctx context.Context, sector storage.SectorRef, keepUnsealed []storage.Range) error {
|
2020-09-21 22:52:33 +00:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2020-11-05 06:34:24 +00:00
|
|
|
func (t *testExec) ReleaseUnsealed(ctx context.Context, sector storage.SectorRef, safeToFree []storage.Range) error {
|
2020-09-21 22:52:33 +00:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2021-11-10 18:53:00 +00:00
|
|
|
func (t *testExec) ReleaseSealed(ctx context.Context, sector storage.SectorRef) error {
|
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2021-12-08 17:11:19 +00:00
|
|
|
func (t *testExec) ReleaseSectorKey(ctx context.Context, sector storage.SectorRef) error {
|
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (t *testExec) ReleaseReplicaUpgrade(ctx context.Context, sector storage.SectorRef) error {
|
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2020-11-05 06:34:24 +00:00
|
|
|
func (t *testExec) Remove(ctx context.Context, sector storage.SectorRef) error {
|
2020-09-21 22:52:33 +00:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2021-11-10 18:53:00 +00:00
|
|
|
func (t *testExec) ReplicaUpdate(ctx context.Context, sector storage.SectorRef, pieces []abi.PieceInfo) (storage.ReplicaUpdateOut, error) {
|
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (t *testExec) ProveReplicaUpdate1(ctx context.Context, sector storage.SectorRef, sectorKey, newSealed, newUnsealed cid.Cid) (storage.ReplicaVanillaProofs, error) {
|
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (t *testExec) ProveReplicaUpdate2(ctx context.Context, sector storage.SectorRef, sectorKey, newSealed, newUnsealed cid.Cid, vanillaProofs storage.ReplicaVanillaProofs) (storage.ReplicaUpdateProof, error) {
|
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2021-12-01 19:01:55 +00:00
|
|
|
func (t *testExec) GenerateSectorKeyFromData(ctx context.Context, sector storage.SectorRef, commD cid.Cid) error {
|
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2022-02-08 16:03:51 +00:00
|
|
|
func (t *testExec) FinalizeReplicaUpdate(ctx context.Context, sector storage.SectorRef, keepUnsealed []storage.Range) error {
|
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2020-11-05 06:34:24 +00:00
|
|
|
func (t *testExec) NewSector(ctx context.Context, sector storage.SectorRef) error {
|
2020-09-21 22:52:33 +00:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2020-11-05 06:34:24 +00:00
|
|
|
func (t *testExec) AddPiece(ctx context.Context, sector storage.SectorRef, pieceSizes []abi.UnpaddedPieceSize, newPieceSize abi.UnpaddedPieceSize, pieceData storage.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
|
|
|
|
}
|
|
|
|
|
2020-11-05 06:34:24 +00:00
|
|
|
func (t *testExec) UnsealPiece(ctx context.Context, sector storage.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")
|
|
|
|
}
|
|
|
|
|
2020-11-05 06:34:24 +00:00
|
|
|
func (t *testExec) ReadPiece(ctx context.Context, writer io.Writer, sector storage.SectorRef, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize) (bool, error) {
|
2020-09-21 22:52:33 +00:00
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
2020-09-21 23:00:17 +00:00
|
|
|
var _ ffiwrapper.Storage = &testExec{}
|