From 0e53275d40101b3e0edfa19b098a251d213f251e Mon Sep 17 00:00:00 2001 From: Dirk McCormick Date: Mon, 20 Dec 2021 16:03:03 +0100 Subject: [PATCH] feat: retrieval-ask - if size param is zero use QueryOffer.Size --- cli/client.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cli/client.go b/cli/client.go index 4025b9b56..634bd18e5 100644 --- a/cli/client.go +++ b/cli/client.go @@ -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))