WIP getting post in sectorbuilder_test to work
This commit is contained in:
parent
2421f5d589
commit
7a3ffbf9fe
@ -291,7 +291,7 @@ func (sb *SectorBuilder) SealCommit(sectorID uint64, ticket SealTicket, seed Sea
|
||||
}
|
||||
}
|
||||
|
||||
sealedPath, err := sb.sealedSectorPath(sectorID)
|
||||
/* sealedPath, err := sb.sealedSectorPath(sectorID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -312,7 +312,7 @@ func (sb *SectorBuilder) SealCommit(sectorID uint64, ticket SealTicket, seed Sea
|
||||
)
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("ImportSealedSector: %w", err)
|
||||
}
|
||||
}*/
|
||||
return proof, nil
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
package sectorbuilder_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"math/rand"
|
||||
@ -76,8 +78,6 @@ func (s *seal) commit(t *testing.T, sb *sectorbuilder.SectorBuilder, done func()
|
||||
}
|
||||
|
||||
func (s *seal) post(t *testing.T, sb *sectorbuilder.SectorBuilder) {
|
||||
/*
|
||||
// TODO: fixme
|
||||
cSeed := [32]byte{0, 9, 2, 7, 6, 5, 4, 3, 2, 1, 0, 9, 8, 7, 6, 45, 3, 2, 1, 0, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 9}
|
||||
|
||||
ssi := sectorbuilder.NewSortedPublicSectorInfo([]sectorbuilder.PublicSectorInfo{{
|
||||
@ -85,19 +85,23 @@ func (s *seal) post(t *testing.T, sb *sectorbuilder.SectorBuilder) {
|
||||
CommR: s.pco.CommR,
|
||||
}})
|
||||
|
||||
postProof, err := sb.GeneratePoSt(ssi, cSeed, []uint64{})
|
||||
candndates, err := sb.GenerateEPostCandidates(ssi, cSeed, []uint64{})
|
||||
if err != nil {
|
||||
t.Fatalf("%+v", err)
|
||||
}
|
||||
|
||||
ok, err := sectorbuilder.VerifyPost(context.TODO(), sb.SectorSize(), ssi, cSeed, postProof, []uint64{})
|
||||
postProof, err := sb.ComputeElectionPoSt(ssi, cSeed[:], candndates)
|
||||
if err != nil {
|
||||
t.Fatalf("%+v", err)
|
||||
}
|
||||
|
||||
ok, err := sectorbuilder.VerifyPost(context.TODO(), sb.SectorSize(), ssi, cSeed[:], postProof, candndates, sb.Miner)
|
||||
if err != nil {
|
||||
t.Fatalf("%+v", err)
|
||||
}
|
||||
if !ok {
|
||||
t.Fatal("bad post")
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
func TestSealAndVerify(t *testing.T) {
|
||||
@ -126,6 +130,10 @@ func TestSealAndVerify(t *testing.T) {
|
||||
}
|
||||
cleanup := func() {
|
||||
sb.Destroy()
|
||||
if t.Failed() {
|
||||
fmt.Printf("not removing %s\n", dir)
|
||||
return
|
||||
}
|
||||
if err := os.RemoveAll(dir); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user