sealing pipeline: Drop unused miner-info related methods

This commit is contained in:
Łukasz Magiera 2022-06-16 12:18:24 +02:00
parent 9aa5659d24
commit 9fad80ce9a
3 changed files with 2 additions and 55 deletions

View File

@ -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)
}

View File

@ -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()

View File

@ -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)