diff --git a/storage/adapter_events.go b/storage/adapter_events.go index 4a173d4a4..f89deea3a 100644 --- a/storage/adapter_events.go +++ b/storage/adapter_events.go @@ -13,10 +13,10 @@ import ( var _ sealing.Events = new(EventsAdapter) type EventsAdapter struct { - delegate events.Events + delegate *events.Events } -func NewEventsAdapter(api events.Events) EventsAdapter { +func NewEventsAdapter(api *events.Events) EventsAdapter { return EventsAdapter{delegate: api} } diff --git a/storage/adapter_storage_miner.go b/storage/adapter_storage_miner.go index d194f211f..8baff9077 100644 --- a/storage/adapter_storage_miner.go +++ b/storage/adapter_storage_miner.go @@ -99,7 +99,7 @@ func (s SealingAPIAdapter) StateComputeDataCommitment(ctx context.Context, maddr return cid.Cid(c), nil } -func (s SealingAPIAdapter) StateGetSectorPreCommitOnChainInfo(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tok sealing.TipSetToken) (*miner.SectorPreCommitOnChainInfo, error) { +func (s SealingAPIAdapter) StateSectorPreCommitInfo(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tok sealing.TipSetToken) (*miner.SectorPreCommitOnChainInfo, error) { tsk, err := types.TipSetKeyFromBytes(tok) if err != nil { return nil, xerrors.Errorf("failed to unmarshal TipSetToken to TipSetKey: %w", err) diff --git a/storage/miner.go b/storage/miner.go index 58fb27e41..98cef4524 100644 --- a/storage/miner.go +++ b/storage/miner.go @@ -99,7 +99,7 @@ func (m *Miner) Run(ctx context.Context) error { } evts := events.NewEvents(ctx, m.api) - m.sealing = sealing.New(NewSealingAPIAdapter(m.api), NewEventsAdapter(*evts), m.maddr, m.worker, m.ds, m.sealer, m.sc, m.verif, m.tktFn) + m.sealing = sealing.New(NewSealingAPIAdapter(m.api), NewEventsAdapter(evts), m.maddr, m.worker, m.ds, m.sealer, m.sc, m.verif, m.tktFn) go m.sealing.Run(ctx) diff --git a/storage/sealing/checks.go b/storage/sealing/checks.go index ff1572cf2..1538cc8d5 100644 --- a/storage/sealing/checks.go +++ b/storage/sealing/checks.go @@ -101,7 +101,7 @@ func (m *Sealing) checkCommit(ctx context.Context, si SectorInfo, proof []byte) return &ErrBadSeed{xerrors.Errorf("seed epoch was not set")} } - pci, err := m.api.StateGetSectorPreCommitOnChainInfo(ctx, m.maddr, si.SectorID, tok) + pci, err := m.api.StateSectorPreCommitInfo(ctx, m.maddr, si.SectorID, tok) if err != nil { return xerrors.Errorf("getting precommit info: %w", err) } diff --git a/storage/sealing/sealing.go b/storage/sealing/sealing.go index d79ebfc84..24d43c1b1 100644 --- a/storage/sealing/sealing.go +++ b/storage/sealing/sealing.go @@ -29,7 +29,7 @@ var log = logging.Logger("sectors") type SealingAPI interface { StateWaitMsg(context.Context, cid.Cid) (MsgLookup, error) StateComputeDataCommitment(ctx context.Context, maddr address.Address, sectorType abi.RegisteredProof, deals []abi.DealID, tok TipSetToken) (cid.Cid, error) - StateGetSectorPreCommitOnChainInfo(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tok TipSetToken) (*miner.SectorPreCommitOnChainInfo, error) + StateSectorPreCommitInfo(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tok TipSetToken) (*miner.SectorPreCommitOnChainInfo, error) StateMinerSectorSize(context.Context, address.Address, TipSetToken) (abi.SectorSize, error) StateMarketStorageDeal(context.Context, abi.DealID, TipSetToken) (market.DealProposal, market.DealState, error) SendMsg(ctx context.Context, from, to address.Address, method abi.MethodNum, value, gasPrice big.Int, gasLimit int64, params []byte) (cid.Cid, error) diff --git a/storage/sealing/states.go b/storage/sealing/states.go index 907ead6b3..a2c56e072 100644 --- a/storage/sealing/states.go +++ b/storage/sealing/states.go @@ -145,7 +145,7 @@ func (m *Sealing) handleWaitSeed(ctx statemachine.Context, sector SectorInfo) er } log.Info("precommit message landed on chain: ", sector.SectorID) - pci, err := m.api.StateGetSectorPreCommitOnChainInfo(ctx.Context(), m.maddr, sector.SectorID, mw.TipSetTok) + pci, err := m.api.StateSectorPreCommitInfo(ctx.Context(), m.maddr, sector.SectorID, mw.TipSetTok) if err != nil { return xerrors.Errorf("getting precommit info: %w", err) } diff --git a/storage/sealing/states_failed.go b/storage/sealing/states_failed.go index 4879b52fd..ac4306f95 100644 --- a/storage/sealing/states_failed.go +++ b/storage/sealing/states_failed.go @@ -34,7 +34,7 @@ func (m *Sealing) checkPreCommitted(ctx statemachine.Context, sector SectorInfo) return nil, true } - info, err := m.api.StateGetSectorPreCommitOnChainInfo(ctx.Context(), m.maddr, sector.SectorID, tok) + info, err := m.api.StateSectorPreCommitInfo(ctx.Context(), m.maddr, sector.SectorID, tok) if err != nil { log.Errorf("handleSealFailed(%d): temp error: %+v", sector.SectorID, err) return nil, true