Fix uptime integer division, change lambda and sigma from ticked to regular (#1284)

* Add more data to reward-estimate response

* Fix uptime integer division error

* typo

* Reify tuple response

* Fix uptime calculation

* Use lambda and sigma instead of ticked versions for delegator and operator rewards calculation

* Changelog
This commit is contained in:
Drazen Urch
2022-05-31 11:03:28 +02:00
committed by GitHub
parent 83f80f094c
commit 189b83e769
7 changed files with 90 additions and 53 deletions
+6 -8
View File
@@ -148,15 +148,13 @@ pub(crate) async fn get_mixnode_reward_estimation(
let reward_params = RewardParams::new(reward_params, node_reward_params);
match bond.estimate_reward(&reward_params) {
Ok((
estimated_total_node_reward,
estimated_operator_reward,
estimated_delegators_reward,
)) => {
Ok(reward_estimate) => {
let reponse = RewardEstimationResponse {
estimated_total_node_reward,
estimated_operator_reward,
estimated_delegators_reward,
estimated_total_node_reward: reward_estimate.total_node_reward,
estimated_operator_reward: reward_estimate.operator_reward,
estimated_delegators_reward: reward_estimate.delegators_reward,
estimated_node_profit: reward_estimate.node_profit,
estimated_operator_cost: reward_estimate.operator_cost,
reward_params,
as_at,
};