From 9d63e1412e6bbe52766a3a0fa8335c72fba4b020 Mon Sep 17 00:00:00 2001 From: Geoff Stuart Date: Wed, 14 Sep 2022 01:04:15 -0400 Subject: [PATCH] print beneficiary info in state miner-info and lotus-miner info --- cli/state.go | 16 ++++++++++++++++ cmd/lotus-miner/info.go | 17 +++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/cli/state.go b/cli/state.go index a7e195b1c..a0fc49f30 100644 --- a/cli/state.go +++ b/cli/state.go @@ -169,6 +169,22 @@ var StateMinerInfo = &cli.Command{ for i, controlAddress := range mi.ControlAddresses { fmt.Printf("Control %d: \t%s\n", i, controlAddress) } + if mi.Beneficiary != address.Undef { + fmt.Printf("Beneficiary:\t%s\n", mi.Beneficiary) + if mi.Beneficiary != mi.Owner { + fmt.Printf("Beneficiary Quota:\t%s\n", mi.BeneficiaryTerm.Quota) + fmt.Printf("Beneficiary Used Quota:\t%s\n", mi.BeneficiaryTerm.UsedQuota) + fmt.Printf("Beneficiary Expiration:\t%s\n", mi.BeneficiaryTerm.Expiration) + } + } + if mi.PendingBeneficiaryTerm != nil { + fmt.Printf("Pending Beneficiary Term:\n") + fmt.Printf("New Beneficiary:\t%s\n", mi.PendingBeneficiaryTerm.NewBeneficiary) + fmt.Printf("New Quota:\t%s\n", mi.PendingBeneficiaryTerm.NewQuota) + fmt.Printf("New Expiration:\t%s\n", mi.PendingBeneficiaryTerm.NewExpiration) + fmt.Printf("Approved By Beneficiary:\t%t\n", mi.PendingBeneficiaryTerm.ApprovedByBeneficiary) + fmt.Printf("Approved By Nominee:\t%t\n", mi.PendingBeneficiaryTerm.ApprovedByNominee) + } fmt.Printf("PeerID:\t%s\n", mi.PeerId) fmt.Printf("Multiaddrs:\t") diff --git a/cmd/lotus-miner/info.go b/cmd/lotus-miner/info.go index 408482a89..e8cbfd8b7 100644 --- a/cmd/lotus-miner/info.go +++ b/cmd/lotus-miner/info.go @@ -313,6 +313,23 @@ func handleMiningInfo(ctx context.Context, cctx *cli.Context, fullapi v1api.Full } colorTokenAmount("Total Spendable: %s\n", spendable) + if mi.Beneficiary != address.Undef { + fmt.Println() + fmt.Printf("Beneficiary:\t%s\n", mi.Beneficiary) + if mi.Beneficiary != mi.Owner { + fmt.Printf("Beneficiary Quota:\t%s\n", mi.BeneficiaryTerm.Quota) + fmt.Printf("Beneficiary Used Quota:\t%s\n", mi.BeneficiaryTerm.UsedQuota) + fmt.Printf("Beneficiary Expiration:\t%s\n", mi.BeneficiaryTerm.Expiration) + } + } + if mi.PendingBeneficiaryTerm != nil { + fmt.Printf("Pending Beneficiary Term:\n") + fmt.Printf("New Beneficiary:\t%s\n", mi.PendingBeneficiaryTerm.NewBeneficiary) + fmt.Printf("New Quota:\t%s\n", mi.PendingBeneficiaryTerm.NewQuota) + fmt.Printf("New Expiration:\t%s\n", mi.PendingBeneficiaryTerm.NewExpiration) + fmt.Printf("Approved By Beneficiary:\t%t\n", mi.PendingBeneficiaryTerm.ApprovedByBeneficiary) + fmt.Printf("Approved By Nominee:\t%t\n", mi.PendingBeneficiaryTerm.ApprovedByNominee) + } fmt.Println() if !cctx.Bool("hide-sectors-info") {