Merge pull request #4384 from filecoin-project/feat/4220

Use updated stored ask API
This commit is contained in:
Łukasz Magiera 2020-10-14 12:03:07 +02:00 committed by GitHub
commit 465703b618
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -393,13 +393,13 @@ func NewStorageAsk(ctx helpers.MetricsCtx, fapi lapi.FullNode, ds dtypes.Metadat
if err != nil { if err != nil {
return nil, err return nil, err
} }
storedAsk, err := storedask.NewStoredAsk(namespace.Wrap(providerDs, datastore.NewKey("/storage-ask")), datastore.NewKey("latest"), spn, address.Address(minerAddress)) storedAsk, err := storedask.NewStoredAsk(namespace.Wrap(providerDs, datastore.NewKey("/storage-ask")), datastore.NewKey("latest"), spn, address.Address(minerAddress),
storagemarket.MaxPieceSize(abi.PaddedPieceSize(mi.SectorSize)))
if err != nil { if err != nil {
return nil, err return nil, err
} }
// Hacky way to set max piece size to the sector size
a := storedAsk.GetAsk().Ask a := storedAsk.GetAsk().Ask
err = storedAsk.SetAsk(a.Price, a.VerifiedPrice, a.Expiry-a.Timestamp, storagemarket.MaxPieceSize(abi.PaddedPieceSize(mi.SectorSize))) err = storedAsk.SetAsk(a.Price, a.VerifiedPrice, a.Expiry-a.Timestamp)
if err != nil { if err != nil {
return storedAsk, err return storedAsk, err
} }