miner info: Cleanup balance printing

This commit is contained in:
Łukasz Magiera 2020-12-01 19:22:57 +01:00
parent be9f7b88b2
commit c31774b08e

View File

@ -219,18 +219,20 @@ func infoCmdAct(cctx *cli.Context) error {
fmt.Printf("\tPledge: %s\n", types.FIL(lockedFunds.InitialPledgeRequirement).Short()) fmt.Printf("\tPledge: %s\n", types.FIL(lockedFunds.InitialPledgeRequirement).Short())
fmt.Printf("\tVesting: %s\n", types.FIL(lockedFunds.VestingFunds).Short()) fmt.Printf("\tVesting: %s\n", types.FIL(lockedFunds.VestingFunds).Short())
color.Green("\tAvailable: %s", types.FIL(availBalance).Short()) color.Green("\tAvailable: %s", types.FIL(availBalance).Short())
wb, err := api.WalletBalance(ctx, mi.Worker)
if err != nil {
return xerrors.Errorf("getting worker balance: %w", err)
}
color.Cyan("Worker Balance: %s", types.FIL(wb).Short())
mb, err := api.StateMarketBalance(ctx, maddr, types.EmptyTSK) mb, err := api.StateMarketBalance(ctx, maddr, types.EmptyTSK)
if err != nil { if err != nil {
return xerrors.Errorf("getting market balance: %w", err) return xerrors.Errorf("getting market balance: %w", err)
} }
fmt.Printf("Market (Escrow): %s\n", types.FIL(mb.Escrow).Short()) fmt.Printf("Market Balance: %s\n", types.FIL(mb.Escrow).Short())
fmt.Printf("Market (Locked): %s\n", types.FIL(mb.Locked).Short()) fmt.Printf("\tLocked: %s\n", types.FIL(mb.Locked).Short())
color.Green("\tAvailable: %s\n", types.FIL(big.Sub(mb.Escrow, mb.Locked)).Short())
wb, err := api.WalletBalance(ctx, mi.Worker)
if err != nil {
return xerrors.Errorf("getting worker balance: %w", err)
}
color.Cyan("Worker Balance: %s", types.FIL(wb).Short())
fmt.Println() fmt.Println()