Skip to content

Commit a7d0591

Browse files
committed
Assert error type
Improve test granularity by asserting the specific type of overflow returned.
1 parent 2f7e74d commit a7d0591

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

units/src/fee.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,11 @@ mod tests {
344344

345345
#[test]
346346
fn fee_wu() {
347-
let fee_overflow = FeeRate::from_sat_per_kwu(10).to_fee(Weight::MAX);
348-
assert!(fee_overflow.is_error());
347+
let operation = FeeRate::from_sat_per_kwu(10)
348+
.to_fee(Weight::MAX)
349+
.unwrap_err()
350+
.operation();
351+
assert!(operation.is_multiplication());
349352

350353
let fee_rate = FeeRate::from_sat_per_vb(2).unwrap();
351354
let weight = Weight::from_vb(3).unwrap();

0 commit comments

Comments
 (0)