2020-01-15 20:49:11 +00:00
|
|
|
package storage
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"io"
|
|
|
|
|
2020-04-06 20:23:37 +00:00
|
|
|
"github.com/filecoin-project/go-address"
|
2020-02-08 02:18:32 +00:00
|
|
|
"github.com/filecoin-project/specs-actors/actors/abi"
|
|
|
|
|
2020-04-07 00:41:33 +00:00
|
|
|
sealing "github.com/filecoin-project/storage-fsm"
|
2020-01-15 20:49:11 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// 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-06-26 13:13:18 +00:00
|
|
|
func (m *Miner) AddPieceToAnySector(ctx context.Context, size abi.UnpaddedPieceSize, r io.Reader, d sealing.DealInfo) (abi.SectorNumber, uint64, error) {
|
|
|
|
return m.sealing.AddPieceToAnySector(ctx, size, r, d)
|
2020-01-15 20:49:11 +00:00
|
|
|
}
|
|
|
|
|
2020-06-26 15:28:05 +00:00
|
|
|
func (m *Miner) StartPackingSector(sectorNum abi.SectorNumber) error {
|
|
|
|
return m.sealing.StartPacking(sectorNum)
|
|
|
|
}
|
|
|
|
|
2020-01-15 20:49:11 +00:00
|
|
|
func (m *Miner) ListSectors() ([]sealing.SectorInfo, error) {
|
|
|
|
return m.sealing.ListSectors()
|
|
|
|
}
|
|
|
|
|
2020-02-09 06:06:32 +00:00
|
|
|
func (m *Miner) GetSectorInfo(sid abi.SectorNumber) (sealing.SectorInfo, error) {
|
2020-01-15 20:49:11 +00:00
|
|
|
return m.sealing.GetSectorInfo(sid)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *Miner) PledgeSector() error {
|
|
|
|
return m.sealing.PledgeSector()
|
|
|
|
}
|
|
|
|
|
2020-04-06 20:23:37 +00:00
|
|
|
func (m *Miner) ForceSectorState(ctx context.Context, id abi.SectorNumber, state sealing.SectorState) error {
|
2020-01-15 20:49:11 +00:00
|
|
|
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)
|
|
|
|
}
|