lotus/storage/sealing.go

85 lines
2.4 KiB
Go
Raw Normal View History

package storage
import (
"context"
"io"
2021-01-13 22:32:04 +00:00
"github.com/ipfs/go-cid"
2020-04-06 20:23:37 +00:00
"github.com/filecoin-project/go-address"
2020-09-07 03:49:10 +00:00
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/specs-storage/storage"
2020-02-08 02:18:32 +00:00
2020-08-17 13:39:33 +00:00
sealing "github.com/filecoin-project/lotus/extern/storage-sealing"
)
// TODO: refactor this to be direct somehow
2020-03-17 20:19:52 +00:00
func (m *Miner) Address() address.Address {
return m.sealing.Address()
}
2020-07-30 12:31:31 +00:00
func (m *Miner) AddPieceToAnySector(ctx context.Context, size abi.UnpaddedPieceSize, r io.Reader, d sealing.DealInfo) (abi.SectorNumber, abi.PaddedPieceSize, error) {
2020-06-26 13:13:18 +00:00
return m.sealing.AddPieceToAnySector(ctx, size, r, d)
}
2020-06-26 15:28:05 +00:00
func (m *Miner) StartPackingSector(sectorNum abi.SectorNumber) error {
return m.sealing.StartPacking(sectorNum)
}
func (m *Miner) ListSectors() ([]sealing.SectorInfo, error) {
return m.sealing.ListSectors()
}
func (m *Miner) GetSectorInfo(sid abi.SectorNumber) (sealing.SectorInfo, error) {
return m.sealing.GetSectorInfo(sid)
}
func (m *Miner) PledgeSector(ctx context.Context) (storage.SectorRef, error) {
2021-02-16 16:14:59 +00:00
return m.sealing.PledgeSector(ctx)
}
2020-04-06 20:23:37 +00:00
func (m *Miner) ForceSectorState(ctx context.Context, id abi.SectorNumber, state sealing.SectorState) error {
return m.sealing.ForceSectorState(ctx, id, state)
}
2020-06-22 17:35:14 +00:00
func (m *Miner) RemoveSector(ctx context.Context, id abi.SectorNumber) error {
return m.sealing.Remove(ctx, id)
}
2020-07-01 14:49:17 +00:00
2021-01-12 23:42:01 +00:00
func (m *Miner) TerminateSector(ctx context.Context, id abi.SectorNumber) error {
return m.sealing.Terminate(ctx, id)
}
2021-01-13 22:32:04 +00:00
func (m *Miner) TerminateFlush(ctx context.Context) (*cid.Cid, error) {
return m.sealing.TerminateFlush(ctx)
}
2021-01-14 11:37:23 +00:00
func (m *Miner) TerminatePending(ctx context.Context) ([]abi.SectorID, error) {
return m.sealing.TerminatePending(ctx)
}
2021-05-18 14:51:06 +00:00
func (m *Miner) SectorPreCommitFlush(ctx context.Context) (*cid.Cid, error) {
return m.sealing.SectorPreCommitFlush(ctx)
}
func (m *Miner) SectorPreCommitPending(ctx context.Context) ([]abi.SectorID, error) {
return m.sealing.SectorPreCommitPending(ctx)
}
2021-03-10 15:16:44 +00:00
func (m *Miner) CommitFlush(ctx context.Context) (*cid.Cid, error) {
return m.sealing.CommitFlush(ctx)
}
func (m *Miner) CommitPending(ctx context.Context) ([]abi.SectorID, error) {
return m.sealing.CommitPending(ctx)
}
2020-07-01 14:49:17 +00:00
func (m *Miner) MarkForUpgrade(id abi.SectorNumber) error {
return m.sealing.MarkForUpgrade(id)
}
func (m *Miner) IsMarkedForUpgrade(id abi.SectorNumber) bool {
return m.sealing.IsMarkedForUpgrade(id)
}