Skip to content

Commit 4a1ef19

Browse files
committed
reactor: remove deprecated function fee_wu
Besides the change of name to `to_fee`, now the function no longer returns results wrapped in an option, so the `?` operator is removed as well.
1 parent 963470f commit 4a1ef19

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub(crate) fn effective_value(
5757
weight: Weight,
5858
value: Amount,
5959
) -> Option<SignedAmount> {
60-
let signed_input_fee: SignedAmount = fee_rate.fee_wu(weight)?.to_signed();
60+
let signed_input_fee: SignedAmount = fee_rate.to_fee(weight).to_signed();
6161
let eff_value = (value.to_signed() - signed_input_fee).unwrap();
6262
Some(eff_value)
6363
}

src/weighted_utxo.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ impl WeightedUtxo {
3434
let positive_effective_value = Self::positive_effective_value(fee_rate, weight, value);
3535

3636
if let Some(effective_value) = positive_effective_value {
37-
let fee = fee_rate.fee_wu(weight)?.to_signed();
38-
let long_term_fee: SignedAmount = long_term_fee_rate.fee_wu(weight)?.to_signed();
37+
let fee = fee_rate.to_fee(weight).to_signed();
38+
let long_term_fee: SignedAmount = long_term_fee_rate.to_fee(weight).to_signed();
3939
let waste = Self::calculate_waste(fee, long_term_fee);
4040
return Some(Self { value, weight, effective_value, fee, long_term_fee, waste });
4141
}

0 commit comments

Comments
 (0)