Bucket inclusion probabilities (#1224)

* Bucket inclusion probabilities

* Make display equal variant name for TS
This commit is contained in:
Drazen Urch
2022-04-26 16:23:32 +02:00
committed by GitHub
parent c250492f50
commit 632612eca0
9 changed files with 64 additions and 23 deletions
+2 -10
View File
@@ -219,16 +219,8 @@ pub(crate) async fn get_mixnode_inclusion_probability(
// (rewarded_set_size - active_set_size) * prob_one_draw * (1. - prob_active_set);
Json(Some(InclusionProbabilityResponse {
in_active: if prob_active_set > 1. {
1.
} else {
prob_active_set
} as f32,
in_reserve: if prob_reserve_set > 1. {
1.
} else {
prob_reserve_set
} as f32,
in_active: prob_active_set.into(),
in_reserve: prob_reserve_set.into(),
}))
} else {
Json(None)