From 5a40d0a613ee4760db3d76a0e74c6e13453b4589 Mon Sep 17 00:00:00 2001 From: yancy Date: Tue, 7 Jan 2025 18:27:47 -0600 Subject: [PATCH] Add max_weight test --- src/coin_grinder.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/coin_grinder.rs b/src/coin_grinder.rs index 2df946d..6903536 100644 --- a/src/coin_grinder.rs +++ b/src/coin_grinder.rs @@ -382,4 +382,23 @@ mod tests { assert_coin_select_params(¶ms, 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(¶ms, None); + } }