Skip to content

Commit

Permalink
wip: add max selection test for when some coins surpass the max allowed
Browse files Browse the repository at this point in the history
weight while others not.
  • Loading branch information
yancyribbens committed Jan 14, 2025
1 parent 7987d90 commit da4235f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/coin_grinder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,4 +401,25 @@ mod tests {

assert_coin_select_params(&params, 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(&params, None);
}
}

0 comments on commit da4235f

Please sign in to comment.