Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tidy up some print statements in rocketpool-cli/commands/minipool/status.go #605

Merged
merged 1 commit into from
Jul 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions rocketpool-cli/commands/minipool/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ func getStatus(c *cli.Context) error {

// Return if all minipools are finalized and they are hidden
if len(status.Data.Minipools) == len(finalisedMinipools) && !c.Bool(statusIncludeFinalizedFlag) {
fmt.Println("All of this node's minipools have been finalized.\nTo show finalized minipools, re-run this command with the `-f` flag.")
fmt.Println("All of this node's minipools have been finalized.")
fmt.Println("To show finalized minipools, re-run this command with the `-f` flag.")
return nil
}

Expand All @@ -85,7 +86,7 @@ func getStatus(c *cli.Context) error {
if statusName == "Withdrawable" {
fmt.Println("(Withdrawal may not be available until after withdrawal delay)")
}
fmt.Println("")
fmt.Println()

// Minipools
for _, minipool := range minipools {
Expand All @@ -94,39 +95,39 @@ func getStatus(c *cli.Context) error {
}
}

fmt.Println("")
fmt.Println()
}

// Handle finalized minipools
if c.Bool(statusIncludeFinalizedFlag) {
fmt.Printf("%d finalized minipool(s):\n", len(finalisedMinipools))
fmt.Println("")
fmt.Println()

// Minipools
for _, minipool := range finalisedMinipools {
printMinipoolDetails(minipool, status.Data.LatestDelegate)
}
} else {
fmt.Printf("%d finalized minipool(s) (hidden)\n", len(finalisedMinipools))
fmt.Println("")
fmt.Println()
}

fmt.Println("")
fmt.Println()

// Print actionable minipool details
if len(refundableMinipools) > 0 {
fmt.Printf("%d minipool(s) have refunds available:\n", len(refundableMinipools))
for _, minipool := range refundableMinipools {
fmt.Printf("- %s (%.6f ETH to claim)\n", minipool.Address.Hex(), math.RoundDown(eth.WeiToEth(minipool.Node.RefundBalance), 6))
}
fmt.Println("")
fmt.Println()
}
if len(closeableMinipools) > 0 {
fmt.Printf("%d dissolved minipool(s) can be closed once Beacon Chain withdrawals are enabled:\n", len(closeableMinipools))
for _, minipool := range closeableMinipools {
fmt.Printf("- %s (%.6f ETH to claim)\n", minipool.Address.Hex(), math.RoundDown(eth.WeiToEth(minipool.Balances.Eth), 6))
}
fmt.Println("")
fmt.Println()
}

// Return
Expand Down Expand Up @@ -209,6 +210,5 @@ func printMinipoolDetails(minipool api.MinipoolDetails, latestDelegate common.Ad
fmt.Printf("%s*Minipool can be upgraded to delegate %s!%s\n", terminal.ColorYellow, latestDelegate.Hex(), terminal.ColorReset)
}

fmt.Printf("\n")

fmt.Println()
}