From 18608d39190632d7a7d7d25e272872095c2e1604 Mon Sep 17 00:00:00 2001 From: yancy Date: Tue, 14 Jan 2025 13:38:21 -0600 Subject: [PATCH] wip --- src/coin_grinder.rs | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/coin_grinder.rs b/src/coin_grinder.rs index 6903536..5553b34 100644 --- a/src/coin_grinder.rs +++ b/src/coin_grinder.rs @@ -386,7 +386,7 @@ mod tests { #[test] fn max_weight_exceeded () { let mut wu = Vec::new(); - for i in 0..10 { + for _i in 0..10 { wu.push("1 BTC/272"); wu.push("2 BTC/272"); } @@ -401,4 +401,25 @@ mod tests { assert_coin_select_params(¶ms, None); } + + #[test] + fn max_weight_with_result() { + let mut coins = Vec::new(); + for _i in 0..60 { + coins.push("0.33 BTC/272"); + } + for _i in 0..10 { + coins.push("2 BTC/272"); + } + + let params = ParamsStr { + target: "25.33 BTC", + change_target: "1000000 sats", + max_weight: "3000", + fee_rate: "5", + weighted_utxos: coins + }; + + assert_coin_select_params(¶ms, None); + } }