fix storage adapter miner
This commit is contained in:
parent
4544d2118e
commit
219c695967
@ -43,7 +43,6 @@ import (
|
|||||||
"github.com/filecoin-project/go-multistore"
|
"github.com/filecoin-project/go-multistore"
|
||||||
"github.com/filecoin-project/go-state-types/abi"
|
"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"
|
marketevents "github.com/filecoin-project/lotus/markets/loggers"
|
||||||
|
|
||||||
"github.com/filecoin-project/lotus/api"
|
"github.com/filecoin-project/lotus/api"
|
||||||
|
@ -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) {
|
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
|
// 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 {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
@ -70,14 +65,19 @@ func (s SealingAPIAdapter) StateMinerInitialPledgeCollateral(ctx context.Context
|
|||||||
return s.delegate.StateMinerInitialPledgeCollateral(ctx, a, pci, tsk)
|
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)
|
tsk, err := types.TipSetKeyFromBytes(tok)
|
||||||
if err != nil {
|
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
|
// 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 {
|
if err != nil {
|
||||||
return address.Undef, err
|
return address.Undef, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user