Skip to content

Commit

Permalink
Add multiple coin weight test
Browse files Browse the repository at this point in the history
  • Loading branch information
yancyribbens committed Feb 5, 2025
1 parent 43fcf37 commit 5d1f472
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/coin_grinder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -454,4 +454,35 @@ mod tests {

assert_coin_select_params(&params, Some(&["1 BTC", "1 BTC"]));
}

#[test]
fn tmp() {
let coins = vec![
"1 BTC/600",
"2 BTC/1000",
"3 BTC/1400",
"4 BTC/600",
"5 BTC/1000",
"6 BTC/1400",
"7 BTC/600",
"8 BTC/1000",
"9 BTC/1400",
"10 BTC/600",
"11 BTC/1000",
"12 BTC/1400",
"13 BTC/600",
"14 BTC/1000",
"15 BTC/1400",
];

let params = ParamsStr {
target: "30 BTC",
change_target: "1000000 sats",
max_weight: "400000",
fee_rate: "5",
weighted_utxos: coins
};

assert_coin_select_params(&params, Some(&["14 BTC", "13 BTC", "4 BTC"]));
}
}

0 comments on commit 5d1f472

Please sign in to comment.