Skip to content

Commit

Permalink
temporary fix for rewards bad display
Browse files Browse the repository at this point in the history
  • Loading branch information
iulianpascalau committed Oct 16, 2019
1 parent 6762ddf commit bacbd09
Showing 1 changed file with 24 additions and 21 deletions.
45 changes: 24 additions & 21 deletions statusHandler/view/termuic/termuiRenders/widgetsRender.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,27 +146,30 @@ func (wr *WidgetsRender) prepareInstanceInfo() {
countAcceptedBlocks := wr.presenter.GetCountAcceptedBlocks()
rows[5] = []string{fmt.Sprintf("Consensus leader accepted / proposed blocks : %d / %d", countAcceptedBlocks, countLeader)}

switch instanceType {
case string(core.NodeTypeValidator):
rewardsPerHour := wr.presenter.CalculateRewardsPerHour()
rows[6] = []string{fmt.Sprintf("Rewards estimation: %s ERD/h (without fees)", rewardsPerHour)}

var rewardsInfo []string
totalRewardsValue, diffRewards := wr.presenter.GetTotalRewardsValue()
if diffRewards != "0" {
wr.instanceInfo.RowStyles[7] = ui.NewStyle(ui.ColorGreen)
rewardsInfo = []string{fmt.Sprintf("Total rewards %s ERD + %s", totalRewardsValue, diffRewards)}
} else {
wr.instanceInfo.RowStyles[7] = ui.NewStyle(ui.ColorWhite)
rewardsInfo = []string{fmt.Sprintf("Total rewards %s ERD", totalRewardsValue)}
}
rows[7] = rewardsInfo

default:
rows[6] = []string{""}
rows[7] = []string{""}

}
//TODO fix this
//switch instanceType {
//case string(core.NodeTypeValidator):
// rewardsPerHour := wr.presenter.CalculateRewardsPerHour()
// rows[6] = []string{fmt.Sprintf("Rewards estimation: %s ERD/h (without fees)", rewardsPerHour)}
//
// var rewardsInfo []string
// totalRewardsValue, diffRewards := wr.presenter.GetTotalRewardsValue()
// if diffRewards != "0" {
// wr.instanceInfo.RowStyles[7] = ui.NewStyle(ui.ColorGreen)
// rewardsInfo = []string{fmt.Sprintf("Total rewards %s ERD + %s", totalRewardsValue, diffRewards)}
// } else {
// wr.instanceInfo.RowStyles[7] = ui.NewStyle(ui.ColorWhite)
// rewardsInfo = []string{fmt.Sprintf("Total rewards %s ERD", totalRewardsValue)}
// }
// rows[7] = rewardsInfo
//
//default:
// rows[6] = []string{""}
// rows[7] = []string{""}
//
//}
rows[6] = []string{""}
rows[7] = []string{""}

wr.instanceInfo.Title = "Elrond instance info"
wr.instanceInfo.RowSeparator = false
Expand Down

0 comments on commit bacbd09

Please sign in to comment.