test,refactor(wallet): Move bump fee + foreign utxo tests#1907
test,refactor(wallet): Move bump fee + foreign utxo tests#1907ValuedMammal wants to merge 2 commits intobitcoindevkit:masterfrom
Conversation
These files added to wallet/tests directory - add_foreign_utxo.rs - build_fee_bump.rs
aagbotemi
left a comment
There was a problem hiding this comment.
Good job working on this PR @ValuedMammal
| let mut psbt = builder.finish().unwrap(); | ||
| wallet1.insert_txout(utxo.outpoint, utxo.txout); | ||
| let fee = check_fee!(wallet1, psbt); | ||
| let sent_received = |
There was a problem hiding this comment.
I suppose it will be easier to read if this tuple is named (sent_amount, received_amount)
| .only_witness_utxo() | ||
| .add_foreign_utxo(utxo.outpoint, psbt_input, foreign_utxo_satisfaction) | ||
| .unwrap(); | ||
| let mut psbt = builder.finish().unwrap(); |
There was a problem hiding this comment.
I am curious about how the change output was handled. I can't see a test case or the method responsible for that.
There was a problem hiding this comment.
If no change address is given, then the wallet looks for the next unused address from the change keychain
bdk/crates/wallet/src/wallet/mod.rs
Lines 1434 to 1438 in 5817ed0
And the result of coin selection determines whether the change output is finally added.
bdk/crates/wallet/src/wallet/mod.rs
Lines 1511 to 1517 in 5817ed0
|
@tvpeter thanks for reviewing. I agree with your suggestions, but since this is a refactor/ code move, it would be better in my opinion to not introduce logical changes and instead push those to a follow up PR. |
|
Reopened bitcoindevkit/bdk_wallet#199 |
These files are added to wallet/tests directory
fixes bitcoindevkit/bdk_wallet#21
Changelog notice
Checklists
All Submissions:
cargo fmtandcargo clippybefore committing