fix storage adapter miner

This commit is contained in:
Steven Allen 2020-11-04 21:34:29 -08:00 committed by Łukasz Magiera
parent 4544d2118e
commit 219c695967
2 changed files with 9 additions and 10 deletions

View File

@ -43,7 +43,6 @@ import (
"github.com/filecoin-project/go-multistore"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper"
marketevents "github.com/filecoin-project/lotus/markets/loggers"
"github.com/filecoin-project/lotus/api"

View File

@ -39,13 +39,8 @@ func NewSealingAPIAdapter(api storageMinerApi) SealingAPIAdapter {
}
func (s SealingAPIAdapter) StateMinerSectorSize(ctx context.Context, maddr address.Address, tok sealing.TipSetToken) (abi.SectorSize, error) {
tsk, err := types.TipSetKeyFromBytes(tok)
if err != nil {
return 0, xerrors.Errorf("failed to unmarshal TipSetToken to TipSetKey: %w", err)
}
// TODO: update storage-fsm to just StateMinerInfo
mi, err := s.delegate.StateMinerInfo(ctx, maddr, tsk)
mi, err := s.StateMinerInfo(ctx, maddr, tok)
if err != nil {
return 0, err
}
@ -70,14 +65,19 @@ func (s SealingAPIAdapter) StateMinerInitialPledgeCollateral(ctx context.Context
return s.delegate.StateMinerInitialPledgeCollateral(ctx, a, pci, tsk)
}
func (s SealingAPIAdapter) StateMinerWorkerAddress(ctx context.Context, maddr address.Address, tok sealing.TipSetToken) (address.Address, error) {
func (s SealingAPIAdapter) StateMinerInfo(ctx context.Context, maddr address.Address, tok sealing.TipSetToken) (miner.MinerInfo, error) {
tsk, err := types.TipSetKeyFromBytes(tok)
if err != nil {
return address.Undef, xerrors.Errorf("failed to unmarshal TipSetToken to TipSetKey: %w", err)
return miner.MinerInfo{}, xerrors.Errorf("failed to unmarshal TipSetToken to TipSetKey: %w", err)
}
// TODO: update storage-fsm to just StateMinerInfo
mi, err := s.delegate.StateMinerInfo(ctx, maddr, tsk)
return s.delegate.StateMinerInfo(ctx, maddr, tsk)
}
func (s SealingAPIAdapter) StateMinerWorkerAddress(ctx context.Context, maddr address.Address, tok sealing.TipSetToken) (address.Address, error) {
// TODO: update storage-fsm to just StateMinerInfo
mi, err := s.StateMinerInfo(ctx, maddr, tok)
if err != nil {
return address.Undef, err
}