Wire up sector builder commands through the api

This commit is contained in:
whyrusleeping
2019-07-29 12:08:47 -07:00
parent 26232f0b9a
commit b83ff6b9dc
8 changed files with 183 additions and 27 deletions
+11 -1
View File
@@ -7,6 +7,10 @@ import (
sectorbuilder "github.com/filecoin-project/go-sectorbuilder"
)
type SectorSealingStatus = sectorbuilder.SectorSealingStatus
type StagedSectorMetadata = sectorbuilder.StagedSectorMetadata
const CommLen = sectorbuilder.CommitmentBytesLen
type SectorBuilder struct {
@@ -52,16 +56,22 @@ func (sb *SectorBuilder) SealAllStagedSectors() error {
return sectorbuilder.SealAllStagedSectors(sb.handle)
}
func (sb *SectorBuilder) SealStatus(sector uint64) (sectorbuilder.SectorSealingStatus, error) {
func (sb *SectorBuilder) SealStatus(sector uint64) (SectorSealingStatus, error) {
return sectorbuilder.GetSectorSealingStatusByID(sb.handle, sector)
}
func (sb *SectorBuilder) GetAllStagedSectors() ([]StagedSectorMetadata, error) {
return sectorbuilder.GetAllStagedSectors(sb.handle)
}
func (sb *SectorBuilder) GeneratePoSt(sortedCommRs [][CommLen]byte, challengeSeed [CommLen]byte) ([][]byte, []uint64, error) {
// Wait, this is a blocking method with no way of interrupting it?
// does it checkpoint itself?
return sectorbuilder.GeneratePoSt(sb.handle, sortedCommRs, challengeSeed)
}
var UserBytesForSectorSize = sectorbuilder.GetMaxUserBytesPerStagedSector
func VerifySeal(sectorSize uint64, commR, commD, commRStar [CommLen]byte, proverID address.Address, sectorID uint64, proof []byte) (bool, error) {
panic("TODO")
// return sectorbuilder.VerifySeal(sectorSize, commR, commD, commRStar, providerID, sectorID, proof)