Fix sealing sectors with multiple pieces

This commit is contained in:
Łukasz Magiera 2020-03-26 00:04:40 +01:00
parent 0ce42d520a
commit 3081a1b9c7

View File

@ -159,7 +159,7 @@ func (sb *SectorMgr) SealPreCommit1(ctx context.Context, sid abi.SectorID, ticke
} }
} }
commd, err := MockVerifier.GenerateDataCommitment(abi.PaddedPieceSize(sb.sectorSize), pis) commd, err := MockVerifier.GenerateDataCommitment(sb.proofType, pis)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -354,15 +354,8 @@ func (m mockVerif) VerifySeal(svi abi.SealVerifyInfo) (bool, error) {
return true, nil return true, nil
} }
func (m mockVerif) GenerateDataCommitment(ssize abi.PaddedPieceSize, pieces []abi.PieceInfo) (cid.Cid, error) { func (m mockVerif) GenerateDataCommitment(pt abi.RegisteredProof, pieces []abi.PieceInfo) (cid.Cid, error) {
if len(pieces) != 1 { return sectorbuilder.GenerateUnsealedCID(pt, pieces)
panic("todo")
}
if pieces[0].Size != ssize {
fmt.Println("wrong sizes? ", pieces[0].Size, ssize)
panic("todo")
}
return pieces[0].PieceCID, nil
} }
var MockVerifier = mockVerif{} var MockVerifier = mockVerif{}