Skip to content

Commit aa8e1fb

Browse files
committed
f drop shift test
1 parent 684dfaf commit aa8e1fb

File tree

1 file changed

+0
-36
lines changed

1 file changed

+0
-36
lines changed

lightning/src/routing/scoring.rs

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2870,42 +2870,6 @@ mod tests {
28702870
assert_eq!(scorer.channel_penalty_msat(42, &source, &target, usage, &params), u64::max_value());
28712871
}
28722872

2873-
#[test]
2874-
fn decays_liquidity_bounds_without_shift_overflow() {
2875-
let logger = TestLogger::new();
2876-
let network_graph = network_graph(&logger);
2877-
let params = ProbabilisticScoringFeeParameters {
2878-
liquidity_penalty_multiplier_msat: 1_000,
2879-
..ProbabilisticScoringFeeParameters::zero_penalty()
2880-
};
2881-
let decay_params = ProbabilisticScoringDecayParameters {
2882-
liquidity_offset_half_life: Duration::from_secs(10),
2883-
..ProbabilisticScoringDecayParameters::default()
2884-
};
2885-
let mut scorer = ProbabilisticScorer::new(decay_params, &network_graph, &logger);
2886-
let source = source_node_id();
2887-
let target = target_node_id();
2888-
let usage = ChannelUsage {
2889-
amount_msat: 256,
2890-
inflight_htlc_msat: 0,
2891-
effective_capacity: EffectiveCapacity::Total { capacity_msat: 1_024, htlc_maximum_msat: 1_000 },
2892-
};
2893-
assert_eq!(scorer.channel_penalty_msat(42, &source, &target, usage, &params), 125);
2894-
2895-
scorer.payment_path_failed(&payment_path_for_amount(512), 42, Duration::ZERO);
2896-
assert_eq!(scorer.channel_penalty_msat(42, &source, &target, usage, &params), 281);
2897-
2898-
// An unchecked right shift 64 bits or more in DirectedChannelLiquidity::decayed_offset_msat
2899-
// would cause an overflow.
2900-
SinceEpoch::advance(Duration::from_secs(10 * 64));
2901-
scorer.decay_liquidity_certainty(Duration::from_secs(10 * 64));
2902-
assert_eq!(scorer.channel_penalty_msat(42, &source, &target, usage, &params), 125);
2903-
2904-
SinceEpoch::advance(Duration::from_secs(10));
2905-
scorer.decay_liquidity_certainty(Duration::from_secs(10 * 65));
2906-
assert_eq!(scorer.channel_penalty_msat(42, &source, &target, usage, &params), 125);
2907-
}
2908-
29092873
#[test]
29102874
fn restricts_liquidity_bounds_after_decay() {
29112875
let logger = TestLogger::new();

0 commit comments

Comments
 (0)