Fix compilation after dep updates

This commit is contained in:
Łukasz Magiera 2020-02-11 02:10:50 +01:00
parent 0225142b90
commit cd31b6721c
4 changed files with 7 additions and 7 deletions

View File

@ -128,7 +128,7 @@ func (m *Sealing) PledgeSector() error {
size := abi.PaddedPieceSize(m.sb.SectorSize()).Unpadded() size := abi.PaddedPieceSize(m.sb.SectorSize()).Unpadded()
sid, err := m.sb.AcquireSectorId() sid, err := m.sb.AcquireSectorNumber()
if err != nil { if err != nil {
log.Errorf("%+v", err) log.Errorf("%+v", err)
return return

View File

@ -12,13 +12,13 @@ import (
logging "github.com/ipfs/go-log/v2" logging "github.com/ipfs/go-log/v2"
"golang.org/x/xerrors" "golang.org/x/xerrors"
"github.com/filecoin-project/go-padreader"
"github.com/filecoin-project/go-sectorbuilder" "github.com/filecoin-project/go-sectorbuilder"
"github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/chain/events" "github.com/filecoin-project/lotus/chain/events"
"github.com/filecoin-project/lotus/chain/store" "github.com/filecoin-project/lotus/chain/store"
"github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/lib/padreader"
"github.com/filecoin-project/lotus/lib/statemachine" "github.com/filecoin-project/lotus/lib/statemachine"
) )
@ -96,12 +96,12 @@ func (m *Sealing) Stop(ctx context.Context) error {
return m.sectors.Stop(ctx) return m.sectors.Stop(ctx)
} }
func (m *Sealing) AllocatePiece(size uint64) (sectorID abi.SectorNumber, offset uint64, err error) { func (m *Sealing) AllocatePiece(size abi.UnpaddedPieceSize) (sectorID abi.SectorNumber, offset uint64, err error) {
if padreader.PaddedSize(size) != size { if (padreader.PaddedSize(uint64(size))) != size {
return 0, 0, xerrors.Errorf("cannot allocate unpadded piece") return 0, 0, xerrors.Errorf("cannot allocate unpadded piece")
} }
sid, err := m.sb.AcquireSectorId() // TODO: Put more than one thing in a sector sid, err := m.sb.AcquireSectorNumber() // TODO: Put more than one thing in a sector
if err != nil { if err != nil {
return 0, 0, xerrors.Errorf("acquiring sector ID: %w", err) return 0, 0, xerrors.Errorf("acquiring sector ID: %w", err)
} }

View File

@ -41,7 +41,7 @@ type Piece struct {
} }
func (p *Piece) ppi() (out sectorbuilder.PublicPieceInfo) { func (p *Piece) ppi() (out sectorbuilder.PublicPieceInfo) {
out.Size = uint64(p.Size) out.Size = p.Size
copy(out.CommP[:], p.CommP) copy(out.CommP[:], p.CommP)
return out return out
} }

View File

@ -71,7 +71,7 @@ func (m *Sealing) fastPledgeCommitment(size abi.UnpaddedPieceSize, parts uint64)
err = multierror.Append(err, perr) err = multierror.Append(err, perr)
} }
out[i] = sectorbuilder.PublicPieceInfo{ out[i] = sectorbuilder.PublicPieceInfo{
Size: uint64(piece), Size: piece,
CommP: commP, CommP: commP,
} }
lk.Unlock() lk.Unlock()