Compile fixes

This commit is contained in:
Steven Allen 2020-09-15 12:13:13 -07:00
parent c64f983900
commit 91e9573863
4 changed files with 10 additions and 9 deletions

View File

@ -344,9 +344,9 @@ type FullNode interface {
// expiration epoch // expiration epoch
StateSectorGetInfo(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (*miner.SectorOnChainInfo, error) StateSectorGetInfo(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (*miner.SectorOnChainInfo, error)
// StateSectorExpiration returns epoch at which given sector will expire // StateSectorExpiration returns epoch at which given sector will expire
StateSectorExpiration(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (*SectorExpiration, error) StateSectorExpiration(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (*miner.SectorExpiration, error)
// StateSectorPartition finds deadline/partition with the specified sector // StateSectorPartition finds deadline/partition with the specified sector
StateSectorPartition(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tok types.TipSetKey) (*SectorLocation, error) StateSectorPartition(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tok types.TipSetKey) (*miner.SectorLocation, error)
// StateSearchMsg searches for a message in the chain, and returns its receipt and the tipset where it was executed // StateSearchMsg searches for a message in the chain, and returns its receipt and the tipset where it was executed
StateSearchMsg(context.Context, cid.Cid) (*MsgLookup, error) StateSearchMsg(context.Context, cid.Cid) (*MsgLookup, error)
// StateWaitMsg looks back in the chain for a message. If not found, it blocks until the // StateWaitMsg looks back in the chain for a message. If not found, it blocks until the

View File

@ -27,7 +27,6 @@ import (
"github.com/filecoin-project/lotus/extern/sector-storage/stores" "github.com/filecoin-project/lotus/extern/sector-storage/stores"
"github.com/filecoin-project/lotus/extern/sector-storage/storiface" "github.com/filecoin-project/lotus/extern/sector-storage/storiface"
marketevents "github.com/filecoin-project/lotus/markets/loggers" marketevents "github.com/filecoin-project/lotus/markets/loggers"
"github.com/filecoin-project/specs-actors/actors/builtin/miner"
"github.com/filecoin-project/specs-actors/actors/builtin/paych" "github.com/filecoin-project/specs-actors/actors/builtin/paych"
"github.com/filecoin-project/specs-actors/actors/builtin/verifreg" "github.com/filecoin-project/specs-actors/actors/builtin/verifreg"
"github.com/filecoin-project/specs-storage/storage" "github.com/filecoin-project/specs-storage/storage"

View File

@ -10,7 +10,6 @@ import (
"github.com/filecoin-project/go-state-types/dline" "github.com/filecoin-project/go-state-types/dline"
"github.com/filecoin-project/lotus/chain/actors/adt" "github.com/filecoin-project/lotus/chain/actors/adt"
v0adt "github.com/filecoin-project/specs-actors/actors/util/adt" v0adt "github.com/filecoin-project/specs-actors/actors/util/adt"
cbor "github.com/ipfs/go-ipld-cbor"
"github.com/libp2p/go-libp2p-core/peer" "github.com/libp2p/go-libp2p-core/peer"
cbg "github.com/whyrusleeping/cbor-gen" cbg "github.com/whyrusleeping/cbor-gen"
"golang.org/x/xerrors" "golang.org/x/xerrors"
@ -70,7 +69,7 @@ func (s *v0State) GetSectorExpiration(num abi.SectorNumber) (out *SectorExpirati
// 2. If it's faulty, it will expire early within the first 14 entries // 2. If it's faulty, it will expire early within the first 14 entries
// of the expiration queue. // of the expiration queue.
stopErr := errors.New("stop") stopErr := errors.New("stop")
err := dls.ForEach(s.store, func(dlIdx uint64, dl *miner.Deadline) error { err = dls.ForEach(s.store, func(dlIdx uint64, dl *miner.Deadline) error {
partitions, err := dl.PartitionsArray(s.store) partitions, err := dl.PartitionsArray(s.store)
if err != nil { if err != nil {
return err return err
@ -102,12 +101,13 @@ func (s *v0State) GetSectorExpiration(num abi.SectorNumber) (out *SectorExpirati
out.Early = abi.ChainEpoch(epoch) out.Early = abi.ChainEpoch(epoch)
return nil return nil
} }
if onTime, err := exp.OnTime.IsSet(uint64(num)); err != nil { if onTime, err := exp.OnTimeSectors.IsSet(uint64(num)); err != nil {
return err return err
} else if onTime { } else if onTime {
out.OnTime = epoch out.OnTime = abi.ChainEpoch(epoch)
return stopErr return stopErr
} }
return nil
}) })
}) })
}) })

View File

@ -103,8 +103,10 @@ func GetPowerRaw(ctx context.Context, sm *StateManager, st cid.Cid, maddr addres
var mpow power.Claim var mpow power.Claim
if maddr != address.Undef { if maddr != address.Undef {
mpow, err = mas.MinerPower(maddr) var found bool
if err != nil { mpow, found, err = mas.MinerPower(maddr)
if err != nil || !found {
// TODO: return an error when not found?
return power.Claim{}, power.Claim{}, err return power.Claim{}, power.Claim{}, err
} }
} }