File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
validator_worker/src/core Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ pub fn is_healthy(
19
19
channel : & Channel ,
20
20
our : & BalancesMap ,
21
21
approved : & BalancesMap ,
22
- health_threshold_neg : BigNum ,
22
+ health_threshold : BigNum ,
23
23
) -> bool {
24
24
let sum_our: BigNum = our. values ( ) . sum ( ) ;
25
25
@@ -34,6 +34,7 @@ pub fn is_healthy(
34
34
}
35
35
36
36
let deposit = & channel. deposit_amount ;
37
+ let health_threshold_neg = BigNum :: from ( 1_000 ) - health_threshold;
37
38
let acceptable_difference = deposit * & health_threshold_neg / & BigNum :: from ( 1_000 ) ;
38
39
39
40
sum_our - sum_approved_mins < acceptable_difference
@@ -45,7 +46,7 @@ mod test {
45
46
use primitives:: channel:: fixtures:: get_channel;
46
47
47
48
fn health_threshold ( ) -> BigNum {
48
- ( 1000 - 950 ) . into ( )
49
+ 950 . into ( )
49
50
}
50
51
51
52
fn get_dummy_channel < T : Into < BigNum > > ( deposit : T ) -> Channel {
You can’t perform that action at this time.
0 commit comments