From bb7a3dc94d3894b9e8ac3a838a00e3df11007147 Mon Sep 17 00:00:00 2001 From: hannahhoward Date: Thu, 23 Jul 2020 13:20:34 -0700 Subject: [PATCH] fix(queryresponse): set piece retrieval price correctly Add unseal price into total piece retrieval price --- retrievalmarket/types.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retrievalmarket/types.go b/retrievalmarket/types.go index 935da0a2..a49031ad 100644 --- a/retrievalmarket/types.go +++ b/retrievalmarket/types.go @@ -198,7 +198,7 @@ var QueryResponseUndefined = QueryResponse{} // PieceRetrievalPrice is the total price to retrieve the piece (size * MinPricePerByte) func (qr QueryResponse) PieceRetrievalPrice() abi.TokenAmount { - return big.Mul(qr.MinPricePerByte, abi.NewTokenAmount(int64(qr.Size))) + return big.Add(big.Mul(qr.MinPricePerByte, abi.NewTokenAmount(int64(qr.Size))), qr.UnsealPrice) } // PayloadRetrievalPrice is the expected price to retrieve just the given payload