From 032b2d877c6975c6c8a74a1bdd3291efae7610af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Wed, 22 Jan 2020 19:30:56 +0100 Subject: [PATCH] sealing: Fix planOne for global events --- checks.go | 3 --- fsm.go | 7 ++++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/checks.go b/checks.go index 9e12bf943..e6ee9f7e8 100644 --- a/checks.go +++ b/checks.go @@ -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 } diff --git a/fsm.go b/fsm.go index 7e46b6eb5..ce4e74408 100644 --- a/fsm.go +++ b/fsm.go @@ -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]) } }