Skip to content

Commit

Permalink
Merge pull request #7 from vitwit/commission_rate
Browse files Browse the repository at this point in the history
Fixed commission_rate
  • Loading branch information
kaustubhkapatral authored Dec 28, 2020
2 parents ac5c0f1 + 7e397e1 commit a0cb7f6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions targets/staking_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,12 @@ func GetCommissionRate(ops types.HTTPOptions, cfg *config.Config, c client.Clien
return
}

rate := utils.ConvertWeiToEth(commissionRate)

var fee float64
f, err := strconv.ParseFloat(rate, 64)
f, err := strconv.ParseFloat(commissionRate.String(), 64)
if err != nil {
fee = 0
} else {
fee = f * 100
fee = f
}

_ = db.WriteToInfluxDb(c, bp, "heimdall_commission_rate", map[string]string{}, map[string]interface{}{"commission_rate": fee})
Expand Down Expand Up @@ -203,6 +201,7 @@ func GetEncodedData(ops types.HTTPOptions, cfg *config.Config, c client.Client,
// EthCall will returns the validator share contract method response
func EthCall(ops types.HTTPOptions, cfg *config.Config, c client.Client, dataHash string) (eth types.EthResult) {
contractAddress := GetValContractAddress(cfg, c)

data := types.Payload{
Jsonrpc: "2.0",
Method: "eth_call",
Expand Down

0 comments on commit a0cb7f6

Please sign in to comment.