Skip to content

Commit

Permalink
feat: retrieval-ask - if size param is zero use QueryOffer.Size
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkmc committed Dec 20, 2021
1 parent bb56e97 commit 0e53275
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cli/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1076,11 +1076,15 @@ var clientQueryRetrievalAskCmd = &cli.Command{
afmt.Printf("Payment interval: %s\n", types.SizeStr(types.NewInt(ask.PaymentInterval)))
afmt.Printf("Payment interval increase: %s\n", types.SizeStr(types.NewInt(ask.PaymentIntervalIncrease)))

size := cctx.Int64("size")
size := cctx.Uint64("size")
if size == 0 {
return nil
if ask.Size == 0 {
return nil
}
size = ask.Size
afmt.Printf("Size: %s\n", types.SizeStr(types.NewInt(ask.Size)))
}
transferPrice := types.BigMul(ask.PricePerByte, types.NewInt(uint64(size)))
transferPrice := types.BigMul(ask.PricePerByte, types.NewInt(size))
totalPrice := types.BigAdd(ask.UnsealPrice, transferPrice)
afmt.Printf("Total price for %d bytes: %s\n", size, types.FIL(totalPrice))

Expand Down

0 comments on commit 0e53275

Please sign in to comment.