From 9fad80ce9ab52f33bbb2fd99bcf4f71a8965ccb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Thu, 16 Jun 2022 12:18:24 +0200 Subject: [PATCH] sealing pipeline: Drop unused miner-info related methods --- storage/adapter_storage_miner.go | 19 ----------------- storage/pipeline/mocks/api.go | 36 ++------------------------------ storage/pipeline/sealing.go | 2 -- 3 files changed, 2 insertions(+), 55 deletions(-) diff --git a/storage/adapter_storage_miner.go b/storage/adapter_storage_miner.go index 5ada011a4..a45f806ab 100644 --- a/storage/adapter_storage_miner.go +++ b/storage/adapter_storage_miner.go @@ -40,15 +40,6 @@ func NewSealingAPIAdapter(api fullNodeFilteredAPI) SealingAPIAdapter { return SealingAPIAdapter{delegate: api} } -func (s SealingAPIAdapter) StateMinerSectorSize(ctx context.Context, maddr address.Address, tsk types.TipSetKey) (abi.SectorSize, error) { - // TODO: update storage-fsm to just StateMinerInfo - mi, err := s.StateMinerInfo(ctx, maddr, tsk) - if err != nil { - return 0, err - } - return mi.SectorSize, nil -} - func (s SealingAPIAdapter) StateMinerPreCommitDepositForPower(ctx context.Context, a address.Address, pci minertypes.SectorPreCommitInfo, tsk types.TipSetKey) (big.Int, error) { return s.delegate.StateMinerPreCommitDepositForPower(ctx, a, pci, tsk) @@ -60,7 +51,6 @@ func (s SealingAPIAdapter) StateMinerInitialPledgeCollateral(ctx context.Context } func (s SealingAPIAdapter) StateMinerInfo(ctx context.Context, maddr address.Address, tsk types.TipSetKey) (api.MinerInfo, error) { - // TODO: update storage-fsm to just StateMinerInfo return s.delegate.StateMinerInfo(ctx, maddr, tsk) } @@ -68,15 +58,6 @@ func (s SealingAPIAdapter) StateMinerAvailableBalance(ctx context.Context, maddr return s.delegate.StateMinerAvailableBalance(ctx, maddr, tsk) } -func (s SealingAPIAdapter) StateMinerWorkerAddress(ctx context.Context, maddr address.Address, tsk types.TipSetKey) (address.Address, error) { - // TODO: update storage-fsm to just StateMinerInfo - mi, err := s.StateMinerInfo(ctx, maddr, tsk) - if err != nil { - return address.Undef, err - } - return mi.Worker, nil -} - func (s SealingAPIAdapter) StateMinerDeadlines(ctx context.Context, maddr address.Address, tsk types.TipSetKey) ([]api.Deadline, error) { return s.delegate.StateMinerDeadlines(ctx, maddr, tsk) } diff --git a/storage/pipeline/mocks/api.go b/storage/pipeline/mocks/api.go index 2b8fe09b8..d03004b77 100644 --- a/storage/pipeline/mocks/api.go +++ b/storage/pipeline/mocks/api.go @@ -8,9 +8,6 @@ import ( context "context" reflect "reflect" - gomock "github.com/golang/mock/gomock" - cid "github.com/ipfs/go-cid" - address "github.com/filecoin-project/go-address" bitfield "github.com/filecoin-project/go-bitfield" abi "github.com/filecoin-project/go-state-types/abi" @@ -20,10 +17,11 @@ import ( crypto "github.com/filecoin-project/go-state-types/crypto" dline "github.com/filecoin-project/go-state-types/dline" network "github.com/filecoin-project/go-state-types/network" - api "github.com/filecoin-project/lotus/api" types "github.com/filecoin-project/lotus/chain/types" sealing "github.com/filecoin-project/lotus/storage/pipeline" + gomock "github.com/golang/mock/gomock" + cid "github.com/ipfs/go-cid" ) // MockSealingAPI is a mock of SealingAPI interface. @@ -335,36 +333,6 @@ func (mr *MockSealingAPIMockRecorder) StateMinerSectorAllocated(arg0, arg1, arg2 return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMinerSectorAllocated", reflect.TypeOf((*MockSealingAPI)(nil).StateMinerSectorAllocated), arg0, arg1, arg2, arg3) } -// StateMinerSectorSize mocks base method. -func (m *MockSealingAPI) StateMinerSectorSize(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (abi.SectorSize, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "StateMinerSectorSize", arg0, arg1, arg2) - ret0, _ := ret[0].(abi.SectorSize) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// StateMinerSectorSize indicates an expected call of StateMinerSectorSize. -func (mr *MockSealingAPIMockRecorder) StateMinerSectorSize(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMinerSectorSize", reflect.TypeOf((*MockSealingAPI)(nil).StateMinerSectorSize), arg0, arg1, arg2) -} - -// StateMinerWorkerAddress mocks base method. -func (m *MockSealingAPI) StateMinerWorkerAddress(arg0 context.Context, arg1 address.Address, arg2 types.TipSetKey) (address.Address, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "StateMinerWorkerAddress", arg0, arg1, arg2) - ret0, _ := ret[0].(address.Address) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// StateMinerWorkerAddress indicates an expected call of StateMinerWorkerAddress. -func (mr *MockSealingAPIMockRecorder) StateMinerWorkerAddress(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateMinerWorkerAddress", reflect.TypeOf((*MockSealingAPI)(nil).StateMinerWorkerAddress), arg0, arg1, arg2) -} - // StateNetworkVersion mocks base method. func (m *MockSealingAPI) StateNetworkVersion(arg0 context.Context, arg1 types.TipSetKey) (network.Version, error) { m.ctrl.T.Helper() diff --git a/storage/pipeline/sealing.go b/storage/pipeline/sealing.go index c1cfc27ad..39d923cd1 100644 --- a/storage/pipeline/sealing.go +++ b/storage/pipeline/sealing.go @@ -58,8 +58,6 @@ type SealingAPI interface { StateSectorGetInfo(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tok types.TipSetKey) (*miner.SectorOnChainInfo, error) StateSectorPartition(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tok types.TipSetKey) (*SectorLocation, error) StateLookupID(context.Context, address.Address, types.TipSetKey) (address.Address, error) - StateMinerSectorSize(context.Context, address.Address, types.TipSetKey) (abi.SectorSize, error) - StateMinerWorkerAddress(ctx context.Context, maddr address.Address, tok types.TipSetKey) (address.Address, error) StateMinerPreCommitDepositForPower(context.Context, address.Address, miner.SectorPreCommitInfo, types.TipSetKey) (big.Int, error) StateMinerInitialPledgeCollateral(context.Context, address.Address, miner.SectorPreCommitInfo, types.TipSetKey) (big.Int, error) StateMinerInfo(context.Context, address.Address, types.TipSetKey) (api.MinerInfo, error)