Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bharath-123 committed Jan 16, 2024
1 parent 5fdb79d commit 26e4376
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions stader-cli/node/repay-sd.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,12 @@ func repaySD(c *cli.Context) error {
return err
}

remainUtilize := new(big.Int).Sub(sdStatus.SdUtilizerLatestBalance, amountWei)
fmt.Printf("Repayment of %s successful. Current Utilization Position: %s.\n", eth.DisplayAmountInUnits(amountWei, "sd"), eth.DisplayAmountInUnits(remainUtilize, "sd"))

if amountWei.Cmp(maxUint256()) == 0 {
fmt.Printf("Repayment of %s successful. Current Utilization Position: 0 SD.\n", eth.DisplayAmountInUnits(sdStatus.SdUtilizerLatestBalance, "sd"))
} else {
remainUtilize := new(big.Int).Sub(sdStatus.SdUtilizerLatestBalance, amountWei)
fmt.Printf("Repayment of %s successful. Current Utilization Position: %s.\n", eth.DisplayAmountInUnits(amountWei, "sd"), eth.DisplayAmountInUnits(remainUtilize, "sd"))
}
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion stader-cli/node/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ func getNodeStatus(c *cli.Context) error {
"Each Operator can utilize upto %s more.\nNote: The Operator can utilize a maximum of 1 ETH worth SD per validator.\n\n",
eth.DisplayAmountInUnits(maxUtilizable, "sd"))

if sdStatus.SdUtilizedBalance.Cmp(big.NewInt(0)) == 0 {
if sdStatus.SdUtilizedBalance.Cmp(big.NewInt(0)) != 0 {
fmt.Printf(
"The Operator has a Health Factor of %s. \nNote: Please ensure your Health Factor is greater than 1 to avoid liquidations.\n\n",
sdStatus.HealthFactor.String())
Expand Down

0 comments on commit 26e4376

Please sign in to comment.