Show verified status in client list-deals

This commit is contained in:
Ingar Shu 2020-10-07 10:55:07 -07:00
parent 1323e07a2c
commit f7f229ae54
No known key found for this signature in database
GPG Key ID: BE3D9CE79F22E769

View File

@ -1144,7 +1144,7 @@ func outputStorageDeals(ctx context.Context, out io.Writer, full lapi.FullNode,
if verbose { if verbose {
w := tabwriter.NewWriter(out, 2, 4, 2, ' ', 0) w := tabwriter.NewWriter(out, 2, 4, 2, ' ', 0)
fmt.Fprintf(w, "Created\tDealCid\tDealId\tProvider\tState\tOn Chain?\tSlashed?\tPieceCID\tSize\tPrice\tDuration\tMessage\n") fmt.Fprintf(w, "Created\tDealCid\tDealId\tProvider\tState\tOn Chain?\tSlashed?\tPieceCID\tSize\tPrice\tDuration\tVerified\tMessage\n")
for _, d := range deals { for _, d := range deals {
onChain := "N" onChain := "N"
if d.OnChainDealState.SectorStartEpoch != -1 { if d.OnChainDealState.SectorStartEpoch != -1 {
@ -1157,7 +1157,7 @@ func outputStorageDeals(ctx context.Context, out io.Writer, full lapi.FullNode,
} }
price := types.FIL(types.BigMul(d.LocalDeal.PricePerEpoch, types.NewInt(d.LocalDeal.Duration))) price := types.FIL(types.BigMul(d.LocalDeal.PricePerEpoch, types.NewInt(d.LocalDeal.Duration)))
fmt.Fprintf(w, "%s\t%s\t%d\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%d\t%s\n", d.LocalDeal.CreationTime.Format(time.Stamp), d.LocalDeal.ProposalCid, d.LocalDeal.DealID, d.LocalDeal.Provider, dealStateString(color, d.LocalDeal.State), onChain, slashed, d.LocalDeal.PieceCID, types.SizeStr(types.NewInt(d.LocalDeal.Size)), price, d.LocalDeal.Duration, d.LocalDeal.Message) fmt.Fprintf(w, "%s\t%s\t%d\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%d\t%v\t%s\n", d.LocalDeal.CreationTime.Format(time.Stamp), d.LocalDeal.ProposalCid, d.LocalDeal.DealID, d.LocalDeal.Provider, dealStateString(color, d.LocalDeal.State), onChain, slashed, d.LocalDeal.PieceCID, types.SizeStr(types.NewInt(d.LocalDeal.Size)), price, d.LocalDeal.Duration, d.LocalDeal.Verified, d.LocalDeal.Message)
} }
return w.Flush() return w.Flush()
} }
@ -1172,6 +1172,7 @@ func outputStorageDeals(ctx context.Context, out io.Writer, full lapi.FullNode,
tablewriter.Col("Size"), tablewriter.Col("Size"),
tablewriter.Col("Price"), tablewriter.Col("Price"),
tablewriter.Col("Duration"), tablewriter.Col("Duration"),
tablewriter.Col("Verified"),
tablewriter.NewLineCol("Message")) tablewriter.NewLineCol("Message"))
for _, d := range deals { for _, d := range deals {
@ -1201,6 +1202,7 @@ func outputStorageDeals(ctx context.Context, out io.Writer, full lapi.FullNode,
"PieceCID": piece, "PieceCID": piece,
"Size": types.SizeStr(types.NewInt(d.LocalDeal.Size)), "Size": types.SizeStr(types.NewInt(d.LocalDeal.Size)),
"Price": price, "Price": price,
"Verified": d.LocalDeal.Verified,
"Duration": d.LocalDeal.Duration, "Duration": d.LocalDeal.Duration,
"Message": d.LocalDeal.Message, "Message": d.LocalDeal.Message,
}) })