Fix tests

This commit is contained in:
Łukasz Magiera 2020-11-27 16:34:41 +01:00
parent dc7c7608df
commit e8d2560581
3 changed files with 8 additions and 5 deletions

View File

@ -443,6 +443,9 @@ var provingCheckProvableCmd = &cli.Command{
sectors := make(map[abi.SectorNumber]struct{})
sectorInfos, err := api.StateMinerSectors(ctx, addr, &par.AllSectors, types.EmptyTSK)
if err != nil {
return err
}
var tocheck []storage.SectorRef
for _, info := range sectorInfos {

View File

@ -405,14 +405,14 @@ func (mgr *SectorMgr) Remove(ctx context.Context, sector storage.SectorRef) erro
return nil
}
func (mgr *SectorMgr) CheckProvable(ctx context.Context, pp abi.RegisteredPoStProof, ids []storage.SectorRef) ([]abi.SectorID, error) {
var bad []abi.SectorID
func (mgr *SectorMgr) CheckProvable(ctx context.Context, pp abi.RegisteredPoStProof, ids []storage.SectorRef) (map[abi.SectorID]string, error) {
bad := map[abi.SectorID]string{}
for _, sid := range ids {
_, found := mgr.sectors[sid.ID]
if !found || mgr.sectors[sid.ID].failed {
bad = append(bad, sid.ID)
bad[sid.ID] = "mock fail"
}
}

View File

@ -125,9 +125,9 @@ func (m *mockProver) GenerateWindowPoSt(ctx context.Context, aid abi.ActorID, si
type mockFaultTracker struct {
}
func (m mockFaultTracker) CheckProvable(ctx context.Context, pp abi.RegisteredPoStProof, sectors []storage.SectorRef) ([]abi.SectorID, error) {
func (m mockFaultTracker) CheckProvable(ctx context.Context, pp abi.RegisteredPoStProof, sectors []storage.SectorRef) (map[abi.SectorID]string, error) {
// Returns "bad" sectors so just return nil meaning all sectors are good
return nil, nil
return map[abi.SectorID]string{}, nil
}
// TestWDPostDoPost verifies that doPost will send the correct number of window