sealing: Fix planOne for global events

This commit is contained in:
Łukasz Magiera 2020-01-22 19:30:56 +01:00
parent 3a2047dcd7
commit 032b2d877c
2 changed files with 6 additions and 4 deletions

View File

@ -63,9 +63,6 @@ func checkSeal(ctx context.Context, maddr address.Address, si *SectorInfo, api s
return xerrors.Errorf("on chain CommD differs from sector: %x != %x", r.Return, si.CommD)
}
// TODO: Validate ticket
// TODO: Verify commp / commr / proof
// TODO: (StateCall PreCommit)
return nil
}

7
fsm.go
View File

@ -229,6 +229,11 @@ func planOne(ts ...func() (mut mutator, next api.SectorState)) func(events []sta
return xerrors.Errorf("planner for state %s only has a plan for a single event only, got %+v", api.SectorStates[state.State], events)
}
if gm, ok := events[0].User.(globalMutator); !ok {
gm.applyGlobal(state)
return nil
}
for _, t := range ts {
mut, next := t()
@ -245,6 +250,6 @@ func planOne(ts ...func() (mut mutator, next api.SectorState)) func(events []sta
return nil
}
return xerrors.Errorf("planner for state %s received unexpected event %+v", api.SectorStates[state.State], events[0])
return xerrors.Errorf("planner for state %s received unexpected event %T (%+v)", api.SectorStates[state.State], events[0].User, events[0])
}
}