Skip to content

Commit

Permalink
sealing pipeline: Drop unused miner-info related methods
Browse files Browse the repository at this point in the history
  • Loading branch information
magik6k committed Jun 16, 2022
1 parent 9aa5659 commit 9fad80c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 55 deletions.
19 changes: 0 additions & 19 deletions storage/adapter_storage_miner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -60,23 +51,13 @@ 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)
}

func (s SealingAPIAdapter) StateMinerAvailableBalance(ctx context.Context, maddr address.Address, tsk types.TipSetKey) (big.Int, error) {
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)
}
Expand Down
36 changes: 2 additions & 34 deletions storage/pipeline/mocks/api.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions storage/pipeline/sealing.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9fad80c

Please sign in to comment.