fix(markets): update version, pass payment interval params

This commit is contained in:
hannahhoward
2020-01-28 14:08:13 -08:00
parent be26c56362
commit 433f9ff211
4 changed files with 29 additions and 22 deletions
+8 -6
View File
@@ -159,11 +159,13 @@ func (a *API) ClientFindData(ctx context.Context, root cid.Cid) ([]api.QueryOffe
out[k] = api.QueryOffer{Err: err.Error(), Miner: p.Address, MinerPeerID: p.ID}
} else {
out[k] = api.QueryOffer{
Root: root,
Size: queryResponse.Size,
MinPrice: utils.FromSharedTokenAmount(queryResponse.PieceRetrievalPrice()),
Miner: p.Address, // TODO: check
MinerPeerID: p.ID,
Root: root,
Size: queryResponse.Size,
MinPrice: utils.FromSharedTokenAmount(queryResponse.PieceRetrievalPrice()),
PaymentInterval: queryResponse.MaxPaymentInterval,
PaymentIntervalIncrease: queryResponse.MaxPaymentIntervalIncrease,
Miner: p.Address, // TODO: check
MinerPeerID: p.ID,
}
}
}
@@ -291,7 +293,7 @@ func (a *API) ClientRetrieve(ctx context.Context, order api.RetrievalOrder, path
a.Retrieval.Retrieve(
ctx,
order.Root,
retrievalmarket.NewParamsV0(types.BigDiv(order.Total, types.NewInt(order.Size)).Int, 0, 0),
retrievalmarket.NewParamsV0(types.BigDiv(order.Total, types.NewInt(order.Size)).Int, order.PaymentInterval, order.PaymentIntervalIncrease),
utils.ToSharedTokenAmount(order.Total),
order.MinerPeerID,
order.Client,