Skip to content

Commit

Permalink
Add max_weight test
Browse files Browse the repository at this point in the history
  • Loading branch information
yancyribbens committed Jan 13, 2025
1 parent b0a9f42 commit 5a40d0a
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/coin_grinder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,4 +382,23 @@ mod tests {

assert_coin_select_params(&params, None);
}

#[test]
fn max_weight_exceeded () {
let mut wu = Vec::new();
for i in 0..10 {
wu.push("1 BTC/272");
wu.push("2 BTC/272");
}

let params = ParamsStr {
target: "29.5 BTC",
change_target: "1000000 sats",
max_weight: "3000",
fee_rate: "5",
weighted_utxos: wu
};

assert_coin_select_params(&params, None);
}
}

0 comments on commit 5a40d0a

Please sign in to comment.