Assert error type

Improve test granularity by asserting the specific type of overflow
returned.
This commit is contained in:
yancy 2025-05-08 16:21:39 -05:00
parent 2f7e74da45
commit a7d059151e
1 changed files with 5 additions and 2 deletions

View File

@ -344,8 +344,11 @@ mod tests {
#[test] #[test]
fn fee_wu() { fn fee_wu() {
let fee_overflow = FeeRate::from_sat_per_kwu(10).to_fee(Weight::MAX); let operation = FeeRate::from_sat_per_kwu(10)
assert!(fee_overflow.is_error()); .to_fee(Weight::MAX)
.unwrap_err()
.operation();
assert!(operation.is_multiplication());
let fee_rate = FeeRate::from_sat_per_vb(2).unwrap(); let fee_rate = FeeRate::from_sat_per_vb(2).unwrap();
let weight = Weight::from_vb(3).unwrap(); let weight = Weight::from_vb(3).unwrap();