diff --git a/src/coin_grinder.rs b/src/coin_grinder.rs index a6af78e..39d68d0 100644 --- a/src/coin_grinder.rs +++ b/src/coin_grinder.rs @@ -454,4 +454,36 @@ mod tests { assert_coin_select_params(¶ms, Some(&["1 BTC", "1 BTC"])); } + + #[test] + fn tmp() { + let mut coins = Vec::new(); + + for i in 0..5 { + // Heavy: 3, 6, 9, 12, 15, + let heavy = 3 + 3 * i; + coins.push(heavy); + + // Medium: 2, 5, 8, 11, 14 + let medium = 2 + 3 * i; + coins.push(medium); + + // Light: 1, 4, 7, 10, 13 + let light = 1 + 3 * i; + coins.push(light); + } + + let c: Vec = coins.iter().map(|a| format!("{} BTC", a)).collect(); + let v4: Vec<&str> = c.iter().map(|s| s as &str).collect(); + + let params = ParamsStr { + target: "30 BTC", + change_target: "1000000 sats", + max_weight: "400000", + fee_rate: "5", + weighted_utxos: v4 + }; + + assert_coin_select_params(¶ms, Some(&["14 BTC", "13 BTC", "4 BTC"])); + } }